From 7204b0df29f91a8c85041d3bbac0f72b5c8d064a Mon Sep 17 00:00:00 2001 From: Muyang Li Date: Sat, 25 Oct 2025 00:50:42 -0400 Subject: [PATCH] support torch2.9, bump the version to 1.0.2 --- .github/workflows/nightly-build.yaml | 18 +++++++----------- .github/workflows/release-build.yaml | 18 +++++++----------- nunchaku/__version__.py | 2 +- pyproject.toml | 2 +- scripts/build_linux_wheel.sh | 6 +++++- scripts/build_windows_wheel.cmd | 5 ++++- 6 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/nightly-build.yaml b/.github/workflows/nightly-build.yaml index 765fd625..92345e06 100644 --- a/.github/workflows/nightly-build.yaml +++ b/.github/workflows/nightly-build.yaml @@ -77,10 +77,7 @@ jobs: strategy: matrix: python: ["3.10", "3.11", "3.12", "3.13"] - torch: ["2.5", "2.6", "2.7", "2.8", "2.9"] - exclude: - - python: "3.13" - torch: "2.5" + torch: ["2.7", "2.8", "2.9", "pre"] steps: - name: Checkout to the tag uses: actions/checkout@v4 @@ -92,12 +89,12 @@ jobs: run: git log -1 --oneline - name: Build wheels run: | - if [[ "${{ matrix.torch }}" == "2.7" || "${{ matrix.torch }}" == "2.8" ]]; then + if [[ "${{ matrix.torch }}" == "2.7" || "${{ matrix.torch }}" == "2.8" || "${{ matrix.torch }}" == "2.9" ]]; then cuda_version="12.8" else cuda_version="12.4" fi - if [[ "${{ matrix.torch }}" == "2.9" ]]; then + if [[ "${{ matrix.torch }}" == "pre" ]]; then bash scripts/build_linux_wheel_torch_nightly.sh ${{ matrix.python }} ${{ matrix.torch }} 12.8 else bash scripts/build_linux_wheel.sh ${{ matrix.python }} ${{ matrix.torch }} $cuda_version @@ -122,10 +119,7 @@ jobs: strategy: matrix: python: ["3.10", "3.11", "3.12", "3.13"] - torch: ["2.5", "2.6", "2.7", "2.8", "2.9"] - exclude: - - python: "3.13" - torch: "2.5" + torch: ["2.7", "2.8", "2.9", "pre"] steps: - name: Checkout to the tag uses: actions/checkout@v4 @@ -144,11 +138,13 @@ jobs: SET CUDA_VERSION=12.8 ) ELSE IF "%TORCH_VERSION%"=="2.8" ( SET CUDA_VERSION=12.8 + ) ELSE IF "%TORCH_VERSION%"=="2.9" ( + SET CUDA_VERSION=12.8 ) ELSE ( SET CUDA_VERSION=12.4 ) call C:\Users\muyangl\miniconda3\condabin\activate.bat activate - IF "%TORCH_VERSION%"=="2.9" ( + IF "%TORCH_VERSION%"=="pre" ( call scripts\build_windows_wheel_torch_nightly.cmd %PYTHON_VERSION% %TORCH_VERSION% %CUDA_VERSION% ) ELSE ( call scripts\build_windows_wheel.cmd %PYTHON_VERSION% %TORCH_VERSION% %CUDA_VERSION% diff --git a/.github/workflows/release-build.yaml b/.github/workflows/release-build.yaml index 5e04f55b..e3c10b32 100644 --- a/.github/workflows/release-build.yaml +++ b/.github/workflows/release-build.yaml @@ -51,10 +51,7 @@ jobs: strategy: matrix: python: ["3.10", "3.11", "3.12", "3.13"] - torch: ["2.5", "2.6", "2.7", "2.8", "2.9"] - exclude: - - python: "3.13" - torch: "2.5" + torch: ["2.7", "2.8", "2.9", "pre"] steps: - name: Checkout to the tag uses: actions/checkout@v4 @@ -66,12 +63,12 @@ jobs: run: git log -1 --oneline - name: Build wheels run: | - if [[ "${{ matrix.torch }}" == "2.7" || "${{ matrix.torch }}" == "2.8" ]]; then + if [[ "${{ matrix.torch }}" == "2.7" || "${{ matrix.torch }}" == "2.8" || "${{ matrix.torch }}" == "2.9" ]]; then cuda_version="12.8" else cuda_version="12.4" fi - if [[ "${{ matrix.torch }}" == "2.9" ]]; then + if [[ "${{ matrix.torch }}" == "pre" ]]; then bash scripts/build_linux_wheel_torch_nightly.sh ${{ matrix.python }} ${{ matrix.torch }} 12.8 else bash scripts/build_linux_wheel.sh ${{ matrix.python }} ${{ matrix.torch }} $cuda_version @@ -107,10 +104,7 @@ jobs: strategy: matrix: python: ["3.10", "3.11", "3.12", "3.13"] - torch: ["2.5", "2.6", "2.7", "2.8", "2.9"] - exclude: - - python: "3.13" - torch: "2.5" + torch: ["2.7", "2.8", "2.9", "pre"] steps: - name: Checkout to the tag uses: actions/checkout@v4 @@ -129,11 +123,13 @@ jobs: SET CUDA_VERSION=12.8 ) ELSE IF "%TORCH_VERSION%"=="2.8" ( SET CUDA_VERSION=12.8 + ) ELSE IF "%TORCH_VERSION%"=="2.9" ( + SET CUDA_VERSION=12.8 ) ELSE ( SET CUDA_VERSION=12.4 ) call C:\Users\muyangl\miniconda3\condabin\activate.bat activate - IF "%TORCH_VERSION%"=="2.9" ( + IF "%TORCH_VERSION%"=="pre" ( call scripts\build_windows_wheel_torch_nightly.cmd %PYTHON_VERSION% %TORCH_VERSION% %CUDA_VERSION% ) ELSE ( call scripts\build_windows_wheel.cmd %PYTHON_VERSION% %TORCH_VERSION% %CUDA_VERSION% diff --git a/nunchaku/__version__.py b/nunchaku/__version__.py index 5c4105cd..7863915f 100644 --- a/nunchaku/__version__.py +++ b/nunchaku/__version__.py @@ -1 +1 @@ -__version__ = "1.0.1" +__version__ = "1.0.2" diff --git a/pyproject.toml b/pyproject.toml index f5935360..a3fff878 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" requires = [ "ninja", "setuptools", - "torch>=2.5", + "torch>=2.7", "wheel", ] diff --git a/scripts/build_linux_wheel.sh b/scripts/build_linux_wheel.sh index a6cde648..2ec09729 100644 --- a/scripts/build_linux_wheel.sh +++ b/scripts/build_linux_wheel.sh @@ -24,8 +24,12 @@ elif [ "$TORCH_VERSION" == "2.8" ]; then TORCHVISION_VERSION="0.23" TORCHAUDIO_VERSION="2.8" echo "TORCH_VERSION is 2.8, setting TORCHVISION_VERSION to $TORCHVISION_VERSION and TORCHAUDIO_VERSION to $TORCHAUDIO_VERSION" +elif [ "$TORCH_VERSION" == "2.9" ]; then + TORCHVISION_VERSION="0.24" + TORCHAUDIO_VERSION="2.9" + echo "TORCH_VERSION is 2.9, setting TORCHVISION_VERSION to $TORCHVISION_VERSION and TORCHAUDIO_VERSION to $TORCHAUDIO_VERSION" else - echo "TORCH_VERSION is not 2.5, 2.6, 2.7 or 2.8, no changes to versions." + echo "TORCH_VERSION is not 2.5, 2.6, 2.7, 2.8 or 2.9, no changes to versions." fi docker run --rm \ diff --git a/scripts/build_windows_wheel.cmd b/scripts/build_windows_wheel.cmd index eb77955b..2d931532 100644 --- a/scripts/build_windows_wheel.cmd +++ b/scripts/build_windows_wheel.cmd @@ -22,8 +22,11 @@ if "%TORCH_VERSION%"=="2.5" ( ) else if "%TORCH_VERSION%"=="2.8" ( set TORCHVISION_VERSION=0.23 set TORCHAUDIO_VERSION=2.8 +) else if "%TORCH_VERSION%"=="2.9" ( + set TORCHVISION_VERSION=0.24 + set TORCHAUDIO_VERSION=2.9 ) else ( - echo TORCH_VERSION is not 2.5, 2.6, 2.7 or 2.8, no changes to versions. + echo TORCH_VERSION is not 2.5, 2.6, 2.7, 2.8 or 2.9, no changes to versions. ) echo setting TORCHVISION_VERSION to %TORCHVISION_VERSION% and TORCHAUDIO_VERSION to %TORCHAUDIO_VERSION%