From 30e9e92173990c7dc58322170a0bd5fd5c048a1f Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:22:21 +0000 Subject: [PATCH 01/18] fix: CI build - ubuntu-22.04, MSVC setup for Windows, update action versions --- .github/workflows/mannu_build.yml | 2 +- .github/workflows/python-package.yml | 2 +- .github/workflows/release.yml | 15 ++++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/mannu_build.yml b/.github/workflows/mannu_build.yml index 9400fed..6be3fcc 100644 --- a/.github/workflows/mannu_build.yml +++ b/.github/workflows/mannu_build.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: - os: [ubuntu-20.04, windows-latest] + os: [ubuntu-22.04, windows-latest] pyver: ["3.10"] cuda: ["12.6.0"] defaults: diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 84d0ae6..492f125 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -43,7 +43,7 @@ jobs: - name: Install CUDA ${{ matrix.cuda-version }} if: github.event.pull_request.merged == true run: | - bash -x .github/workflows/scripts/cuda-install.sh ${{ matrix.cuda-version }} ubuntu-20.04 + bash -x .github/workflows/scripts/cuda-install.sh ${{ matrix.cuda-version }} ubuntu-22.04 - name: Install PyTorch 2.2.2 with CUDA ${{ matrix.cuda-version }} if: github.event.pull_request.merged == true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 494d004..563ff6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,9 @@ jobs: # needs: release strategy: + fail-fast: false matrix: - os: [ubuntu-20.04, windows-latest] + os: [ubuntu-22.04, windows-latest] pyver: ["3.10", "3.11", "3.12"] cuda: ["12.4.1"] defaults: @@ -36,14 +37,18 @@ jobs: docker-images: true swap-storage: false - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.pyver }} + - name: Setup MSVC + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup Mamba - uses: conda-incubator/setup-miniconda@v2.2.0 + uses: conda-incubator/setup-miniconda@v3 with: activate-environment: "build" python-version: ${{ matrix.pyver }} @@ -106,7 +111,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Extract branch info shell: bash From 3c783c3f55a6345d1583724253c16b6c98827c34 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:24:39 +0000 Subject: [PATCH 02/18] ci: add workflow_dispatch for manual testing --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 563ff6e..53361db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,9 @@ on: push: tags: - "v*" + branches: + - "fix/ci-build" + workflow_dispatch: jobs: build_wheels: @@ -107,6 +110,7 @@ jobs: name: Create Release runs-on: ubuntu-latest needs: build_wheels + if: startsWith(github.ref, 'refs/tags/') outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: From 958cec97043c53680ec48d43b1b2a363e770a4db Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:27:53 +0000 Subject: [PATCH 03/18] ci: sync MSVC fix to mannu_build.yml --- .github/workflows/mannu_build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mannu_build.yml b/.github/workflows/mannu_build.yml index 6be3fcc..3e7a357 100644 --- a/.github/workflows/mannu_build.yml +++ b/.github/workflows/mannu_build.yml @@ -44,14 +44,18 @@ jobs: docker-images: true swap-storage: false - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.pyver }} + - name: Setup MSVC + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + - name: Setup Mamba - uses: conda-incubator/setup-miniconda@v2.2.0 + uses: conda-incubator/setup-miniconda@v3 with: activate-environment: "build" python-version: ${{ matrix.pyver }} From ff276d2a84fe5cb9f1b34b82e3a6ca7b14fb89a1 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:29:33 +0000 Subject: [PATCH 04/18] Revert "ci: sync MSVC fix to mannu_build.yml" This reverts commit 958cec97043c53680ec48d43b1b2a363e770a4db. --- .github/workflows/mannu_build.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/mannu_build.yml b/.github/workflows/mannu_build.yml index 3e7a357..6be3fcc 100644 --- a/.github/workflows/mannu_build.yml +++ b/.github/workflows/mannu_build.yml @@ -44,18 +44,14 @@ jobs: docker-images: true swap-storage: false - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v3 with: python-version: ${{ matrix.pyver }} - - name: Setup MSVC - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 - - name: Setup Mamba - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@v2.2.0 with: activate-environment: "build" python-version: ${{ matrix.pyver }} From bb8a0fa2bd599031bc8b56041b5e7433083de76a Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:32:37 +0000 Subject: [PATCH 05/18] ci: upgrade CUDA to 12.9.0, PyTorch 2.7.0 --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53361db..bb5dd3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: matrix: os: [ubuntu-22.04, windows-latest] pyver: ["3.10", "3.11", "3.12"] - cuda: ["12.4.1"] + cuda: ["12.9.0"] defaults: run: shell: pwsh @@ -72,7 +72,7 @@ jobs: # Install torch $cudaVersion = $env:CUDA_VERSION.Replace('.', '') $cudaVersionPytorch = $cudaVersion.Substring(0, $cudaVersion.Length - 1) - if ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} + if ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} echo "pytorchVersion=$pytorchVersion" echo "cudaVersion=<$cudaVersion>" echo "cudaVersionPytorch=$cudaVersionPytorch" From f55825ef36c384919a49c6942bb4b0cfed4662a8 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:35:35 +0000 Subject: [PATCH 06/18] ci: pin mamba cuda version to prevent mismatch --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb5dd3c..efb308e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: - name: Install Dependencies run: | # Install CUDA toolkit - mamba install -y 'cuda' -c "nvidia/label/cuda-${env:CUDA_VERSION}" + mamba install -y "cuda=${env:CUDA_VERSION}" -c "nvidia/label/cuda-${env:CUDA_VERSION}" # Env variables $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX From a915d5604eb3875a24bc13fbdf8ea4095483d6eb Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:37:46 +0000 Subject: [PATCH 07/18] ci: CUDA 13.0.0 + PyTorch 2.9.0 --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efb308e..d4dc1a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: matrix: os: [ubuntu-22.04, windows-latest] pyver: ["3.10", "3.11", "3.12"] - cuda: ["12.9.0"] + cuda: ["13.0.0"] defaults: run: shell: pwsh @@ -72,7 +72,7 @@ jobs: # Install torch $cudaVersion = $env:CUDA_VERSION.Replace('.', '') $cudaVersionPytorch = $cudaVersion.Substring(0, $cudaVersion.Length - 1) - if ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} + if ([int]$cudaVersionPytorch -gt 129) { $pytorchVersion = "torch==2.9.0" } elseif ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} echo "pytorchVersion=$pytorchVersion" echo "cudaVersion=<$cudaVersion>" echo "cudaVersionPytorch=$cudaVersionPytorch" From 2572422ef23e7acb0d38146467a2b35803059905 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:47:04 +0000 Subject: [PATCH 08/18] ci: fix cuda headers (cuda-cudart-dev) and Windows DISTUTILS_USE_SDK --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4dc1a9..a5ebf15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: - name: Install Dependencies run: | # Install CUDA toolkit - mamba install -y "cuda=${env:CUDA_VERSION}" -c "nvidia/label/cuda-${env:CUDA_VERSION}" + mamba install -y "cuda=${env:CUDA_VERSION}" "cuda-cudart-dev" "cuda-nvcc" -c "nvidia/label/cuda-${env:CUDA_VERSION}" # Env variables $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX @@ -94,6 +94,7 @@ jobs: } # echo "{CUDA_VERSION}=$env:CUDA_VERSION" >> $GITHUB_ENV $env:GENERAL_TORCH = 1 # OptionalCUDAGuard + $env:DISTUTILS_USE_SDK = 1 python setup.py sdist bdist_wheel -k $env:PLAT_ARG.split() ls dist/*.whl env: From 919a29049ed897bcef0011795620ee555fa11b99 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 02:54:28 +0000 Subject: [PATCH 09/18] ci: debug and fix CUDA paths for conda CUDA 13.0 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5ebf15..bad1a77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,6 +88,34 @@ jobs: run: | $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX + # Debug: find cuda_runtime_api.h and nvcc + echo "CONDA_PREFIX=$env:CONDA_PREFIX" + if ($IsLinux) { + bash -c "find $env:CONDA_PREFIX -name 'cuda_runtime_api.h' 2>/dev/null" + bash -c "find $env:CONDA_PREFIX -name 'nvcc' -type f 2>/dev/null" + bash -c "ls -la $env:CONDA_PREFIX/include/cuda_runtime_api.h 2>/dev/null || echo 'not in include/'" + bash -c "ls -la $env:CONDA_PREFIX/targets/x86_64-linux/include/cuda_runtime_api.h 2>/dev/null || echo 'not in targets/'" + } else { + Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "cuda_runtime_api.h" -ErrorAction SilentlyContinue | Select-Object FullName + Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "nvcc.exe" -ErrorAction SilentlyContinue | Select-Object FullName + } + # Set include path for Linux if needed + if ($IsLinux -and (Test-Path "$env:CONDA_PREFIX/targets/x86_64-linux/include/cuda_runtime_api.h")) { + $env:CPLUS_INCLUDE_PATH = "$env:CONDA_PREFIX/targets/x86_64-linux/include" + $env:C_INCLUDE_PATH = "$env:CONDA_PREFIX/targets/x86_64-linux/include" + $env:CUDA_HOME = "$env:CONDA_PREFIX/targets/x86_64-linux" + $env:CUDA_PATH = "$env:CONDA_PREFIX/targets/x86_64-linux" + } + # Set nvcc path for Windows if needed + if (!$IsLinux) { + $nvcc = Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "nvcc.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($nvcc) { + $cudaDir = Split-Path (Split-Path $nvcc.FullName) + echo "Setting CUDA_HOME to $cudaDir" + $env:CUDA_HOME = $cudaDir + $env:CUDA_PATH = $cudaDir + } + } # Only add +cu118 to wheel if not releasing on PyPi if ( $env:CUDA_VERSION -eq $env:PYPI_CUDA_VERSION ){ $env:PYPI_BUILD = 1 From d78842d061d3ea7967ad1ed32a9873fb35f0999e Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 03:05:47 +0000 Subject: [PATCH 10/18] ci: add cuda-cccl for thrust/cub headers (CUDA 13) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bad1a77..8d6192e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: - name: Install Dependencies run: | # Install CUDA toolkit - mamba install -y "cuda=${env:CUDA_VERSION}" "cuda-cudart-dev" "cuda-nvcc" -c "nvidia/label/cuda-${env:CUDA_VERSION}" + mamba install -y "cuda=${env:CUDA_VERSION}" "cuda-cudart-dev" "cuda-nvcc" "cuda-cccl" -c "nvidia/label/cuda-${env:CUDA_VERSION}" # Env variables $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX From f5a3ec784e9725ba14de6bea8c67c81119c2591a Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 03:26:56 +0000 Subject: [PATCH 11/18] ci: symlink CUDA headers for g++, upgrade to PyTorch 2.10.0 --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d6192e..5fed4d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,7 +72,7 @@ jobs: # Install torch $cudaVersion = $env:CUDA_VERSION.Replace('.', '') $cudaVersionPytorch = $cudaVersion.Substring(0, $cudaVersion.Length - 1) - if ([int]$cudaVersionPytorch -gt 129) { $pytorchVersion = "torch==2.9.0" } elseif ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} + if ([int]$cudaVersionPytorch -gt 129) { $pytorchVersion = "torch==2.10.0" } elseif ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} echo "pytorchVersion=$pytorchVersion" echo "cudaVersion=<$cudaVersion>" echo "cudaVersionPytorch=$cudaVersionPytorch" @@ -101,8 +101,9 @@ jobs: } # Set include path for Linux if needed if ($IsLinux -and (Test-Path "$env:CONDA_PREFIX/targets/x86_64-linux/include/cuda_runtime_api.h")) { - $env:CPLUS_INCLUDE_PATH = "$env:CONDA_PREFIX/targets/x86_64-linux/include" - $env:C_INCLUDE_PATH = "$env:CONDA_PREFIX/targets/x86_64-linux/include" + # Symlink CUDA headers to CONDA_PREFIX/include so g++ can find thrust/cub + bash -c "for d in thrust cub nv cuda; do [ -e $env:CONDA_PREFIX/targets/x86_64-linux/include/\$d ] && ln -sfn $env:CONDA_PREFIX/targets/x86_64-linux/include/\$d $env:CONDA_PREFIX/include/\$d; done" + bash -c "for f in $env:CONDA_PREFIX/targets/x86_64-linux/include/cuda*.h; do [ -f \$f ] && ln -sfn \$f $env:CONDA_PREFIX/include/; done" $env:CUDA_HOME = "$env:CONDA_PREFIX/targets/x86_64-linux" $env:CUDA_PATH = "$env:CONDA_PREFIX/targets/x86_64-linux" } From 903ffc7e2485be91a75e136bbb1d3e2378825f85 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 03:36:06 +0000 Subject: [PATCH 12/18] ci: use CXXFLAGS -I for thrust include path, simplify build step --- .github/workflows/release.yml | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fed4d1..79bd55c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,27 +88,28 @@ jobs: run: | $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX - # Debug: find cuda_runtime_api.h and nvcc echo "CONDA_PREFIX=$env:CONDA_PREFIX" + if ($IsLinux) { - bash -c "find $env:CONDA_PREFIX -name 'cuda_runtime_api.h' 2>/dev/null" - bash -c "find $env:CONDA_PREFIX -name 'nvcc' -type f 2>/dev/null" - bash -c "ls -la $env:CONDA_PREFIX/include/cuda_runtime_api.h 2>/dev/null || echo 'not in include/'" - bash -c "ls -la $env:CONDA_PREFIX/targets/x86_64-linux/include/cuda_runtime_api.h 2>/dev/null || echo 'not in targets/'" + # Find cuda include dir containing thrust/complex.h + $thrustDir = bash -c "dirname `find $env:CONDA_PREFIX -path '*/thrust/complex.h' 2>/dev/null | head -1` 2>/dev/null" + if ($thrustDir -and $thrustDir -ne ".") { + $cudaInclude = Split-Path $thrustDir + echo "Found thrust in: $cudaInclude" + # Set CUDA_HOME to parent of include (for nvcc) + $cudaBase = Split-Path $cudaInclude + if (Test-Path "$cudaBase/bin/nvcc") { + $env:CUDA_HOME = $cudaBase + $env:CUDA_PATH = $cudaBase + echo "CUDA_HOME=$cudaBase" + } + # Add to compiler include paths + $env:CXXFLAGS = "-I$cudaInclude" + $env:CFLAGS = "-I$cudaInclude" + echo "CXXFLAGS=$env:CXXFLAGS" + } } else { - Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "cuda_runtime_api.h" -ErrorAction SilentlyContinue | Select-Object FullName - Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "nvcc.exe" -ErrorAction SilentlyContinue | Select-Object FullName - } - # Set include path for Linux if needed - if ($IsLinux -and (Test-Path "$env:CONDA_PREFIX/targets/x86_64-linux/include/cuda_runtime_api.h")) { - # Symlink CUDA headers to CONDA_PREFIX/include so g++ can find thrust/cub - bash -c "for d in thrust cub nv cuda; do [ -e $env:CONDA_PREFIX/targets/x86_64-linux/include/\$d ] && ln -sfn $env:CONDA_PREFIX/targets/x86_64-linux/include/\$d $env:CONDA_PREFIX/include/\$d; done" - bash -c "for f in $env:CONDA_PREFIX/targets/x86_64-linux/include/cuda*.h; do [ -f \$f ] && ln -sfn \$f $env:CONDA_PREFIX/include/; done" - $env:CUDA_HOME = "$env:CONDA_PREFIX/targets/x86_64-linux" - $env:CUDA_PATH = "$env:CONDA_PREFIX/targets/x86_64-linux" - } - # Set nvcc path for Windows if needed - if (!$IsLinux) { + # Windows: find nvcc.exe and set CUDA_HOME $nvcc = Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "nvcc.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 if ($nvcc) { $cudaDir = Split-Path (Split-Path $nvcc.FullName) @@ -117,11 +118,10 @@ jobs: $env:CUDA_PATH = $cudaDir } } - # Only add +cu118 to wheel if not releasing on PyPi + if ( $env:CUDA_VERSION -eq $env:PYPI_CUDA_VERSION ){ $env:PYPI_BUILD = 1 } - # echo "{CUDA_VERSION}=$env:CUDA_VERSION" >> $GITHUB_ENV $env:GENERAL_TORCH = 1 # OptionalCUDAGuard $env:DISTUTILS_USE_SDK = 1 python setup.py sdist bdist_wheel -k $env:PLAT_ARG.split() From 5e8960c4543fa3fed1d6fafcfcca457616e42595 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 03:45:04 +0000 Subject: [PATCH 13/18] ci: split build into Linux(bash) and Windows(pwsh) to fix shell escaping --- .github/workflows/release.yml | 72 +++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 79bd55c..57d5017 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,50 +84,56 @@ jobs: python -c "import torch; print('CUDA:', torch.version.cuda)" python -c "import os; print('CUDA_HOME:', os.getenv('CUDA_HOME', None))" python -c "from torch.utils import cpp_extension; print (cpp_extension.CUDA_HOME)" - - name: Build Wheel + - name: Build Wheel (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + export CUDA_PATH=$CONDA_PREFIX + export CUDA_HOME=$CONDA_PREFIX + + # Find thrust include dir + THRUST_H=$(find $CONDA_PREFIX -path '*/thrust/complex.h' 2>/dev/null | head -1) + if [ -n "$THRUST_H" ]; then + CUDA_INCLUDE=$(dirname $(dirname "$THRUST_H")) + echo "Found thrust in: $CUDA_INCLUDE" + export CXXFLAGS="-I$CUDA_INCLUDE" + export CFLAGS="-I$CUDA_INCLUDE" + # Check if this dir has bin/nvcc + CUDA_BASE=$(dirname "$CUDA_INCLUDE") + if [ -f "$CUDA_BASE/bin/nvcc" ]; then + export CUDA_HOME=$CUDA_BASE + export CUDA_PATH=$CUDA_BASE + fi + fi + echo "CUDA_HOME=$CUDA_HOME" + echo "CXXFLAGS=$CXXFLAGS" + + export GENERAL_TORCH=1 + python setup.py sdist bdist_wheel -k --plat-name manylinux2014_x86_64 + ls dist/*.whl + + - name: Build Wheel (Windows) + if: runner.os == 'Windows' run: | $env:CUDA_PATH = $env:CONDA_PREFIX $env:CUDA_HOME = $env:CONDA_PREFIX - echo "CONDA_PREFIX=$env:CONDA_PREFIX" - if ($IsLinux) { - # Find cuda include dir containing thrust/complex.h - $thrustDir = bash -c "dirname `find $env:CONDA_PREFIX -path '*/thrust/complex.h' 2>/dev/null | head -1` 2>/dev/null" - if ($thrustDir -and $thrustDir -ne ".") { - $cudaInclude = Split-Path $thrustDir - echo "Found thrust in: $cudaInclude" - # Set CUDA_HOME to parent of include (for nvcc) - $cudaBase = Split-Path $cudaInclude - if (Test-Path "$cudaBase/bin/nvcc") { - $env:CUDA_HOME = $cudaBase - $env:CUDA_PATH = $cudaBase - echo "CUDA_HOME=$cudaBase" - } - # Add to compiler include paths - $env:CXXFLAGS = "-I$cudaInclude" - $env:CFLAGS = "-I$cudaInclude" - echo "CXXFLAGS=$env:CXXFLAGS" - } - } else { - # Windows: find nvcc.exe and set CUDA_HOME - $nvcc = Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "nvcc.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 - if ($nvcc) { - $cudaDir = Split-Path (Split-Path $nvcc.FullName) - echo "Setting CUDA_HOME to $cudaDir" - $env:CUDA_HOME = $cudaDir - $env:CUDA_PATH = $cudaDir - } + # Find nvcc.exe and set CUDA_HOME + $nvcc = Get-ChildItem -Path $env:CONDA_PREFIX -Recurse -Filter "nvcc.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($nvcc) { + $cudaDir = Split-Path (Split-Path $nvcc.FullName) + echo "Setting CUDA_HOME to $cudaDir" + $env:CUDA_HOME = $cudaDir + $env:CUDA_PATH = $cudaDir } if ( $env:CUDA_VERSION -eq $env:PYPI_CUDA_VERSION ){ $env:PYPI_BUILD = 1 } - $env:GENERAL_TORCH = 1 # OptionalCUDAGuard + $env:GENERAL_TORCH = 1 $env:DISTUTILS_USE_SDK = 1 - python setup.py sdist bdist_wheel -k $env:PLAT_ARG.split() + python setup.py sdist bdist_wheel -k --plat-name win_amd64 ls dist/*.whl - env: - PLAT_ARG: ${{ contains(runner.os, 'Linux') && '--plat-name manylinux2014_x86_64' || '--plat-name win_amd64' }} - uses: actions/upload-artifact@v4 with: From c5206ffb0831281e6e7860049faa31d15fceb766 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 06:35:34 +0000 Subject: [PATCH 14/18] ci: fix Linux conda activation (bash -el), Windows use CUDA 12.6 (MSVC compat) --- .github/workflows/release.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57d5017..2b34c95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,19 @@ jobs: os: [ubuntu-22.04, windows-latest] pyver: ["3.10", "3.11", "3.12"] cuda: ["13.0.0"] + exclude: + - os: windows-latest + cuda: "13.0.0" + include: + - os: windows-latest + pyver: "3.10" + cuda: "12.6.3" + - os: windows-latest + pyver: "3.11" + cuda: "12.6.3" + - os: windows-latest + pyver: "3.12" + cuda: "12.6.3" defaults: run: shell: pwsh @@ -72,7 +85,7 @@ jobs: # Install torch $cudaVersion = $env:CUDA_VERSION.Replace('.', '') $cudaVersionPytorch = $cudaVersion.Substring(0, $cudaVersion.Length - 1) - if ([int]$cudaVersionPytorch -gt 129) { $pytorchVersion = "torch==2.10.0" } elseif ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} + if ([int]$cudaVersionPytorch -gt 129) { $pytorchVersion = "torch==2.10.0" } elseif ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 124) { $pytorchVersion = "torch==2.10.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} echo "pytorchVersion=$pytorchVersion" echo "cudaVersion=<$cudaVersion>" echo "cudaVersionPytorch=$cudaVersionPytorch" @@ -86,11 +99,13 @@ jobs: python -c "from torch.utils import cpp_extension; print (cpp_extension.CUDA_HOME)" - name: Build Wheel (Linux) if: runner.os == 'Linux' - shell: bash + shell: bash -el {0} run: | export CUDA_PATH=$CONDA_PREFIX export CUDA_HOME=$CONDA_PREFIX + echo "CONDA_PREFIX=$CONDA_PREFIX" + # Find thrust include dir THRUST_H=$(find $CONDA_PREFIX -path '*/thrust/complex.h' 2>/dev/null | head -1) if [ -n "$THRUST_H" ]; then @@ -98,7 +113,6 @@ jobs: echo "Found thrust in: $CUDA_INCLUDE" export CXXFLAGS="-I$CUDA_INCLUDE" export CFLAGS="-I$CUDA_INCLUDE" - # Check if this dir has bin/nvcc CUDA_BASE=$(dirname "$CUDA_INCLUDE") if [ -f "$CUDA_BASE/bin/nvcc" ]; then export CUDA_HOME=$CUDA_BASE From 7f197672d0f1b5b1290c9ee004a72ff51315158d Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 06:42:47 +0000 Subject: [PATCH 15/18] fix: skip compute_70 for CUDA >= 13.0 (no longer supported) --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index bbc4f55..e1c9e8a 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from packaging.version import parse, Version import setuptools -from torch.utils.cpp_extension import BuildExtension, CUDA_HOME, CUDAExtension +from torch.utils.cpp_extension import BuildExtension, CUDA_HOME, CUDAExtension ROOT_DIR = os.path.dirname(__file__) @@ -72,7 +72,8 @@ def get_nvcc_cuda_version(cuda_dir: str = "") -> Version: def get_compute_capabilities(compute_capabilities: Set[int], lower: int = 70): # Collect the compute capabilities of all available GPUs. if len(compute_capabilities) == 0 and (is_pypi_build() or not torch.cuda.is_available()): - if lower <= 70: + nvcc_cuda_version = get_nvcc_cuda_version() + if lower <= 70 and nvcc_cuda_version < Version("13.0"): compute_capabilities.add(70) if lower <= 75: compute_capabilities.add(75) @@ -88,10 +89,11 @@ def get_compute_capabilities(compute_capabilities: Set[int], lower: int = 70): compute_capabilities.add(major * 10 + minor) if len(compute_capabilities) == 0: - compute_capabilities.add(70) + nvcc_cuda_version = get_nvcc_cuda_version() + if nvcc_cuda_version < Version("13.0"): + compute_capabilities.add(70) compute_capabilities.add(75) compute_capabilities.add(80) - nvcc_cuda_version = get_nvcc_cuda_version() if nvcc_cuda_version > Version("11.1"): compute_capabilities.add(86) if nvcc_cuda_version > Version("11.8"): From 45a909bbc74efc81ada77d644c9e1b8d87d7cb81 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 06:50:36 +0000 Subject: [PATCH 16/18] ci: patch torch compiled_autograd.h for MSVC+CUDA13 std:: bug, unify CUDA 13.0 --- .github/workflows/release.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b34c95..af4dbba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,19 +20,6 @@ jobs: os: [ubuntu-22.04, windows-latest] pyver: ["3.10", "3.11", "3.12"] cuda: ["13.0.0"] - exclude: - - os: windows-latest - cuda: "13.0.0" - include: - - os: windows-latest - pyver: "3.10" - cuda: "12.6.3" - - os: windows-latest - pyver: "3.11" - cuda: "12.6.3" - - os: windows-latest - pyver: "3.12" - cuda: "12.6.3" defaults: run: shell: pwsh @@ -85,7 +72,7 @@ jobs: # Install torch $cudaVersion = $env:CUDA_VERSION.Replace('.', '') $cudaVersionPytorch = $cudaVersion.Substring(0, $cudaVersion.Length - 1) - if ([int]$cudaVersionPytorch -gt 129) { $pytorchVersion = "torch==2.10.0" } elseif ([int]$cudaVersionPytorch -gt 126) { $pytorchVersion = "torch==2.7.0" } elseif ([int]$cudaVersionPytorch -gt 124) { $pytorchVersion = "torch==2.10.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} + if ([int]$cudaVersionPytorch -gt 129) { $pytorchVersion = "torch==2.10.0" } elseif ([int]$cudaVersionPytorch -gt 121) { $pytorchVersion = "torch==2.5.1" } else {$pytorchVersion = "torch==2.4.1"} echo "pytorchVersion=$pytorchVersion" echo "cudaVersion=<$cudaVersion>" echo "cudaVersionPytorch=$cudaVersionPytorch" @@ -141,6 +128,14 @@ jobs: $env:CUDA_PATH = $cudaDir } + # Patch PyTorch compiled_autograd.h for MSVC + CUDA 13 std:: ambiguity + # See https://github.com/pytorch/pytorch/pull/144707#issuecomment-2692282551 + $header = python -c "import torch; import os; print(os.path.join(os.path.dirname(torch.__file__), 'include', 'torch', 'csrc', 'dynamo', 'compiled_autograd.h'))" + if (Test-Path $header) { + (Get-Content $header) -replace '\} else if constexpr \(::std::is_same_v\) \{', '// } else if constexpr (::std::is_same_v) {' -replace 'return at::StringType::get\(\);', '// return at::StringType::get();' | Set-Content $header + echo "Patched compiled_autograd.h" + } + if ( $env:CUDA_VERSION -eq $env:PYPI_CUDA_VERSION ){ $env:PYPI_BUILD = 1 } From 2f7237ddcab2bea027214514cbcd8738b790be34 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 07:07:27 +0000 Subject: [PATCH 17/18] feat: Python 3.11-3.13, add sm_90/sm_100/sm_120 (H100/B200/RTX5090), update torch to 2.10.0 --- .github/workflows/release.yml | 2 +- pyproject.toml | 2 +- setup.py | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af4dbba..268d76f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-22.04, windows-latest] - pyver: ["3.10", "3.11", "3.12"] + pyver: ["3.11", "3.12", "3.13"] cuda: ["13.0.0"] defaults: run: diff --git a/pyproject.toml b/pyproject.toml index 8a3d653..0b671c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==69.5.1", "wheel", "packaging", "ninja>=1.11.1", "torch==2.2.2"] +requires = ["setuptools==69.5.1", "wheel", "packaging", "ninja>=1.11.1", "torch==2.10.0"] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index e1c9e8a..9c0513e 100644 --- a/setup.py +++ b/setup.py @@ -80,8 +80,10 @@ def get_compute_capabilities(compute_capabilities: Set[int], lower: int = 70): compute_capabilities.add(80) compute_capabilities.add(86) compute_capabilities.add(89) - - if len(compute_capabilities) == 0: + compute_capabilities.add(90) + if nvcc_cuda_version >= Version("12.8"): + compute_capabilities.add(100) + compute_capabilities.add(120) for i in range(torch.cuda.device_count()): major, minor = torch.cuda.get_device_capability(i) if major*10+minor < lower: @@ -99,6 +101,9 @@ def get_compute_capabilities(compute_capabilities: Set[int], lower: int = 70): if nvcc_cuda_version > Version("11.8"): compute_capabilities.add(89) compute_capabilities.add(90) + if nvcc_cuda_version >= Version("12.8"): + compute_capabilities.add(100) + compute_capabilities.add(120) print(f"build pacakge for archs: {compute_capabilities}") capability_flags = [] @@ -211,7 +216,6 @@ def get_gpu_ver(): "Documentation": "https://github.com/wejoncy/QLLM", }, classifiers=[ - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -219,7 +223,7 @@ def get_gpu_ver(): "Topic :: Scientific/Engineering :: Artificial Intelligence", ], packages=setuptools.find_packages(exclude=("")), - python_requires=">=3.10", + python_requires=">=3.11", install_requires=get_requirements(), ext_modules=build_cuda_extensions(), cmdclass={'build_ext': BuildExtension}, From f86780d4d541a545d6f7d5f69a9d98893600cba5 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Sat, 21 Mar 2026 07:23:24 +0000 Subject: [PATCH 18/18] cleanup: remove test branch trigger, update Python/GPU arch versions --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 268d76f..9e2a216 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,6 @@ on: push: tags: - "v*" - branches: - - "fix/ci-build" workflow_dispatch: jobs: