Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/build-cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ if [ "${build_os:0:6}" == ubuntu ]; then
echo "Using image $image"

docker run -i -w /src -v "$PWD:/src" "$image" bash -c \
"dnf update -y \
&& dnf install cmake gcc-toolset-11 -y \
"dnf -y --refresh update --security \
&& dnf -y install cmake gcc-toolset-11 --setopt=install_weak_deps=False --setopt=tsflags=nodocs \
&& source scl_source enable gcc-toolset-11 \
&& cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=\"${build_capability}\" . \
&& cmake --build . --config Release"
Expand Down
45 changes: 23 additions & 22 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ on:
branches: [main]
paths:
- ".github/workflows/python-package.yml"
- ".github/scripts/**"
- "bitsandbytes/**"
- "csrc/**"
- "include/**"
- "tests/**"
- "CMakeLists.txt"
- "requirements*.txt"
- "MANIFEST.in"
- "setup.py"
- "pyproject.toml"
release:
Expand All @@ -25,19 +26,19 @@ concurrency:

jobs:
##
# This job matrix builds the non-CUDA versions of the libraries for all supported platforms.
# This job matrix builds the CPU versions of the libraries for all supported platforms.
##
build-shared-libs:
build-cpu:
strategy:
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
- os: ubuntu-22.04-arm
arch: aarch64
- os: windows-latest
- os: windows-2025
arch: x86_64
- os: macos-latest
- os: macos-15
arch: arm64
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -56,35 +57,37 @@ jobs:
name: shared_library_${{ matrix.os }}_${{ matrix.arch }}
path: output/*
retention-days: 7

##
# This job matrix builds the CUDA versions of the libraries for platforms that support CUDA (Linux x64/aarch64 + Windows x64)
##
build-shared-libs-cuda:
build-cuda:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest]
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025]
include:
- os: ubuntu-22.04
arch: x86_64
- os: ubuntu-22.04-arm
arch: aarch64
- os: windows-latest
- os: windows-2025
arch: x86_64
cuda_version:
["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"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# Windows: We install Cuda on the agent (slow)
#- uses: Jimver/cuda-toolkit@433d453c1fa37d10a3254452fa8e284441c9192d # v0.2.27
- uses: N-Storm/cuda-toolkit@d68ba29a800229200a2c3f572f9e816d7f67cdb4 # v0.2.24m
if: startsWith(matrix.os, 'windows')
id: cuda-toolkit
with:
# Temporary: Use CUDA 13.0.0 for Windows until 13.0.1 is supported with this action.
cuda: ${{ matrix.cuda_version == '13.0.1' && '13.0.0' || matrix.cuda_version }}
method: "local"
method: "network"
# The "crt" "nvvm" and "nvptxcompiler" components are added for CUDA 13.
sub-packages: ${{ format('["nvcc"{0},"cudart","cusparse","cublas","thrust","cublas_dev","cusparse_dev"]', startsWith(matrix.cuda_version, '13.') && ',"crt","nvvm","nvptxcompiler"' || '') }}
use-github-cache: false
use-local-cache: false
log-file-suffix: ${{matrix.os}}-${{matrix.cuda_version}}.txt
Expand All @@ -104,7 +107,7 @@ jobs:
path: output/*
retention-days: 7

build-shared-libs-xpu:
build-xpu:
strategy:
matrix:
os: [ubuntu-22.04]
Expand All @@ -122,7 +125,7 @@ jobs:
path: output/*
retention-days: 7

build-shared-libs-rocm:
build-rocm:
strategy:
matrix:
os: [ubuntu-22.04]
Expand All @@ -132,8 +135,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Docker multiarch
uses: docker/setup-qemu-action@v3
- name: Clean up disk space
run: |
sudo rm -rf \
Expand Down Expand Up @@ -168,24 +169,24 @@ jobs:

build-wheels:
needs:
- build-shared-libs
- build-shared-libs-cuda
- build-shared-libs-rocm
- build-shared-libs-xpu
- build-cpu
- build-cuda
- build-rocm
- build-xpu
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-latest]
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025, macos-15]
include:
- os: ubuntu-22.04
arch: x86_64
- os: ubuntu-22.04-arm
arch: aarch64
- os: windows-latest
- os: windows-2025
arch: x86_64
- os: macos-latest
- os: macos-15
arch: arm64
# The specific Python version is irrelevant in this context as we are only packaging non-C extension
# code. This ensures compatibility across Python versions, including Python 3.9, as compatibility is
# code. This ensures compatibility across Python versions, as compatibility is
# dictated by the packaged code itself, not the Python version used for packaging.
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
Expand Down