Skip to content

Commit cc9f1d6

Browse files
authored
chore: support torch2.8 wheels (#590)
1 parent be8a7ba commit cc9f1d6

5 files changed

Lines changed: 24 additions & 17 deletions

File tree

.github/workflows/nightly-build.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
strategy:
7878
matrix:
7979
python: ["3.10", "3.11", "3.12"]
80-
torch: ["2.5", "2.6", "2.7", "2.8"]
80+
torch: ["2.5", "2.6", "2.7", "2.8", "2.9"]
8181
steps:
8282
- name: Checkout to the tag
8383
uses: actions/checkout@v4
@@ -89,13 +89,13 @@ jobs:
8989
run: git log -1 --oneline
9090
- name: Build wheels
9191
run: |
92-
if [[ "${{ matrix.torch }}" == "2.7" ]]; then
92+
if [[ "${{ matrix.torch }}" == "2.7" || "${{ matrix.torch }}" == "2.8" ]]; then
9393
cuda_version="12.8"
9494
else
9595
cuda_version="12.4"
9696
fi
97-
if [[ "${{ matrix.torch }}" == "2.8" ]]; then
98-
bash scripts/build_linux_wheel_torch2.8.sh ${{ matrix.python }} ${{ matrix.torch }} 12.8
97+
if [[ "${{ matrix.torch }}" == "2.9" ]]; then
98+
bash scripts/build_linux_wheel_torch_nightly.sh ${{ matrix.python }} ${{ matrix.torch }} 12.8
9999
else
100100
bash scripts/build_linux_wheel.sh ${{ matrix.python }} ${{ matrix.torch }} $cuda_version
101101
fi
@@ -119,7 +119,7 @@ jobs:
119119
strategy:
120120
matrix:
121121
python: ["3.10", "3.11", "3.12"]
122-
torch: ["2.5", "2.6", "2.7", "2.8"]
122+
torch: ["2.5", "2.6", "2.7", "2.8", "2.9"]
123123
steps:
124124
- name: Checkout to the tag
125125
uses: actions/checkout@v4
@@ -134,14 +134,14 @@ jobs:
134134
run: |
135135
SET TORCH_VERSION=${{ matrix.torch }}
136136
SET PYTHON_VERSION=${{ matrix.python }}
137-
IF "%TORCH_VERSION%"=="2.7" (
137+
IF "%TORCH_VERSION%"=="2.7" OR "%TORCH_VERSION%"=="2.8" (
138138
SET CUDA_VERSION=12.8
139139
) ELSE (
140140
SET CUDA_VERSION=12.4
141141
)
142142
call C:\Users\muyangl\miniconda3\condabin\activate.bat activate
143-
IF "%TORCH_VERSION%"=="2.8" (
144-
call scripts\build_windows_wheel_torch2.8.cmd %PYTHON_VERSION% %TORCH_VERSION% %CUDA_VERSION%
143+
IF "%TORCH_VERSION%"=="2.9" (
144+
call scripts\build_windows_wheel_torch_nightly.cmd %PYTHON_VERSION% %TORCH_VERSION% %CUDA_VERSION%
145145
) ELSE (
146146
call scripts\build_windows_wheel.cmd %PYTHON_VERSION% %TORCH_VERSION% %CUDA_VERSION%
147147
)

scripts/build_linux_wheel.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ elif [ "$TORCH_VERSION" == "2.7" ]; then
2020
TORCHVISION_VERSION="0.22"
2121
TORCHAUDIO_VERSION="2.7"
2222
echo "TORCH_VERSION is 2.7, setting TORCHVISION_VERSION to $TORCHVISION_VERSION and TORCHAUDIO_VERSION to $TORCHAUDIO_VERSION"
23+
elif [ "$TORCH_VERSION" == "2.8" ]; then
24+
TORCHVISION_VERSION="0.23"
25+
TORCHAUDIO_VERSION="2.8"
26+
echo "TORCH_VERSION is 2.8, setting TORCHVISION_VERSION to $TORCHVISION_VERSION and TORCHAUDIO_VERSION to $TORCHAUDIO_VERSION"
2327
else
24-
echo "TORCH_VERSION is not 2.5, 2.6 or 2.7, no changes to versions."
28+
echo "TORCH_VERSION is not 2.5, 2.6, 2.7 or 2.8, no changes to versions."
2529
fi
2630

2731
docker run --rm \

scripts/build_linux_wheel_torch2.8.sh renamed to scripts/build_linux_wheel_torch_nightly.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ CUDA_VERSION=$3
77
MAX_JOBS=${4:-} # optional
88
PYTHON_ROOT_PATH=/opt/python/cp${PYTHON_VERSION//.}-cp${PYTHON_VERSION//.}
99

10-
if [ "$TORCH_VERSION" == "2.8" ]; then
11-
TORCHVISION_VERSION="0.23"
12-
TORCHAUDIO_VERSION="2.8"
13-
echo "TORCH_VERSION is 2.8, setting TORCHVISION_VERSION to $TORCHVISION_VERSION and TORCHAUDIO_VERSION to $TORCHAUDIO_VERSION"
14-
else
15-
echo "TORCH_VERSION is not 2.8, no changes to versions."
16-
fi
10+
# if [ "$TORCH_VERSION" == "2.9" ]; then
11+
# TORCHVISION_VERSION="0.24"
12+
# TORCHAUDIO_VERSION="2.9"
13+
# echo "TORCH_VERSION is 2.8, setting TORCHVISION_VERSION to $TORCHVISION_VERSION and TORCHAUDIO_VERSION to $TORCHAUDIO_VERSION"
14+
# else
15+
# echo "TORCH_VERSION is not 2.8, no changes to versions."
16+
# fi
1717

1818
docker run --rm \
1919
-v "$(pwd)":/nunchaku \

scripts/build_windows_wheel.cmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ if "%TORCH_VERSION%"=="2.5" (
1919
) else if "%TORCH_VERSION%"=="2.7" (
2020
set TORCHVISION_VERSION=0.22
2121
set TORCHAUDIO_VERSION=2.7
22+
) else if "%TORCH_VERSION%"=="2.8" (
23+
set TORCHVISION_VERSION=0.23
24+
set TORCHAUDIO_VERSION=2.8
2225
) else (
23-
echo TORCH_VERSION is not 2.5, 2.6 or 2.7, no changes to versions.
26+
echo TORCH_VERSION is not 2.5, 2.6, 2.7 or 2.8, no changes to versions.
2427
)
2528
echo setting TORCHVISION_VERSION to %TORCHVISION_VERSION% and TORCHAUDIO_VERSION to %TORCHAUDIO_VERSION%
2629

File renamed without changes.

0 commit comments

Comments
 (0)