Skip to content

Commit ef99f92

Browse files
committed
[CI] Drop python 3.8, torch 2.0, add python 3.13, torch 2.5 & 2.6dev
1 parent fb30432 commit ef99f92

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

.github/workflows/publish.yaml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,43 @@ jobs:
4343
# Using ubuntu-20.04 instead of 22.04 for more compatibility (glibc). Ideally we'd use the
4444
# manylinux docker image, but I haven't figured out how to install CUDA on manylinux.
4545
os: [ubuntu-20.04]
46-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
47-
torch-version: ['2.0.1', '2.1.2', '2.2.2', '2.3.1', '2.4.0']
48-
cuda-version: ['11.8.0', '12.2.2']
46+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
47+
torch-version: ['2.1.2', '2.2.2', '2.3.1', '2.4.0', '2.5.1', '2.6.0.dev20241010']
48+
cuda-version: ['11.8.0', '12.3.2']
4949
# We need separate wheels that either uses C++11 ABI (-D_GLIBCXX_USE_CXX11_ABI) or not.
5050
# Pytorch wheels currently don't use it, but nvcr images have Pytorch compiled with C++11 ABI.
5151
# Without this we get import error (undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationESs)
5252
# when building without C++11 ABI and using it on nvcr images.
5353
cxx11_abi: ['FALSE', 'TRUE']
5454
exclude:
55+
# see https://github.com/pytorch/pytorch/blob/main/RELEASE.md#release-compatibility-matrix
5556
# Pytorch < 2.2 does not support Python 3.12
56-
- torch-version: '2.0.1'
57-
python-version: '3.12'
5857
- torch-version: '2.1.2'
5958
python-version: '3.12'
60-
# Pytorch <= 2.0 only supports CUDA <= 11.8
61-
- torch-version: '2.0.1'
62-
cuda-version: '12.2.2'
59+
# Pytorch < 2.5 does not support Python 3.13
60+
- torch-version: '2.1.2'
61+
python-version: '3.13'
62+
- torch-version: '2.2.2'
63+
python-version: '3.13'
64+
- torch-version: '2.3.1'
65+
python-version: '3.13'
66+
- torch-version: '2.4.0'
67+
python-version: '3.13'
6368

6469
steps:
6570
- name: Checkout
66-
uses: actions/checkout@v3
71+
uses: actions/checkout@v4
6772

6873
- name: Set up Python
69-
uses: actions/setup-python@v4
74+
uses: actions/setup-python@v5
7075
with:
7176
python-version: ${{ matrix.python-version }}
7277

7378
- name: Set CUDA and PyTorch versions
7479
run: |
7580
echo "MATRIX_CUDA_VERSION=$(echo ${{ matrix.cuda-version }} | awk -F \. {'print $1 $2'})" >> $GITHUB_ENV
7681
echo "MATRIX_TORCH_VERSION=$(echo ${{ matrix.torch-version }} | awk -F \. {'print $1 "." $2'})" >> $GITHUB_ENV
82+
echo "WHEEL_CUDA_VERSION=$(echo ${{ matrix.cuda-version }} | awk -F \. {'print $1'})" >> $GITHUB_ENV
7783
7884
- name: Free up disk space
7985
if: ${{ runner.os == 'Linux' }}
@@ -92,33 +98,31 @@ jobs:
9298

9399
- name: Install CUDA ${{ matrix.cuda-version }}
94100
if: ${{ matrix.cuda-version != 'cpu' }}
95-
uses: Jimver/cuda-toolkit@v0.2.14
101+
uses: Jimver/cuda-toolkit@v0.2.19
96102
id: cuda-toolkit
97103
with:
98104
cuda: ${{ matrix.cuda-version }}
99105
linux-local-args: '["--toolkit"]'
100106
# default method is "local", and we're hitting some error with caching for CUDA 11.8 and 12.1
101107
# method: ${{ (matrix.cuda-version == '11.8.0' || matrix.cuda-version == '12.1.0') && 'network' || 'local' }}
102108
method: 'network'
103-
# We need the cuda libraries (e.g. cuSparse, cuSolver) for compiling PyTorch extensions,
104-
# not just nvcc
105-
# sub-packages: '["nvcc"]'
109+
sub-packages: '["nvcc"]'
106110

