Skip to content

Commit 3e69e8f

Browse files
DessixPriNovarapsealk
authored
Bump CUDA 12.2.0 to 12.2.1, fix setup support for Cuda 12.1 (#703), Sort compute capabilities sets to select max
* Add support for CUDA 12.1 * Update README to include CUDA 12.1 version * Add support for >= 12x Co-authored-by: Jeongseok Kang <[email protected]> * Temporary version of bitsandbytes PR 527: Sort compute capabilities sets to select max * Modify PR 506 to support C++20 * Add Cuda 12.2 --------- Co-authored-by: PriNova <[email protected]> Co-authored-by: PriNova <[email protected]> Co-authored-by: Jeongseok Kang <[email protected]>
1 parent dcfb6f8 commit 3e69e8f

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ cuda118: $(BUILD_DIR) env
110110
cuda12x: $(BUILD_DIR) env
111111
$(NVCC) $(CC_cublasLt111) $(CC_ADA_HOPPER) -Xcompiler '-fPIC' --use_fast_math -Xptxas=-v -dc $(FILES_CUDA) $(INCLUDE) $(LIB) --output-directory $(BUILD_DIR)
112112
$(NVCC) $(CC_cublasLt111) $(CC_ADA_HOPPER) -Xcompiler '-fPIC' -dlink $(BUILD_DIR)/ops.o $(BUILD_DIR)/kernels.o -o $(BUILD_DIR)/link.o
113-
$(GPP) -std=c++14 -DBUILD_CUDA -shared -fPIC $(INCLUDE) $(BUILD_DIR)/ops.o $(BUILD_DIR)/kernels.o $(BUILD_DIR)/link.o $(FILES_CPP) -o ./bitsandbytes/libbitsandbytes_cuda$(CUDA_VERSION).so $(LIB)
113+
$(GPP) -std=c++20 -DBUILD_CUDA -shared -fPIC $(INCLUDE) $(BUILD_DIR)/ops.o $(BUILD_DIR)/kernels.o $(BUILD_DIR)/link.o $(FILES_CPP) -o ./bitsandbytes/libbitsandbytes_cuda$(CUDA_VERSION).so $(LIB)
114114

115115
cpuonly: $(BUILD_DIR) env
116116
$(GPP) -std=c++14 -shared -fPIC -I $(ROOT_DIR)/csrc -I $(ROOT_DIR)/include $(FILES_CPP) -o ./bitsandbytes/libbitsandbytes_cpu.so

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Compilation quickstart:
2626
git clone https://github.com/timdettmers/bitsandbytes.git
2727
cd bitsandbytes
2828

29-
# CUDA_VERSIONS in {110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 120}
29+
# CUDA_VERSIONS in {110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122}
3030
# make argument in {cuda110, cuda11x, cuda12x}
3131
# if you do not know what CUDA you have, try looking at the output of: python -m bitsandbytes
3232
CUDA_VERSION=117 make cuda11x
@@ -83,7 +83,7 @@ Hardware requirements:
8383
- LLM.int8(): NVIDIA Turing (RTX 20xx; T4) or Ampere GPU (RTX 30xx; A4-A100); (a GPU from 2018 or newer).
8484
- 8-bit optimizers and quantization: NVIDIA Kepler GPU or newer (>=GTX 78X).
8585

86-
Supported CUDA versions: 10.2 - 12.0
86+
Supported CUDA versions: 10.2 - 12.2
8787

8888
The bitsandbytes library is currently only supported on Linux distributions. Windows is not supported at the moment.
8989

bitsandbytes/cuda_setup/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# libcudart.so is missing by default for a conda install with PyTorch 2.0 and instead
3232
# we have libcudart.so.11.0 which causes a lot of errors before
3333
# not sure if libcudart.so.12.0 exists in pytorch installs, but it does not hurt
34-
CUDA_RUNTIME_LIBS: list = ["libcudart.so", 'libcudart.so.11.0', 'libcudart.so.12.0']
34+
CUDA_RUNTIME_LIBS: list = ["libcudart.so", 'libcudart.so.11.0', 'libcudart.so.12.0', 'libcudart.so.12.1', 'libcudart.so.12.2']
3535

3636
# this is a order list of backup paths to search CUDA in, if it cannot be found in the main environmental paths
3737
backup_paths = []
@@ -77,6 +77,8 @@ def generate_instructions(self):
7777
make_cmd += ' make cuda110'
7878
elif self.cuda_version_string[:2] == '11' and int(self.cuda_version_string[2]) > 0:
7979
make_cmd += ' make cuda11x'
80+
elif self.cuda_version_string[:2] == '12' and 1 >= int(self.cuda_version_string[2]) >= 0:
81+
make_cmd += ' make cuda12x'
8082
elif self.cuda_version_string == '100':
8183
self.add_log_entry('CUDA SETUP: CUDA 10.0 not supported. Please use a different CUDA version.')
8284
self.add_log_entry('CUDA SETUP: Before you try again running bitsandbytes, make sure old CUDA 10.0 versions are uninstalled and removed from $LD_LIBRARY_PATH variables.')
@@ -327,6 +329,8 @@ def get_compute_capabilities():
327329
cc_major, cc_minor = torch.cuda.get_device_capability(torch.cuda.device(i))
328330
ccs.append(f"{cc_major}.{cc_minor}")
329331

332+
ccs.sort(key=lambda v: tuple(map(int, str(v).split("."))))
333+
330334
return ccs
331335

332336

compile_from_source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can install CUDA locally without sudo by following the following steps:
1111
```bash
1212
wget https://raw.githubusercontent.com/TimDettmers/bitsandbytes/main/install_cuda.sh
1313
# Syntax cuda_install CUDA_VERSION INSTALL_PREFIX EXPORT_TO_BASH
14-
# CUDA_VERSION in {110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121}
14+
# CUDA_VERSION in {110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122}
1515
# EXPORT_TO_BASH in {0, 1} with 0=False and 1=True
1616

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

install_cuda.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ URL116=https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installer
1212
URL117=https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run
1313
URL118=https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
1414
URL120=https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_525.60.13_linux.run
15-
URL121=https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run
16-
URL122=https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run
15+
URL121=https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
16+
URL122=https://developer.download.nvidia.com/compute/cuda/12.2.1/local_installers/cuda_12.2.1_535.86.10_linux.run
1717
URL123=https://developer.download.nvidia.com/compute/cuda/12.3.1/local_installers/cuda_12.3.1_545.23.08_linux.run
1818

1919

0 commit comments

Comments
 (0)