Skip to content

Commit 5735fa7

Browse files
authored
Publish pre-built wheels for torch 2.4.0 (#1298)
1 parent 9897a3a commit 5735fa7

9 files changed

+51
-16
lines changed

.github/workflows/run-tests-cpu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
fail-fast: false
5353
matrix:
5454
os: [ubuntu-latest, macos-latest]
55-
torch: ["2.2.1"]
55+
torch: ["2.4.0"]
5656
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
5757
build_type: ["Release", "Debug"]
5858

.github/workflows/run-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ jobs:
5151
fail-fast: false
5252
matrix:
5353
os: [ubuntu-latest]
54-
cuda: ["12.1"]
55-
torch: ["2.2.1"]
54+
cuda: ["12.4"]
55+
torch: ["2.4.0"]
5656
python-version: ["3.12"]
5757

5858
steps:
@@ -71,7 +71,7 @@ jobs:
7171
- name: Run the build process with Docker
7272
uses: addnab/docker-run-action@v3
7373
with:
74-
image: "pytorch/manylinux-builder:cuda12.1"
74+
image: "pytorch/manylinux-builder:cuda12.4"
7575
options: -v ${{ github.workspace }}:/var/www -e PYTHON_VERSION=${{ matrix.python-version }} -e TORCH_VERSION=${{ matrix.torch }} -e CUDA_VERSION=${{ matrix.cuda }}
7676
run: |
7777
echo "pwd: $PWD"

.github/workflows/windows-x64-cpu-wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Build wheels
5252
uses: pypa/cibuildwheel@v2.16.5
5353
env:
54-
CIBW_BEFORE_BUILD: pip install torch==${{ matrix.torch}}+cpu cmake numpy -f https://download.pytorch.org/whl/torch_stable.html
54+
CIBW_BEFORE_BUILD: pip install torch==${{ matrix.torch}}+cpu cmake numpy -f https://download.pytorch.org/whl/torch_stable.html || pip install torch==${{ matrix.torch}}+cpu cmake numpy -f https://download.pytorch.org/whl/torch/
5555
CIBW_BUILD: ${{ matrix.python-version }}-win_amd64
5656
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
5757
CIBW_BUILD_VERBOSITY: 3

docs/source/installation/from_wheels.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ we can use one of the following methods:
3737
.. code-block:: bash
3838
3939
# method 1
40-
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
40+
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch/
4141
pip install k2==1.24.3.dev20230719+cpu.torch2.0.1 -f https://k2-fsa.github.io/k2/cpu.html
4242
4343
# method 2
44-
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
44+
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch/
4545
4646
wget https://huggingface.co/csukuangfj/k2/resolve/main/cpu/k2-1.24.3.dev20230719+cpu.torch2.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
4747
@@ -105,11 +105,11 @@ we can use the one of the following methods:
105105
.. code-block:: bash
106106
107107
# method 1
108-
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
108+
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch/
109109
pip install k2==1.24.3.dev20230726+cpu.torch2.0.1 -f https://k2-fsa.github.io/k2/cpu.html
110110
111111
# method 2
112-
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
112+
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch/
113113
wget https://huggingface.co/csukuangfj/k2/resolve/main/windows-cpu/k2-1.24.3.dev20230726+cpu.torch2.0.1-cp38-cp38-win_amd64.whl
114114
115115
# For users from China
@@ -143,11 +143,11 @@ we can use the following methods:
143143
.. code-block:: bash
144144
145145
# method 1
146-
pip install torch==2.0.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html
146+
pip install torch==2.0.1+cu117 -f https://download.pytorch.org/whl/torch/
147147
pip install k2==1.24.3.dev20230718+cuda11.7.torch2.0.1 -f https://k2-fsa.github.io/k2/cuda.html
148148
149149
# method 2
150-
pip install torch==2.0.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html
150+
pip install torch==2.0.1+cu117 -f https://download.pytorch.org/whl/torch/
151151
152152
wget https://huggingface.co/csukuangfj/k2/resolve/main/cuda/k2-1.24.3.dev20230718+cuda11.7.torch2.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
153153

scripts/github_actions/build-ubuntu-cpu.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ python3 -m pip install wheel twine typing_extensions
8282
python3 -m pip install bs4 requests tqdm auditwheel
8383

8484
echo "Installing torch $TORCH_VERSION"
85-
python3 -m pip install -qq torch==$TORCH_VERSION+cpu -f https://download.pytorch.org/whl/torch_stable.html
85+
python3 -m pip install -qq torch==$TORCH_VERSION+cpu -f https://download.pytorch.org/whl/torch_stable.html || \
86+
python3 -m pip install -qq torch==$TORCH_VERSION+cpu -f https://download.pytorch.org/whl/torch/
8687

8788
rm -rf ~/.cache/pip
8889
yum clean all

scripts/github_actions/generate_build_matrix.py

+15-4
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,16 @@ def generate_build_matrix(
220220
if not for_windows
221221
else ["11.8.0", "12.1.0"],
222222
},
223+
"2.4.0": {
224+
"python-version": ["3.8", "3.9", "3.10", "3.11", "3.12"],
225+
"cuda": ["11.8", "12.1", "12.4"] # default 12.1
226+
if not for_windows
227+
else ["11.8.0", "12.1.0", "12.4.0"],
228+
},
223229
# https://github.com/Jimver/cuda-toolkit/blob/master/src/links/windows-links.ts
224230
}
225231
if test_only_latest_torch:
226-
latest = "2.3.1"
232+
latest = "2.4.0"
227233
matrix = {latest: matrix[latest]}
228234

229235
if for_windows or for_macos:
@@ -283,15 +289,20 @@ def generate_build_matrix(
283289
for p in python_versions:
284290
if p in excluded_python_versions:
285291
continue
286-
if for_macos and p in ["3.8", "3.9"]:
287-
# macOS arm64 in github actions does not support python 3.8 or 3.9
288-
continue
289292

290293
if for_windows:
291294
p = "cp" + "".join(p.split("."))
292295
ans.append({"torch": torch, "python-version": p})
293296
elif for_macos or for_macos_m1:
294297
ans.append({"torch": torch, "python-version": p})
298+
elif version_ge(torch, "2.4.0"):
299+
ans.append(
300+
{
301+
"torch": torch,
302+
"python-version": p,
303+
"image": "pytorch/manylinux-builder:cpu-2.4",
304+
}
305+
)
295306
elif version_ge(torch, "2.2.0"):
296307
ans.append(
297308
{

scripts/github_actions/install_cuda.sh

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ case "$cuda" in
5555
12.1)
5656
url=https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run
5757
;;
58+
12.4)
59+
url=https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run
60+
;;
5861
*)
5962
echo "Unknown cuda version: $cuda"
6063
exit 1

scripts/github_actions/install_cudnn.sh

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ case $cuda in
4848
12.1)
4949
filename=cudnn-linux-x86_64-8.9.5.29_cuda12-archive.tar.xz
5050
;;
51+
12.4)
52+
filename=cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz
53+
;;
5154
*)
5255
echo "Unsupported cuda version: $cuda"
5356
exit 1

scripts/github_actions/install_torch.sh

+17
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,23 @@ case ${torch} in
213213
;;
214214
esac
215215
;;
216+
2.4.*)
217+
case ${cuda} in
218+
11.8)
219+
package="torch==${torch}+cu118"
220+
# https://download.pytorch.org/whl/nightly/torch/
221+
url=https://download.pytorch.org/whl/torch/
222+
;;
223+
12.1)
224+
package="torch==${torch}+cu121"
225+
url=https://download.pytorch.org/whl/torch/
226+
;;
227+
12.4)
228+
package="torch==${torch}+cu124"
229+
url=https://download.pytorch.org/whl/torch/
230+
;;
231+
esac
232+
;;
216233
*)
217234
echo "Unsupported PyTorch version: ${torch}"
218235
exit 1

0 commit comments

Comments
 (0)