107111
- name: Install PyTorch ${{ matrix.torch-version }}+cu${{ matrix.cuda-version }}
108112
run: |
109113
pip install --upgrade pip
110-
# If we don't install before installing Pytorch, we get error for torch 2.0.1
111-
# ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
112-
pip install lit
113114
# For some reason torch 2.2.0 on python 3.12 errors saying no setuptools
114-
pip install setuptools
115+
pip install setuptools==68.0.0
116+
# With python 3.13 and torch 2.5.1, unless we update typing-extensions, we get error
117+
# AttributeError: attribute '__default__' of 'typing.ParamSpec' objects is not writable
118+
pip install typing-extensions==4.12.2
115119
# We want to figure out the CUDA version to download pytorch
116120
# e.g. we can have system CUDA version being 11.7 but if torch==1.12 then we need to download the wheel from cu116
117121
# This code is ugly, maybe there's a better way to do this.
118122
export TORCH_CUDA_VERSION=$(python -c "from os import environ as env; \
119-
minv = {'2.0': 117, '2.1': 118, '2.2': 118, '2.3': 118, '2.4': 118}[env['MATRIX_TORCH_VERSION']]; \
120-
maxv = {'2.0': 118, '2.1': 121, '2.2': 121, '2.3': 121, '2.4': 124}[env['MATRIX_TORCH_VERSION']]; \
121-
print(max(min(int(env['MATRIX_CUDA_VERSION']), maxv), minv))" \
123+
minv = {'2.1': 118, '2.2': 118, '2.3': 118, '2.4': 118, '2.5': 118, '2.6': 118}[env['MATRIX_TORCH_VERSION']]; \
124+
maxv = {'2.1': 121, '2.2': 121, '2.3': 121, '2.4': 124, '2.5': 124, '2.6': 124}[env['MATRIX_TORCH_VERSION']]; \
125+
print(minv if int(env['MATRIX_CUDA_VERSION']) < 120 else maxv)" \
122126
)
123127
if [[ ${{ matrix.torch-version }} == *"dev"* ]]; then
124128
pip install --no-cache-dir --pre torch==${{ matrix.torch-version }} --index-url https://download.pytorch.org/whl/nightly/cu${TORCH_CUDA_VERSION}
@@ -144,7 +148,7 @@ jobs:
144148
export LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
145149
# Limit MAX_JOBS otherwise the github runner goes OOM
146150
MAX_JOBS=2 MAMBA_FORCE_BUILD="TRUE" MAMBA_FORCE_CXX11_ABI=${{ matrix.cxx11_abi}} python setup.py bdist_wheel --dist-dir=dist
147-
tmpname=cu${MATRIX_CUDA_VERSION}torch${MATRIX_TORCH_VERSION}cxx11abi${{ matrix.cxx11_abi }}
151+
tmpname=cu${WHEEL_CUDA_VERSION}torch${MATRIX_TORCH_VERSION}cxx11abi${{ matrix.cxx11_abi }}
148152
wheel_name=$(ls dist/*whl | xargs -n 1 basename | sed "s/-/+$tmpname-/2")
149153
ls dist/*whl |xargs -I {} mv {} dist/${wheel_name}
150154
echo "wheel_name=${wheel_name}" >> $GITHUB_ENV
@@ -183,9 +187,9 @@ jobs:
183187
runs-on: ubuntu-latest
184188

185189
steps:
186-
- uses: actions/checkout@v3
190+
- uses: actions/checkout@v4
187191

188-
- uses: actions/setup-python@v4
192+
- uses: actions/setup-python@v5
189193
with:
190194
python-version: '3.10'
191195

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ def get_wheel_url():
277277
# We're using the CUDA version used to build torch, not the one currently installed
278278
# _, cuda_version_raw = get_cuda_bare_metal_version(CUDA_HOME)
279279
torch_cuda_version = parse(torch.version.cuda)
280-
# For CUDA 11, we only compile for CUDA 11.8, and for CUDA 12 we only compile for CUDA 12.2
280+
# For CUDA 11, we only compile for CUDA 11.8, and for CUDA 12 we only compile for CUDA 12.3
281281
# to save CI time. Minor versions should be compatible.
282-
torch_cuda_version = parse("11.8") if torch_cuda_version.major == 11 else parse("12.2")
283-
cuda_version = f"{torch_cuda_version.major}{torch_cuda_version.minor}"
282+
torch_cuda_version = parse("11.8") if torch_cuda_version.major == 11 else parse("12.3")
283+
cuda_version = f"{torch_cuda_version.major}"
284284

285285
gpu_compute_version = hip_ver if HIP_BUILD else cuda_version
286286
cuda_or_hip = "hip" if HIP_BUILD else "cu"

0 commit comments

Comments
 (0)