From 3fe91fb79bda21497d4f9fe39a3a638bc6026e9d Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 4 Feb 2025 08:20:28 -0800 Subject: [PATCH 1/4] Apply changes to userbenchmark a100 release --- .../workflows/userbenchmark-a100-release.yml | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/userbenchmark-a100-release.yml b/.github/workflows/userbenchmark-a100-release.yml index 42f47b7bab..ea41992d14 100644 --- a/.github/workflows/userbenchmark-a100-release.yml +++ b/.github/workflows/userbenchmark-a100-release.yml @@ -13,43 +13,50 @@ jobs: BASE_CONDA_ENV: "torchbench" CONDA_ENV: "userbenchmark-a100" PLATFORM_NAME: "gcp_a100" - SETUP_SCRIPT: "/workspace/setup_instance.sh" steps: - name: Checkout TorchBench uses: actions/checkout@v3 with: path: benchmark ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - - name: Clone and setup conda env + - name: Install Conda run: | - CONDA_ENV=${BASE_CONDA_ENV} . "${SETUP_SCRIPT}" - conda create --name "${CONDA_ENV}" --clone "${BASE_CONDA_ENV}" + bash ./.ci/torchbench/install-conda.sh - name: Install TorchBench run: | - set -x - . "${SETUP_SCRIPT}" - pushd benchmark - python install.py + bash ./.ci/torchbench/install.sh - name: Run user benchmark run: | set -x - . "${SETUP_SCRIPT}" + . ${HOME}/miniconda3/etc/profile.d/conda.sh + conda activate "${CONDA_ENV}" + # remove old results if [ -d benchmark-output ]; then rm -Rf benchmark-output; fi - pushd benchmark - release_version=$(cat userbenchmark/release-test/version.txt) - if [ -d .userbenchmark ]; then rm -Rf .userbenchmark; fi - python run_benchmark.py release-test -c ${release_version} - cp -r ./.userbenchmark/release-test ../benchmark-output + if [ -d .userbenchmark ]; then rm -Rf .userbenchmark; fi + MANUAL_WORKFLOW="${{ github.event.inputs.userbenchmark_name }}" + if [ -z "${MANUAL_WORKFLOW}" ]; then + # Figure out what userbenchmarks we should run, and run it + python ./.github/scripts/userbenchmark/schedule-benchmarks.py --platform ${PLATFORM_NAME} + if [ -d ./.userbenchmark ]; then + cp -r ./.userbenchmark benchmark-output + else + mkdir benchmark-output + fi + else + python run_benchmark.py "${{ github.event.inputs.userbenchmark_name }}" ${{ github.event.inputs.userbenchmark_options }} + cp -r ./.userbenchmark/"${{ github.event.inputs.userbenchmark_name }}" benchmark-output + ls -las benchmark-output + pwd + fi - name: Upload artifact uses: actions/upload-artifact@v4 with: name: TorchBench result - path: benchmark-output/ + path: benchmark-output - name: Clean up Conda env if: always() run: | - . "${SETUP_SCRIPT}" - conda deactivate && conda deactivate + . ${HOME}/miniconda3/etc/profile.d/conda.sh conda remove -n "${CONDA_ENV}" --all From 3a70e3e074f518b8c9280d4c0204aeefb916171a Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 4 Feb 2025 08:26:34 -0800 Subject: [PATCH 2/4] fix --- .../workflows/userbenchmark-a100-release.yml | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/userbenchmark-a100-release.yml b/.github/workflows/userbenchmark-a100-release.yml index ea41992d14..a4c7e04448 100644 --- a/.github/workflows/userbenchmark-a100-release.yml +++ b/.github/workflows/userbenchmark-a100-release.yml @@ -34,22 +34,12 @@ jobs: # remove old results if [ -d benchmark-output ]; then rm -Rf benchmark-output; fi + release_version=$(cat ./.github/scripts/userbenchmark/release-test/version.txt) if [ -d .userbenchmark ]; then rm -Rf .userbenchmark; fi - MANUAL_WORKFLOW="${{ github.event.inputs.userbenchmark_name }}" - if [ -z "${MANUAL_WORKFLOW}" ]; then - # Figure out what userbenchmarks we should run, and run it - python ./.github/scripts/userbenchmark/schedule-benchmarks.py --platform ${PLATFORM_NAME} - if [ -d ./.userbenchmark ]; then - cp -r ./.userbenchmark benchmark-output - else - mkdir benchmark-output - fi - else - python run_benchmark.py "${{ github.event.inputs.userbenchmark_name }}" ${{ github.event.inputs.userbenchmark_options }} - cp -r ./.userbenchmark/"${{ github.event.inputs.userbenchmark_name }}" benchmark-output - ls -las benchmark-output - pwd - fi + + python run_benchmark.py release-test -c ${release_version} + cp -r ./.userbenchmark/release-test benchmark-output + - name: Upload artifact uses: actions/upload-artifact@v4 with: From 7ff543a07c7b620422cbb5534cbbedc082cb07b3 Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 4 Feb 2025 08:29:02 -0800 Subject: [PATCH 3/4] fix --- .github/workflows/userbenchmark-a100-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/userbenchmark-a100-release.yml b/.github/workflows/userbenchmark-a100-release.yml index a4c7e04448..3f744198f7 100644 --- a/.github/workflows/userbenchmark-a100-release.yml +++ b/.github/workflows/userbenchmark-a100-release.yml @@ -3,6 +3,7 @@ on: pull_request: paths: - userbenchmark/release-test/* + - .github/workflows/userbenchmark-a100-release.yml jobs: run-userbenchmark: From 34b71e7395d83364a997e0a84d2a027054e2603d Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 4 Feb 2025 08:31:59 -0800 Subject: [PATCH 4/4] fix --- .github/workflows/userbenchmark-a100-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/userbenchmark-a100-release.yml b/.github/workflows/userbenchmark-a100-release.yml index 3f744198f7..1c19a8ba41 100644 --- a/.github/workflows/userbenchmark-a100-release.yml +++ b/.github/workflows/userbenchmark-a100-release.yml @@ -18,7 +18,6 @@ jobs: - name: Checkout TorchBench uses: actions/checkout@v3 with: - path: benchmark ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - name: Install Conda run: |