Skip to content

Commit 53daa0e

Browse files
Stop building for CUDA toolkit < 11.8 (#1605)
* Stop building for CUDA toolkit < 11.8 * Simplify * Drop sm70 from cu128 build targets to align with pytorch
1 parent 1088ec5 commit 53daa0e

File tree

6 files changed

+20
-124
lines changed

6 files changed

+20
-124
lines changed

.github/scripts/build-cuda.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ set -xeuo pipefail
88
# By default, target Maxwell through Hopper.
99
build_capability="50;52;60;61;70;75;80;86;89;90"
1010

11-
# CUDA 11.7: Remove sm89 and sm90
12-
[[ "${cuda_version}" == 11.7.* ]] && build_capability="50;52;60;61;70;75;80;86"
13-
14-
# CUDA 12.8: Add sm100 and sm120; remove sm50 through sm61
15-
[[ "${cuda_version}" == 12.8.* ]] && build_capability="70;75;80;86;89;90;100;120"
11+
# CUDA 12.8: Add sm100 and sm120; remove < sm75 to align with PyTorch 2.7+cu128 minimum
12+
[[ "${cuda_version}" == 12.8.* ]] && build_capability="75;80;86;89;90;100;120"
1613

1714
[[ "${build_os}" = windows-* ]] && python3 -m pip install ninja
1815

.github/workflows/python-package.yml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
arch: aarch64
4141
- os: ubuntu-22.04 # Temporary. Takes too long, not ready yet.
4242
arch: aarch64
43-
runs-on: ${{ matrix.os }} # One day, we could run them on native agents. Azure supports this now but it's planned only for Q3 2023 for hosted agents
43+
runs-on: ${{ matrix.os }}
4444
steps:
4545
- uses: actions/checkout@v4
4646
- name: Setup MSVC
@@ -70,13 +70,13 @@ jobs:
7070
- windows-latest
7171
arch: [x86_64, aarch64]
7272
cuda_version:
73-
["11.7.1", "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"]
73+
["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"]
7474
exclude:
7575
- os: windows-latest # This probably requires arm64 Windows agents
7676
arch: aarch64
7777
- os: ubuntu-22.04 # Temporary. Takes too long, not ready yet.
7878
arch: aarch64
79-
runs-on: ${{ matrix.os }} # One day, we could run them on native agents. Azure supports this now but it's planned only for Q3 2023 for hosted agents
79+
runs-on: ${{ matrix.os }}
8080
steps:
8181
- uses: actions/checkout@v4
8282
# Linux: We use Docker to build cross platform Cuda (aarch64 is built in emulation)
@@ -250,33 +250,3 @@ jobs:
250250
uses: pypa/gh-action-pypi-publish@release/v1
251251
with:
252252
print-hash: true
253-
254-
# test:
255-
# needs:
256-
# - build-wheels
257-
# strategy:
258-
# fail-fast: false
259-
# matrix:
260-
# include:
261-
# - os: ubuntu-latest
262-
# arch: x86_64
263-
# python-version: "3.8"
264-
# - os: windows-latest
265-
# arch: x86_64
266-
# python-version: "3.8"
267-
# runs-on: ${{ matrix.os }}
268-
# steps:
269-
# - uses: actions/checkout@v4
270-
# - uses: actions/download-artifact@v4
271-
# with:
272-
# merge-multiple: true
273-
# pattern: "bdist_wheel_${{ matrix.os }}_${{ matrix.arch }}*"
274-
# path: wheel/
275-
# - uses: actions/setup-python@v5
276-
# with:
277-
# python-version: ${{ matrix.python-version }}
278-
# cache: pip
279-
# - shell: bash
280-
# run: ls -lar wheel/
281-
# - run: pip install wheel/*.whl -r requirements-ci.txt
282-
# - run: pytest --log-cli-level=DEBUG --continue-on-collection-errors tests

CMakeLists.txt

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ if(BUILD_CUDA)
9393
)
9494
endif()
9595

96-
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.0")
97-
message(FATAL_ERROR "CUDA Version < 11 is not supported")
96+
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.4")
97+
message(FATAL_ERROR "CUDA Version < 11.4 is not supported")
9898
elseif(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0")
9999
message(FATAL_ERROR "CUDA Version > 12 is not supported")
100100
endif()
@@ -103,35 +103,20 @@ if(BUILD_CUDA)
103103
if(CMAKE_VERSION VERSION_LESS "3.23.0")
104104
message(STATUS "CMake < 3.23.0; determining CUDA architectures supported...")
105105

106-
# 11.x and 12.x both support these at a minimum.
107-
set(CMAKE_CUDA_ARCHITECTURES_ALL 50 52 53 60 61 62 70 72 75 80)
106+
# 11.4+ supports these at a minimum.
107+
set(CMAKE_CUDA_ARCHITECTURES_ALL 50 52 53 60 61 62 70 72 75 80 86 87)
108108
set(CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 50 60 70 80)
109109

110-
# CUDA 11.1 adds Ampere support for GA102-GA107.
111-
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.1")
112-
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 86)
113-
endif()
114-
115-
# CUDA 11.4 adds Ampere support for GA10B.
116-
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.4")
117-
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 87)
118-
endif()
119-
120110
# CUDA 11.8 adds support for Ada and Hopper.
121111
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.8")
122112
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 89 90)
123113
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 90)
124114
endif()
125-
# CUDA 12.7 adds support for Blackwell B100.
126-
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.7")
127-
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 100)
128-
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 100)
129-
endif()
130115

131-
# CUDA 12.8 adds support for RTX 50 Blackwell.
116+
# CUDA 12.8 adds support for Blackwell.
132117
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.8")
133-
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 101 120)
134-
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 101 120)
118+
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 100 101 120)
119+
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 100 120)
135120
endif()
136121
endif()
137122

docs/source/installation.mdx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ The latest version of the distributed `bitsandbytes` package is built with the f
2727

2828
| **OS** | **CUDA Toolkit** | **Host Compiler** |
2929
|-------------|------------------|----------------------|
30-
| **Linux** | 11.7 - 12.3 | GCC 11.4 |
30+
| **Linux** | 11.8 - 12.3 | GCC 11.4 |
3131
| | 12.4 - 12.8 | GCC 13.2 |
32-
| **Windows** | 11.7 - 12.8 | MSVC 19.42+ (VS2022) |
32+
| **Windows** | 11.8 - 12.8 | MSVC 19.42+ (VS2022) |
3333

3434
For CUDA systems, ensure your hardware meets the following requirements:
3535

@@ -88,17 +88,7 @@ For example, to install a compiler and CMake on Ubuntu:
8888
apt-get install -y build-essential cmake
8989
```
9090

91-
You should also install CUDA Toolkit by following the [NVIDIA CUDA Installation Guide for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) guide from NVIDIA. The current expected CUDA Toolkit version is **11.1+** and it is recommended to install **GCC >= 7.3** and required to have at least **GCC >= 6**.
92-
93-
Refer to the following table if you're using another CUDA Toolkit version.
94-
95-
| CUDA Toolkit | GCC |
96-
|--------------|-------|
97-
| >= 11.4.1 | >= 11 |
98-
| >= 12.0 | >= 12 |
99-
| >= 12.4 | >= 13 |
100-
101-
Now to install the bitsandbytes package from source, run the following commands:
91+
You should also install CUDA Toolkit by following the [NVIDIA CUDA Installation Guide for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) guide from NVIDIA. The current minimum supported CUDA Toolkit version is **11.8**.
10292

10393
```bash
10494
git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/
@@ -115,13 +105,7 @@ pip install -e . # `-e` for "editable" install, when developing BNB (otherwise
115105

116106
Windows systems require Visual Studio with C++ support as well as an installation of the CUDA SDK.
117107

118-
To compile from source, you need CMake >= **3.22.1** and Python >= **3.9** installed. You should also install CUDA Toolkit by following the [CUDA Installation Guide for Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) guide from NVIDIA.
119-
120-
Refer to the following table if you're using another CUDA Toolkit version.
121-
122-
| CUDA Toolkit | MSVC |
123-
|---|---|
124-
| >= 11.6 | 19.30+ (VS2022) |
108+
To compile from source, you need CMake >= **3.22.1** and Python >= **3.9** installed. You should also install CUDA Toolkit by following the [CUDA Installation Guide for Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) guide from NVIDIA. The current minimum supported CUDA Toolkit version is **11.8**.
125109

