Skip to content

Commit 607e1b0

Browse files
authored
Validate framework changes, intorduce get_stable_cuda.py add py3.13t required changes (#6339)
1. Introduce get_stable_cuda, this way we don't need to hardcode current stable cuda version in validations 2. Add py3.13t versions
1 parent 2a18211 commit 607e1b0

File tree

5 files changed

+60
-16
lines changed

5 files changed

+60
-16
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ else
2121
# Conda pinned see issue: https://github.com/ContinuumIO/anaconda-issues/issues/13350
2222
conda install -y conda=23.11.0
2323
fi
24-
# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
25-
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
26-
conda activate ${ENV_NAME}
2724

28-
# Remove when https://github.com/pytorch/builder/issues/1985 is fixed
29-
if [[ ${MATRIX_GPU_ARCH_TYPE} == 'cuda-aarch64' ]]; then
30-
pip3 install numpy --force-reinstall
25+
if [[ ${MATRIX_PYTHON_VERSION} == "3.13t" ]]; then
26+
conda create -y -n ${ENV_NAME} python=3.13 python-freethreading -c conda-forge
27+
conda activate ${ENV_NAME}
28+
TORCH_ONLY='true'
29+
else
30+
# Please note ffmpeg is required for torchaudio, see https://github.com/pytorch/pytorch/issues/96159
31+
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} ffmpeg
32+
conda activate ${ENV_NAME}
3133
fi
3234

35+
pip3 install numpy --force-reinstall
3336
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
3437
TEST_SUFFIX=""
3538

@@ -79,8 +82,8 @@ else
7982

8083
pushd ${PWD}/.ci/pytorch/
8184

82-
# TODO: enable torch-compile on ROCM
83-
if [[ ${MATRIX_GPU_ARCH_TYPE} == "rocm" ]]; then
85+
# TODO: enable torch-compile on ROCM and on 3.13t
86+
if [[ ${MATRIX_GPU_ARCH_TYPE} == "rocm" || ${MATRIX_PYTHON_VERSION} == "3.13t" ]]; then
8487
TEST_SUFFIX=${TEST_SUFFIX}" --torch-compile-check disabled"
8588
fi
8689

.github/workflows/validate-linux-binaries.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ jobs:
158158
eval "$(conda shell.bash hook)"
159159
printf '%s\n' ${{ toJson(inputs.release-matrix) }} > release_matrix.json
160160
161+
CUDA_VERSION_STABLE=$(python3 ../../test-infra/tools/scripts/get_stable_cuda_version.py --channel ${MATRIX_CHANNEL})
161162
# Special case PyPi installation package. And Install of PyPi package via poetry
162163
if [[ ${MATRIX_PACKAGE_TYPE} == "manywheel" && \
163-
${MATRIX_GPU_ARCH_VERSION} == "12.4" && \
164+
${MATRIX_GPU_ARCH_VERSION} == "${CUDA_VERSION_STABLE}" && \
164165
${MATRIX_CHANNEL} == "release" && \
165166
${USE_ONLY_DL_PYTORCH_ORG} == "false" ]]; then
166167
source ../../test-infra/.github/scripts/validate_pipy.sh
@@ -183,15 +184,16 @@ jobs:
183184
timeout: 180
184185
script: |
185186
set -ex
186-
cd .ci/pytorch/
187187
python3 -m ensurepip --upgrade
188+
CUDA_VERSION=$(python3 ../../test-infra/tools/scripts/get_stable_cuda_version.py --channel ${{ inputs.channel }})
189+
CUDA_VERSION_NODOT=$(echo $CUDA_VERSION | tr -d '.')
188190
189-
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/nightly/cu124"
191+
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/nightly/cu${CUDA_VERSION_NODOT}"
190192
if [[ ${{ inputs.channel }} == 'test' ]]; then
191-
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/test/cu124"
193+
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/test/cu${CUDA_VERSION_NODOT}"
192194
elif [[ ${{ inputs.channel }} == 'release' ]]; then
193-
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/cu124"
195+
DWN_PYTORCH_ORG="https://download.pytorch.org/whl/cu${CUDA_VERSION_NODOT}"
194196
fi
195197
196198
python3 -m pip install torch --index-url ${DWN_PYTORCH_ORG}
197-
python3 -c "import torch"
199+
python3 .ci/pytorch/smoke_test/smoke_test.py --package torchonly

.github/workflows/validate-pypi-wheel-binary-size.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ jobs:
3232
pip3 install -r tools/binary_size_validation/requirements.txt
3333
- name: Run validation
3434
run: |
35+
# shellcheck disable=SC2086
36+
CUDA_VERSION=$(python3 tools/scripts/get_stable_cuda_version.py --channel ${CHANNEL})
37+
# shellcheck disable=SC2086
38+
CUDA_VERSION_NODOT=$(echo ${CUDA_VERSION} | tr -d '.')
39+
3540
# shellcheck disable=SC2086
3641
python tools/binary_size_validation/binary_size_validation.py \
37-
--url https://download.pytorch.org/whl/${CHANNEL}/cu124/torch/ \
38-
--include "linux" --only-latest-version --threshold 750
42+
--url https://download.pytorch.org/whl/${CHANNEL}/cu${CUDA_VERSION_NODOT}/torch/ \
43+
--include "manylinux" --only-latest-version --threshold 750

tools/scripts/generate_binary_build_matrix.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
"12.8": {"cuda": "12.8.0", "cudnn": "9"},
4545
}
4646

47+
STABLE_CUDA_VERSIONS = {
48+
"nightly": "12.6",
49+
"test": "12.4",
50+
"release": "12.4",
51+
}
52+
4753
CUDA_AARCH64_ARCHES = ["12.6-aarch64", "12.8-aarch64"]
4854

4955
PACKAGE_TYPES = ["wheel", "conda", "libtorch"]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python3
2+
3+
"""Return stable CUDA version for the current channel"""
4+
5+
import argparse
6+
import json
7+
import os
8+
import sys
9+
from typing import List
10+
11+
12+
def main(args: List[str]) -> None:
13+
import generate_binary_build_matrix
14+
15+
parser = argparse.ArgumentParser()
16+
parser.add_argument(
17+
"--channel",
18+
help="Channel to use, default nightly",
19+
type=str,
20+
choices=["nightly", "test", "release"],
21+
default=os.getenv("CHANNEL", "nightly"),
22+
)
23+
options = parser.parse_args(args)
24+
print(generate_binary_build_matrix.STABLE_CUDA_VERSIONS[options.channel])
25+
26+
27+
if __name__ == "__main__":
28+
main(sys.argv[1:])

0 commit comments

Comments
 (0)