Skip to content

Commit 6f191e9

Browse files
janeyx99facebook-github-bot
authored andcommitted
Migrate optimizer userbenchmarks to linux aws 100 runners (#2557)
Summary: The migration is larger than I thought--I will test this time to ensure it's correct. Tested here: https://github.com/pytorch/benchmark/actions/runs/12321260782/job/34392279551 Pull Request resolved: #2557 Reviewed By: kit1980 Differential Revision: D67211361 Pulled By: janeyx99 fbshipit-source-id: 686e07aab132c18c1fe1a0ffd444ec66f29802ef
1 parent 35c734e commit 6f191e9

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

.github/workflows/userbenchmark-regression-detector.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,41 @@ jobs:
1515
timeout-minutes: 1440 # 24 hours
1616
environment: docker-s3-upload
1717
env:
18-
BASE_CONDA_ENV: "torchbench"
1918
CONDA_ENV: "optim"
2019
PLATFORM_NAME: "gcp_a100"
2120
TORCHBENCH_USERBENCHMARK_SCRIBE_GRAPHQL_ACCESS_TOKEN: ${{ secrets.TORCHBENCH_USERBENCHMARK_SCRIBE_GRAPHQL_ACCESS_TOKEN }}
2221
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2322
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
24-
SETUP_SCRIPT: "/workspace/setup_instance.sh"
2523
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
2624
steps:
2725
- name: Checkout TorchBench
2826
uses: actions/checkout@v3
2927
with:
3028
path: benchmark
31-
- name: Tune Nvidia GPU
29+
- name: Install Conda
3230
run: |
33-
sudo nvidia-smi -pm 1
34-
sudo nvidia-smi -ac 1215,1410
35-
nvidia-smi
36-
- name: Clone and setup Conda env
37-
run: |
38-
CONDA_ENV=${BASE_CONDA_ENV} . "${SETUP_SCRIPT}"
39-
conda create --name "${CONDA_ENV}" --clone "${BASE_CONDA_ENV}"
31+
set -x
32+
pushd benchmark
33+
bash ./.ci/torchbench/install-conda.sh
4034
- name: Install TorchBench
4135
run: |
4236
set -x
43-
. "${SETUP_SCRIPT}"
37+
. "${HOME}"/miniconda3/etc/profile.d/conda.sh
38+
conda activate "${CONDA_ENV}"
4439
pushd benchmark
4540
# only install the subset of models currently running.
4641
python install.py BERT_pytorch DALLE2_pytorch hf_GPT2_large hf_T5_large resnet50 timm_vision_transformer_large yolov3
4742
- name: Print torch.version.git_version
4843
run: |
4944
set -x
50-
. "${SETUP_SCRIPT}"
45+
. "${HOME}"/miniconda3/etc/profile.d/conda.sh
46+
conda activate "${CONDA_ENV}"
5147
python -c "import torch; print(torch.version.git_version)"
5248
- name: Run optim user benchmark
5349
run: |
5450
set -x
55-
. "${SETUP_SCRIPT}"
51+
. "${HOME}"/miniconda3/etc/profile.d/conda.sh
52+
conda activate "${CONDA_ENV}"
5653
# remove old results
5754
if [ -d benchmark-output ]; then rm -Rf benchmark-output; fi
5855
pushd benchmark
@@ -65,7 +62,9 @@ jobs:
6562
- name: Detect potential regressions
6663
continue-on-error: true
6764
run: |
68-
. "${SETUP_SCRIPT}"
65+
set -x
66+
. "${HOME}"/miniconda3/etc/profile.d/conda.sh
67+
conda activate "${CONDA_ENV}"
6968
pushd benchmark
7069
RESULTS=($(find ${PWD}/../benchmark-output -name "metrics-*.json" -maxdepth 2 | sort -r))
7170
# TODO: the following assumes only one metrics-*.json is found. It will keep
@@ -86,7 +85,8 @@ jobs:
8685
torchbench-perf-report
8786
- name: Upload result jsons to Scribe and S3
8887
run: |
89-
. "${SETUP_SCRIPT}"
88+
. "${HOME}"/miniconda3/etc/profile.d/conda.sh
89+
conda activate "${CONDA_ENV}"
9090
pushd benchmark
9191
RESULTS=($(find ${PWD}/../benchmark-output -name "metrics-*.json" -maxdepth 2 | sort -r))
9292
echo "Uploading result jsons: ${RESULTS}"
@@ -102,13 +102,13 @@ jobs:
102102
- name: Finally, error if errors.txt exists
103103
if: always()
104104
run: |
105+
set -x
105106
# Do not error earlier as we want all artifacts and regressions to be reported first
106107
# TODO: potentially move errors.txt to benchmark-output so it gets uploaded to S3
107108
pushd benchmark
108109
if [ -e errors.txt ]; then cat errors.txt && exit 1; fi
109110
- name: Remove conda environment
110111
if: always()
111112
run: |
112-
. "${SETUP_SCRIPT}"
113-
conda deactivate && conda deactivate
113+
. ${HOME}/miniconda3/etc/profile.d/conda.sh
114114
conda remove -n "${CONDA_ENV}" --all

0 commit comments

Comments
 (0)