126110
```bash
127111
git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/
@@ -149,7 +133,7 @@ Then locally install the CUDA version you need with this script from bitsandbyte
149133
```bash
150134
wget https://raw.githubusercontent.com/bitsandbytes-foundation/bitsandbytes/main/install_cuda.sh
151135
# Syntax cuda_install CUDA_VERSION INSTALL_PREFIX EXPORT_TO_BASH
152-
# CUDA_VERSION in {110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 128}
136+
# CUDA_VERSION in {118, 120, 121, 122, 123, 124, 125, 126, 128}
153137
# EXPORT_TO_BASH in {0, 1} with 0=False and 1=True
154138

155139
# For example, the following installs CUDA 12.6 to ~/local/cuda-12.6 and exports the path to your .bashrc

install_cuda.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
from urllib.request import urlretrieve
55

66
cuda_versions = {
7-
"110": "https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_450.51.06_linux.run",
8-
"111": "https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run",
9-
"112": "https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run",
10-
"113": "https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run",
11-
"114": "https://developer.download.nvidia.com/compute/cuda/11.4.4/local_installers/cuda_11.4.4_470.82.01_linux.run",
12-
"115": "https://developer.download.nvidia.com/compute/cuda/11.5.2/local_installers/cuda_11.5.2_495.29.05_linux.run",
13-
"116": "https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda_11.6.2_510.47.03_linux.run",
14-
"117": "https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run",
157
"118": "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run",
168
"120": "https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run",
179
"121": "https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run",

install_cuda.sh

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
URL110=https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_450.51.06_linux.run
2-
URL111=https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run
3-
URL112=https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
4-
URL113=https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run
5-
URL114=https://developer.download.nvidia.com/compute/cuda/11.4.4/local_installers/cuda_11.4.4_470.82.01_linux.run
6-
URL115=https://developer.download.nvidia.com/compute/cuda/11.5.2/local_installers/cuda_11.5.2_495.29.05_linux.run
7-
URL116=https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda_11.6.2_510.47.03_linux.run
8-
URL117=https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
91
URL118=https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
102
URL120=https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run
113
URL121=https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
@@ -20,31 +12,7 @@ BASE_PATH=$2
2012
EXPORT_BASHRC=$3
2113

2214
if [[ -n "$CUDA_VERSION" ]]; then
23-
if [[ "$CUDA_VERSION" -eq "110" ]]; then
24-
URL=$URL110
25-
FOLDER=cuda-11.0
26-
elif [[ "$CUDA_VERSION" -eq "111" ]]; then
27-
URL=$URL111
28-
FOLDER=cuda-11.1
29-
elif [[ "$CUDA_VERSION" -eq "112" ]]; then
30-
URL=$URL112
31-
FOLDER=cuda-11.2
32-
elif [[ "$CUDA_VERSION" -eq "113" ]]; then
33-
URL=$URL113
34-
FOLDER=cuda-11.3
35-
elif [[ "$CUDA_VERSION" -eq "114" ]]; then
36-
URL=$URL114
37-
FOLDER=cuda-11.4
38-
elif [[ "$CUDA_VERSION" -eq "115" ]]; then
39-
URL=$URL115
40-
FOLDER=cuda-11.5
41-
elif [[ "$CUDA_VERSION" -eq "116" ]]; then
42-
URL=$URL116
43-
FOLDER=cuda-11.6
44-
elif [[ "$CUDA_VERSION" -eq "117" ]]; then
45-
URL=$URL117
46-
FOLDER=cuda-11.7
47-
elif [[ "$CUDA_VERSION" -eq "118" ]]; then
15+
if [[ "$CUDA_VERSION" -eq "118" ]]; then
4816
URL=$URL118
4917
FOLDER=cuda-11.8
5018
elif [[ "$CUDA_VERSION" -eq "120" ]]; then
@@ -69,10 +37,10 @@ if [[ -n "$CUDA_VERSION" ]]; then
6937
URL=$URL126
7038
FOLDER=cuda-12.6
7139
else
72-
echo "argument error: No cuda version passed as input. Choose among versions 110 to 126"
40+
echo "argument error: No cuda version passed as input. Choose among versions 118 to 126"
7341
fi
7442
else
75-
echo "argument error: No cuda version passed as input. Choose among versions 110 to 126"
43+
echo "argument error: No cuda version passed as input. Choose among versions 118 to 126"
7644
fi
7745

7846
FILE=$(basename $URL)

0 commit comments

Comments
 (0)