Skip to content

Commit c72aae7

Browse files
Update workflow for packaging (#1766)
* Update workflow for packaging * Run the workflow when files change in `.github/scripts/**` * Shorter names for build jobs * Change Windows CUDA install back to "network" using subpackages * Update * Modify sub-packages for CUDA version handling Updated sub-packages to conditionally include 'crt' for CUDA 13. * Update CUDA sub-packages in workflow configuration * Change CUDA install method to 'local' for version 13 on Windows * Modify CUDA sub-packages for version 13 support * Change CUDA install method to 'network' in workflow * CUDA build script: only install security updates in container * CUDA build script: only install security updates in container * Pin macos build runner to macos-15 and windows to windows-2025 * ROCm build: remove unneeded build step
1 parent 09ea861 commit c72aae7

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

.github/scripts/build-cuda.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ if [ "${build_os:0:6}" == ubuntu ]; then
3232
echo "Using image $image"
3333

3434
docker run -i -w /src -v "$PWD:/src" "$image" bash -c \
35-
"dnf update -y \
36-
&& dnf install cmake gcc-toolset-11 -y \
35+
"dnf -y --refresh update --security \
36+
&& dnf -y install cmake gcc-toolset-11 --setopt=install_weak_deps=False --setopt=tsflags=nodocs \
3737
&& source scl_source enable gcc-toolset-11 \
3838
&& cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=\"${build_capability}\" . \
3939
&& cmake --build . --config Release"

.github/workflows/python-package.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ on:
66
branches: [main]
77
paths:
88
- ".github/workflows/python-package.yml"
9+
- ".github/scripts/**"
910
- "bitsandbytes/**"
1011
- "csrc/**"
1112
- "include/**"
1213
- "tests/**"
1314
- "CMakeLists.txt"
14-
- "requirements*.txt"
15+
- "MANIFEST.in"
1516
- "setup.py"
1617
- "pyproject.toml"
1718
release:
@@ -25,19 +26,19 @@ concurrency:
2526

2627
jobs:
2728
##
28-
# This job matrix builds the non-CUDA versions of the libraries for all supported platforms.
29+
# This job matrix builds the CPU versions of the libraries for all supported platforms.
2930
##
30-
build-shared-libs:
31+
build-cpu:
3132
strategy:
3233
matrix:
3334
include:
3435
- os: ubuntu-22.04
3536
arch: x86_64
3637
- os: ubuntu-22.04-arm
3738
arch: aarch64
38-
- os: windows-latest
39+
- os: windows-2025
3940
arch: x86_64
40-
- os: macos-latest
41+
- os: macos-15
4142
arch: arm64
4243
runs-on: ${{ matrix.os }}
4344
steps:
@@ -56,35 +57,37 @@ jobs:
5657
name: shared_library_${{ matrix.os }}_${{ matrix.arch }}
5758
path: output/*
5859
retention-days: 7
60+
5961
##
6062
# This job matrix builds the CUDA versions of the libraries for platforms that support CUDA (Linux x64/aarch64 + Windows x64)
6163
##
62-
build-shared-libs-cuda:
64+
build-cuda:
6365
strategy:
6466
fail-fast: false
6567
matrix:
66-
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest]
68+
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025]
6769
include:
6870
- os: ubuntu-22.04
6971
arch: x86_64
7072
- os: ubuntu-22.04-arm
7173
arch: aarch64
72-
- os: windows-latest
74+
- os: windows-2025
7375
arch: x86_64
7476
cuda_version:
7577
["11.8.0", "12.0.1", "12.1.1", "12.2.2", "12.3.2", "12.4.1", "12.5.1", "12.6.3", "12.8.1", "12.9.1", "13.0.1"]
7678
runs-on: ${{ matrix.os }}
7779
steps:
7880
- uses: actions/checkout@v4
7981
# Windows: We install Cuda on the agent (slow)
80-
#- uses: Jimver/cuda-toolkit@433d453c1fa37d10a3254452fa8e284441c9192d # v0.2.27
8182
- uses: N-Storm/cuda-toolkit@d68ba29a800229200a2c3f572f9e816d7f67cdb4 # v0.2.24m
8283
if: startsWith(matrix.os, 'windows')
8384
id: cuda-toolkit
8485
with:
8586
# Temporary: Use CUDA 13.0.0 for Windows until 13.0.1 is supported with this action.
8687
cuda: ${{ matrix.cuda_version == '13.0.1' && '13.0.0' || matrix.cuda_version }}
87-
method: "local"
88+
method: "network"
89+
# The "crt" "nvvm" and "nvptxcompiler" components are added for CUDA 13.
90+
sub-packages: ${{ format('["nvcc"{0},"cudart","cusparse","cublas","thrust","cublas_dev","cusparse_dev"]', startsWith(matrix.cuda_version, '13.') && ',"crt","nvvm","nvptxcompiler"' || '') }}
8891
use-github-cache: false
8992
use-local-cache: false
9093
log-file-suffix: ${{matrix.os}}-${{matrix.cuda_version}}.txt
@@ -104,7 +107,7 @@ jobs:
104107
path: output/*
105108
retention-days: 7
106109

107-
build-shared-libs-xpu:
110+
build-xpu:
108111
strategy:
109112
matrix:
110113
os: [ubuntu-22.04]
@@ -122,7 +125,7 @@ jobs:
122125
path: output/*
123126
retention-days: 7
124127

125-
build-shared-libs-rocm:
128+
build-rocm:
126129
strategy:
127130
matrix:
128131
os: [ubuntu-22.04]
@@ -132,8 +135,6 @@ jobs:
132135
runs-on: ${{ matrix.os }}
133136
steps:
134137
- uses: actions/checkout@v4
135-
- name: Set up Docker multiarch
136-
uses: docker/setup-qemu-action@v3
137138
- name: Clean up disk space
138139
run: |
139140
sudo rm -rf \
@@ -168,24 +169,24 @@ jobs:
168169

169170
build-wheels:
170171
needs:
171-
- build-shared-libs
172-
- build-shared-libs-cuda
173-
- build-shared-libs-rocm
174-
- build-shared-libs-xpu
172+
- build-cpu
173+
- build-cuda
174+
- build-rocm
175+
- build-xpu
175176
strategy:
176177
matrix:
177-
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-latest]
178+
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025, macos-15]
178179
include:
179180
- os: ubuntu-22.04
180181
arch: x86_64
181182
- os: ubuntu-22.04-arm
182183
arch: aarch64
183-
- os: windows-latest
184+
- os: windows-2025
184185
arch: x86_64
185-
- os: macos-latest
186+
- os: macos-15
186187
arch: arm64
187188
# The specific Python version is irrelevant in this context as we are only packaging non-C extension
188-
# code. This ensures compatibility across Python versions, including Python 3.9, as compatibility is
189+
# code. This ensures compatibility across Python versions, as compatibility is
189190
# dictated by the packaged code itself, not the Python version used for packaging.
190191
python-version: ["3.10"]
191192
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)