Implementation:Bitsandbytes foundation Bitsandbytes Python Package CI Workflow
| Knowledge Sources | |
|---|---|
| Domains | CI_CD, Build_System, Packaging |
| Last Updated | 2026-02-07 13:31 GMT |
Overview
GitHub Actions CI/CD workflow that builds, packages, audits, and publishes bitsandbytes native libraries and Python wheels for all supported platforms and accelerator backends.
Description
The python-package.yml workflow orchestrates the complete build-and-release pipeline for bitsandbytes. It compiles native C/C++/SYCL shared libraries for CPU (x86_64, aarch64, arm64), CUDA (11.8–13.0), ROCm (6.2.4–7.2), and Intel XPU backends across Linux, Windows, and macOS. It then assembles platform-specific Python wheels, audits Linux wheels with auditwheel, publishes continuous pre-release wheels to GitHub Releases on every push to main, and publishes final wheels to PyPI on tagged releases.
Usage
This workflow runs automatically on push, pull request to main, release publication, and can be triggered manually or from other workflows. It ensures that every commit produces tested, auditable wheel artifacts and that releases are published to PyPI.
Code Reference
Source Location
- Repository: bitsandbytes
- File: .github/workflows/python-package.yml
- Lines: 1-411
Signature
name: Python package
on:
push: {}
pull_request:
branches: [main]
release:
types: [published]
workflow_dispatch: {}
workflow_call: {}
jobs:
build-cpu: ...
build-cuda: ...
build-xpu: ...
build-rocm: ...
build-wheels: ...
upload-pre-release-wheels: ...
audit-wheels: ...
publish-wheels: ...
Import
# Triggered automatically by GitHub Actions on push/PR/release.
# Manual trigger: workflow_dispatch
# Cross-workflow trigger: workflow_call
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Source code | Git repository | Yes | Full repository checkout including csrc/, bitsandbytes/, CMakeLists.txt |
| CUDA toolkit | CI dependency | No | Installed per matrix.cuda_version (11.8.0–13.0.2) |
| ROCm toolkit | CI dependency | No | Docker-based per matrix.rocm_version (6.2.4–7.2) |
| GITHUB_TOKEN | Secret | Yes | For release creation and artifact management |
| PyPI OIDC | Secret | Yes | For trusted publishing to PyPI (on tag push only) |
Outputs
| Name | Type | Description |
|---|---|---|
| Shared libraries | Build artifacts | Native .so/.dll/.dylib files per platform/backend |
| Python wheels | .whl files | Platform-tagged wheels (py3-none-{platform}) |
| GitHub Pre-release | Release | Continuously updated pre-release with stable download URLs |
| PyPI package | Published package | Final release published to pypi.org/p/bitsandbytes |
Usage Examples
Installing Pre-release Wheel
# Install the latest main branch wheel for Linux x86_64
pip install --force-reinstall https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-manylinux_2_24_x86_64.whl
Manual Workflow Trigger
# Trigger workflow manually via GitHub CLI
gh workflow run python-package.yml --ref main