From 847b753358adc33dc19e96687f7733e00bb5aa62 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Tue, 17 Oct 2023 11:01:29 -0700 Subject: [PATCH] [ci] Add action to copy gpu args/op binaries --- .github/actions/prepare-gpu/action.yml | 29 ++++++++++++++++++++ .github/scripts/copy-gpu-binaries.sh | 23 ++++++++++++++++ .github/workflows/chipyard-run-tests-gpu.yml | 2 ++ 3 files changed, 54 insertions(+) create mode 100644 .github/actions/prepare-gpu/action.yml create mode 100755 .github/scripts/copy-gpu-binaries.sh diff --git a/.github/actions/prepare-gpu/action.yml b/.github/actions/prepare-gpu/action.yml new file mode 100644 index 00000000..050e4657 --- /dev/null +++ b/.github/actions/prepare-gpu/action.yml @@ -0,0 +1,29 @@ +name: prepare-gpu +description: 'Copy over GPU binaries to be used in simulation time to sims directory' + +inputs: + group-key: + description: group key + required: true + prepare-script: + description: prepare script to use + required: false + default: "copy-gpu-binaries.sh" + toolchain: + description: toolchain to use + required: false + default: "riscv-tools" + +runs: + using: "composite" + steps: + - name: Init submodules to ensure stimuli is located + run: | + conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-${{ inputs.toolchain }} + ./scripts/init-submodules-no-riscv-tools.sh --force + shell: bash -leo pipefail {0} + + - name: Copy binaries from rocket-gpu + run: | + ./.github/scripts/${{ inputs.prepare-script }} + shell: bash -leo pipefail {0} diff --git a/.github/scripts/copy-gpu-binaries.sh b/.github/scripts/copy-gpu-binaries.sh new file mode 100755 index 00000000..23ea1366 --- /dev/null +++ b/.github/scripts/copy-gpu-binaries.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# copy gpu binaries from stimuli folder +# usage: +# copy-gpu-binaries.sh + +# turn echo on and error on earliest command +set -ex + +# get shared variables +SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" +source $SCRIPT_DIR/defaults.sh + +cd $REMOTE_CHIPYARD_DIR + +cp -a $REMOTE_CHIPYARD_DIR/generators/rocket-gpu/stimuli/vecadd.bin.elf \ + $REMOTE_SIM_DIR/ +cp -a $REMOTE_CHIPYARD_DIR/generators/rocket-gpu/stimuli/vecadd.args.size64.romAddr.bin \ + $REMOTE_SIM_DIR/args.bin +cp -a $REMOTE_CHIPYARD_DIR/generators/rocket-gpu/stimuli/vecadd.input.a.size64.bin \ + $REMOTE_SIM_DIR/op_a.bin +cp -a $REMOTE_CHIPYARD_DIR/generators/rocket-gpu/stimuli/vecadd.input.b.size64.bin \ + $REMOTE_SIM_DIR/op_b.bin diff --git a/.github/workflows/chipyard-run-tests-gpu.yml b/.github/workflows/chipyard-run-tests-gpu.yml index 6d8c16c3..4a5516ca 100644 --- a/.github/workflows/chipyard-run-tests-gpu.yml +++ b/.github/workflows/chipyard-run-tests-gpu.yml @@ -133,6 +133,8 @@ jobs: uses: ./.github/actions/git-workaround - name: Create conda env uses: ./.github/actions/create-conda-env + - name: Prepare GPU binaries + uses: ./.github/actions/prepare-gpu - name: Build RTL on self-hosted uses: ./.github/actions/prepare-rtl with: