Skip to content

Commit 0bd1993

Browse files
authored
chore(ci/litjob): fix and optimize GPU related tests (#21290)
* fix: add unzip to dependencies in pytorch workflow * fix: update variable interpolation for PACKAGE_NAME in YAML workflows * fix: update variable interpolation for PACKAGE_NAME in fabric workflow * fix: disable CUDA_LAUNCH_BLOCKING to speed up tests * apply suggestion
1 parent 573828a commit 0bd1993

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

.azure/gpu-tests-fabric.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
cuda_ver=$(python -c "import torch ; print(''.join(map(str, torch.version.cuda.split('.')[:2])))")
7777
echo "##vso[task.setvariable variable=CUDA_VERSION_MM]$cuda_ver"
7878
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/cu${cuda_ver}/torch_stable.html"
79-
scope=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="lightning_fabric").get(n, n))')
79+
scope=$(python -c 'n = "${PACKAGE_NAME}" ; print(dict(fabric="lightning_fabric").get(n, n))')
8080
echo "##vso[task.setvariable variable=COVERAGE_SOURCE]$scope"
8181
displayName: "set env. vars"
8282
- bash: |
@@ -140,7 +140,7 @@ jobs:
140140
141141
- bash: |
142142
set -e
143-
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
143+
extra=$(python -c "print({'lightning': 'fabric-'}.get('${PACKAGE_NAME}', ''))")
144144
pip install -e ".[${extra}dev]" -U --upgrade-strategy=eager --extra-index-url="${TORCH_URL}"
145145
displayName: "Install package & dependencies"
146146

.azure/gpu-tests-pytorch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
cuda_ver=$(python -c "import torch ; print(''.join(map(str, torch.version.cuda.split('.')[:2])))")
7676
echo "##vso[task.setvariable variable=CUDA_VERSION_MM]$cuda_ver"
7777
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/cu${cuda_ver}/torch_stable.html"
78-
scope=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(pytorch="pytorch_lightning").get(n, n))')
78+
scope=$(python -c 'n = "${PACKAGE_NAME}" ; print(dict(pytorch="pytorch_lightning").get(n, n))')
7979
echo "##vso[task.setvariable variable=COVERAGE_SOURCE]$scope"
8080
displayName: "set env. vars"
8181
- bash: |
@@ -139,7 +139,7 @@ jobs:
139139
140140
- bash: |
141141
set -e
142-
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
142+
extra=$(python -c "print({'lightning': 'pytorch-'}.get('${PACKAGE_NAME}', ''))")
143143
pip install -e ".[${extra}dev]" -U --upgrade-strategy=eager --extra-index-url="${TORCH_URL}"
144144
displayName: "Install package & dependencies"
145145

.lightning/workflows/fabric.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ run: |
8585
CUDA_VERSION_M_M="${CUDA_VERSION%.*}" # "12.6"
8686
CUDA_VERSION_MM="${CUDA_VERSION_M_M//./}" # "126"
8787
export UV_TORCH_BACKEND=cu${CUDA_VERSION_MM}
88-
COVERAGE_SOURCE=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="lightning_fabric").get(n, n))')
88+
COVERAGE_SOURCE=$(python -c 'n = "${PACKAGE_NAME}" ; print(dict(fabric="lightning_fabric").get(n, n))')
8989
echo "collecting coverage for: ${COVERAGE_SOURCE}"
9090
9191
uv pip install fire wget packaging "lightning-utilities[cli]"
@@ -120,7 +120,7 @@ run: |
120120
fi
121121
122122
echo "Install package with [${PACKAGE_NAME}] extras"
123-
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
123+
extra=$(python -c "print({'lightning': 'fabric-'}.get('${PACKAGE_NAME}', ''))")
124124
uv pip install ".[${extra}dev]" --upgrade
125125
126126
python requirements/collect_env_details.py

.lightning/workflows/pytorch.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ env:
2727
DEBIAN_FRONTEND: "noninteractive"
2828
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda"
2929
MKL_THREADING_LAYER: "GNU"
30-
CUDA_LAUNCH_BLOCKING: "1"
3130
NCCL_DEBUG: "INFO"
3231
TORCHDYNAMO_VERBOSE: "1"
3332
FREEZE_REQUIREMENTS: "1"
@@ -50,7 +49,8 @@ run: |
5049
openmpi-bin \
5150
ninja-build \
5251
libnccl2 \
53-
libnccl-dev
52+
libnccl-dev \
53+
unzip
5454
5555
echo "Install Python ${python_version} and UV"
5656
apt-get install -y python${python_version} python${python_version}-venv python${python_version}-dev
@@ -85,7 +85,7 @@ run: |
8585
CUDA_VERSION_M_M="${CUDA_VERSION%.*}" # "12.6"
8686
CUDA_VERSION_MM="${CUDA_VERSION_M_M//./}" # "126"
8787
export UV_TORCH_BACKEND=cu${CUDA_VERSION_MM}
88-
COVERAGE_SOURCE=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="pytorch_lightning").get(n, n))')
88+
COVERAGE_SOURCE=$(python -c 'n = "${PACKAGE_NAME}" ; print(dict(fabric="pytorch_lightning").get(n, n))')
8989
echo "collecting coverage for: ${COVERAGE_SOURCE}"
9090
9191
uv pip install -q fire wget packaging "lightning-utilities[cli]"
@@ -120,7 +120,7 @@ run: |
120120
fi
121121
122122
echo "Install package"
123-
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
123+
extra=$(python -c "print({'lightning': 'pytorch-'}.get('${PACKAGE_NAME}', ''))")
124124
uv pip install -e ".[${extra}dev]" --upgrade
125125
126126
echo "Ensure only a single package is installed"

0 commit comments

Comments
 (0)