Skip to content

Commit 11f7141

Browse files
xuzhao9facebook-github-bot
authored andcommitted
Upgrade to CUDA 11.7 and remove V1 workflows (#1398)
Summary: Define the default Python version in `python_utils.py`. Define the default CUDA version in `cuda_utils.py`. To upgrade CUDA version: 1. Change the default CUDA version in `utils/cuda_utils.py` 2. Change the default CUDA version in the Dockerfile. Fixes #1390 Pull Request resolved: #1398 Reviewed By: atalman Differential Revision: D43086532 Pulled By: xuzhao9 fbshipit-source-id: 04b99af060be7dec951ac23558cef01e99de4472
1 parent 0c99340 commit 11f7141

17 files changed

+127
-328
lines changed

.github/workflows/pr-gha-runner.yml

+4-11
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ on:
44
workflow_dispatch:
55

66
env:
7-
PYTHON_VERSION: "3.10"
8-
CUDA_VERSION: "cu116"
97
CONDA_ENV: "pr-test"
10-
MAGMA_VERSION: "magma-cuda116"
118
SETUP_INSTANCE_SCRIPT: "/workspace/setup_instance.sh"
129

1310
jobs:
@@ -26,19 +23,15 @@ jobs:
2623
- name: Setup Conda Env
2724
run: |
2825
. "${SETUP_INSTANCE_SCRIPT}"
29-
conda create -n "${CONDA_ENV}" python="${PYTHON_VERSION}"
26+
python utils/python_utils.py --create-conda-env "${CONDA_ENV}"
3027
conda activate "${CONDA_ENV}"
31-
conda install -y "${MAGMA_VERSION}" -c pytorch
32-
conda install -y numpy requests ninja pyyaml setuptools gitpython beautifulsoup4 regex
33-
# weasyprint requires libglib from conda
34-
# doctr_reco_predictor needs weasyprint, which needs libglib and pango
35-
conda install -y expecttest libglib pango -c conda-forge
36-
pip install unittest-xml-reporting
28+
sudo python utils/cuda_utils.py --setup-cuda-softlink
29+
python utils/cuda_utils.py --install-torch-deps
3730
- name: Install PyTorch nightly
3831
run: |
3932
. "${SETUP_INSTANCE_SCRIPT}"
4033
conda activate "${CONDA_ENV}"
41-
pip install --pre torch torchvision torchtext torchaudio -f https://download.pytorch.org/whl/nightly/cu116/torch_nightly.html
34+
python utils/cuda_utils.py --install-torch-nightly
4235
- name: Install TorchBench
4336
run: |
4437
. "${SETUP_INSTANCE_SCRIPT}"

.github/workflows/userbenchmark-a100.yml

+4-13
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ on:
99
userbenchmark_options:
1010
description: "Option of the user benchmark to run"
1111
env:
12-
PYTHON_VERSION: "3.8"
13-
TENSORRT_PYTHON_VERSION: "cp38"
14-
TENSORRT_VERSION: "8.2.4.2"
15-
CUDA_VERSION: "cu116"
1612
CONDA_ENV_NAME: "userbenchmarks-ci"
17-
MAGMA_VERSION: "magma-cuda116"
1813
PLATFORM_NAME: "gcp_a100"
1914
TORCHBENCH_USERBENCHMARK_SCRIBE_GRAPHQL_ACCESS_TOKEN: ${{ secrets.TORCHBENCH_USERBENCHMARK_SCRIBE_GRAPHQL_ACCESS_TOKEN }}
2015
SETUP_SCRIPT: "/workspace/setup_instance.sh"
@@ -30,7 +25,8 @@ jobs:
3025
- name: Create conda environment
3126
run: |
3227
. "${SETUP_SCRIPT}"
33-
conda create -y -q --name "${CONDA_ENV_NAME}" python="${PYTHON_VERSION}"
28+
python benchmark/utils/python_utils.py --create-conda-env "${CONDA_ENV_NAME}"
29+
sudo python utils/cuda_utils.py --setup-cuda-softlink
3430
- name: Tune Nvidia GPU
3531
run: |
3632
. "${SETUP_SCRIPT}"
@@ -41,11 +37,7 @@ jobs:
4137
run: |
4238
. "${SETUP_SCRIPT}" && conda activate "${CONDA_ENV_NAME}"
4339
pushd benchmark
44-
# Install dependencies
45-
conda install -y numpy requests ninja pyyaml setuptools gitpython beautifulsoup4 regex
46-
conda install -y expecttest libglib pango -c conda-forge
47-
conda install -y -c pytorch "${MAGMA_VERSION}"
48-
pip install requests bs4 argparse gitpython boto3 pyyaml numpy regex psutil
40+
python utils/cuda_utils.py --install-torch-deps
4941
# Check if nightly builds are available
5042
NIGHTLIES=$(python torchbenchmark/util/torch_nightly.py --packages torch)
5143
# If failed, the script will generate empty result
@@ -54,8 +46,7 @@ jobs:
5446
exit 1
5547
fi
5648
# Install PyTorch nightly and domain libraries from pip
57-
pip install --pre torch torchtext torchvision torchaudio \
58-
-f https://download.pytorch.org/whl/nightly/${CUDA_VERSION}/torch_nightly.html
49+
python utils/cuda_utils.py --install-torch-nightly
5950
# make sure pytorch+cuda works
6051
python -c "import torch; torch.cuda.init()"
6152
- name: Install TorchBench

.github/workflows/userbenchmark-t4-metal.yml

+5-11
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ on:
99
userbenchmark_options:
1010
description: "Option of the user benchmark to run"
1111
env:
12-
PYTHON_VERSION: "3.8"
13-
CUDA_VERSION: "cu116"
1412
CONDA_ENV_NAME: "userbenchmarks-ci"
15-
MAGMA_VERSION: "magma-cuda116"
1613
PLATFORM_NAME: "aws_t4_metal"
1714
TORCHBENCH_USERBENCHMARK_SCRIBE_GRAPHQL_ACCESS_TOKEN: ${{ secrets.TORCHBENCH_USERBENCHMARK_SCRIBE_GRAPHQL_ACCESS_TOKEN }}
1815
SETUP_SCRIPT: "/data/nvme/bin/setup_instance.sh"
@@ -27,19 +24,17 @@ jobs:
2724
path: benchmark
2825
- name: Create conda environment
2926
run: |
30-
conda create -y -q --name "${CONDA_ENV_NAME}" python="${PYTHON_VERSION}"
27+
python benchmark/utils/python_utils.py --create-conda-env "${CONDA_ENV_NAME}"
28+
sudo python utils/cuda_utils.py --setup-cuda-softlink
3129
- name: Install PyTorch nightly
3230
run: |
3331
. "${SETUP_SCRIPT}" && . activate "${CONDA_ENV_NAME}"
3432
pushd benchmark
3533
# Install dependencies
36-
conda install -y pyyaml numpy ninja regex gitpython setuptools beautifulsoup4 requests
37-
conda install -y libglib pango expecttest -c conda-forge
34+
python utils/cuda_utils.py --install-torch-deps
3835
# check the machine is tuned
39-
pip install -U py-cpuinfo psutil distro
36+
pip install -U py-cpuinfo psutil distro boto3
4037
sudo ${HOME}/miniconda3/envs/${CONDA_ENV_NAME}/bin/python3 torchbenchmark/util/machine_config.py
41-
conda install -y -c pytorch "${MAGMA_VERSION}"
42-
pip install requests bs4 argparse gitpython boto3 regex
4338
# Check if nightly builds are available
4439
NIGHTLIES=$(python torchbenchmark/util/torch_nightly.py --packages torch)
4540
# If failed, the script will generate empty result
@@ -48,8 +43,7 @@ jobs:
4843
exit 1
4944
fi
5045
# Install PyTorch and torchvision nightly from pip
51-
pip install --pre torch torchvision torchtext torchaudio \
52-
-f https://download.pytorch.org/whl/nightly/${CUDA_VERSION}/torch_nightly.html
46+
python utils/cuda_utils.py --install-torch-nightly
5347
# make sure pytorch+cuda works
5448
python -c "import torch; torch.cuda.init()"
5549
- name: Install TorchBench

.github/workflows/v1-bisection.yml

-74
This file was deleted.

.github/workflows/v1-nightly.yml

-122
This file was deleted.

0 commit comments

Comments
 (0)