From 2e88af56e737c59142815f6d324a2c1a6efbde01 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Wed, 29 May 2024 06:52:33 -0400 Subject: [PATCH 01/10] cpu install guide --- docs/source/installation.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index caf22488f..2aa549b05 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -62,6 +62,16 @@ make pip install . ``` +If you want to install bitsandbytes with CPU backend, please run the fowllowing commands: +```bash +pip install intel_extention_for_pytorch +git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ && git checkout multi-backend-refactor +pip install -r requirements-dev.txt +cmake -DCOMPUTE_BACKEND=cpu -S . +make +pip install . +``` + > [!TIP] > If you have multiple versions of CUDA installed or installed it in a non-standard location, please refer to CMake CUDA documentation for how to configure the CUDA compiler. From 0ceb841a10349a78b2978f36cc98214d0f69b490 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Tue, 11 Jun 2024 06:05:58 -0400 Subject: [PATCH 02/10] update readme --- docs/source/installation.mdx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 2aa549b05..efd1b5352 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -1,5 +1,7 @@ # Installation +## CUDA + bitsandbytes is only supported on CUDA GPUs for CUDA versions **11.0 - 12.3**. The latest version of bitsandbytes (v0.43.0) builds on: @@ -29,7 +31,7 @@ To install from PyPI. pip install bitsandbytes ``` -## Compile from source +### Compile from source For Linux and Windows systems, you can compile bitsandbytes from source. Installing from source allows for more build options with different CMake configurations. @@ -62,16 +64,6 @@ make pip install . ``` -If you want to install bitsandbytes with CPU backend, please run the fowllowing commands: -```bash -pip install intel_extention_for_pytorch -git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ && git checkout multi-backend-refactor -pip install -r requirements-dev.txt -cmake -DCOMPUTE_BACKEND=cpu -S . -make -pip install . -``` - > [!TIP] > If you have multiple versions of CUDA installed or installed it in a non-standard location, please refer to CMake CUDA documentation for how to configure the CUDA compiler. @@ -101,7 +93,7 @@ Big thanks to [wkpark](https://github.com/wkpark), [Jamezo97](https://github.com -## PyTorch CUDA versions +### PyTorch CUDA versions Some bitsandbytes features may need a newer CUDA version than the one currently supported by PyTorch binaries from Conda and pip. In this case, you should follow these instructions to load a precompiled bitsandbytes binary. @@ -141,3 +133,15 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7 ``` 3. Now when you launch bitsandbytes with these environment variables, the PyTorch CUDA version is overridden by the new CUDA version (in this example, version 11.7) and a different bitsandbytes library is loaded. + + +## Intel CPU +To install bitsandbytes on a Intel CPU backend: +```bash +pip install intel_extention_for_pytorch +git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ && git checkout multi-backend-refactor +pip install -r requirements-dev.txt +cmake -DCOMPUTE_BACKEND=cpu -S . +make +pip install . +``` \ No newline at end of file From 8b7e1cf34e26aeab85875fe8c7ec3691de096c67 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Tue, 11 Jun 2024 06:16:10 -0400 Subject: [PATCH 03/10] fix format --- docs/source/installation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index efd1b5352..6584b76ae 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -144,4 +144,4 @@ pip install -r requirements-dev.txt cmake -DCOMPUTE_BACKEND=cpu -S . make pip install . -``` \ No newline at end of file +``` From 75f2122d629d3c49598f1d23326620e41398d364 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Tue, 11 Jun 2024 06:16:49 -0400 Subject: [PATCH 04/10] fix format --- docs/source/installation.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 6584b76ae..b4732cc52 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -136,7 +136,9 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7 ## Intel CPU + To install bitsandbytes on a Intel CPU backend: + ```bash pip install intel_extention_for_pytorch git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ && git checkout multi-backend-refactor From c9ea29cc023f5c0d8122435cc72a93e266647172 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Tue, 11 Jun 2024 06:19:13 -0400 Subject: [PATCH 05/10] fix typo --- docs/source/installation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index b4732cc52..8d86e78d6 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -140,7 +140,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7 To install bitsandbytes on a Intel CPU backend: ```bash -pip install intel_extention_for_pytorch +pip install intel_extension_for_pytorch git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ && git checkout multi-backend-refactor pip install -r requirements-dev.txt cmake -DCOMPUTE_BACKEND=cpu -S . From 90817d1f5d22b09690849425d924785527826a81 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Tue, 18 Jun 2024 09:00:17 -0400 Subject: [PATCH 06/10] add windows guide --- docs/source/installation.mdx | 40 +++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 8d86e78d6..4acfa4ba4 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -137,13 +137,47 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7 ## Intel CPU -To install bitsandbytes on a Intel CPU backend: +> [!TIP] +> Intel CPU backend only supports build from source for now, please following the instruction below. + +Same as cuda, you can compile bitsandbytes from source for Linux and Windows systems. Installing from source allows for more build options with different CMake configurations. + + + + +To compile from source, you need CMake >= **3.22.1** and Python >= **3.8** installed. Make sure you have a compiler installed to compile C++ (gcc, make, headers, etc.). For example, to install a compiler and CMake on Ubuntu: ```bash -pip install intel_extension_for_pytorch -git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ && git checkout multi-backend-refactor +apt-get install -y build-essential cmake +``` + +We recommended you to install **GCC >= 11** and required to have at least **GCC >= 6**. + +Now to install the bitsandbytes package from source, run the following commands: + +```bash +git clone --branch multi-backend-refactor https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ pip install -r requirements-dev.txt +pip install intel_extension_for_pytorch cmake -DCOMPUTE_BACKEND=cpu -S . make pip install . ``` + + + + +Windows systems require Visual Studio with C++ support. + +To compile from source, you need CMake >= **3.22.1** and Python >= **3.8** installed. + +```bash +git clone --branch multi-backend-refactor https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/ +pip install -r requirements-dev.txt +cmake -DCOMPUTE_BACKEND=cpu -S . +cmake --build . --config Release +python -m build --wheel +``` + + + From 45929240f4c44cbac2d522f7399e347f6a09987e Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Tue, 18 Jun 2024 09:40:34 -0400 Subject: [PATCH 07/10] fix readme to pip install . instead of building wheel --- docs/source/installation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 4acfa4ba4..65dad2c3b 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -176,7 +176,7 @@ git clone --branch multi-backend-refactor https://github.com/TimDettmers/bitsand pip install -r requirements-dev.txt cmake -DCOMPUTE_BACKEND=cpu -S . cmake --build . --config Release -python -m build --wheel +pip install . ``` From 922418a76eef73ac75ba3f1a7849f77d212baa12 Mon Sep 17 00:00:00 2001 From: jiqing-feng <107918818+jiqing-feng@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:11:16 +0800 Subject: [PATCH 08/10] Update docs/source/installation.mdx Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> --- docs/source/installation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 65dad2c3b..1023c1a99 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -138,7 +138,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7 ## Intel CPU > [!TIP] -> Intel CPU backend only supports build from source for now, please following the instruction below. +> Intel CPU backend only supports building from source; for now, please follow the instructions below. Same as cuda, you can compile bitsandbytes from source for Linux and Windows systems. Installing from source allows for more build options with different CMake configurations. From 579e71544bba5c09cb77f75abe155e42b99ae1fa Mon Sep 17 00:00:00 2001 From: jiqing-feng <107918818+jiqing-feng@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:11:24 +0800 Subject: [PATCH 09/10] Update docs/source/installation.mdx Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> --- docs/source/installation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 1023c1a99..174bbc5ad 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -140,7 +140,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7 > [!TIP] > Intel CPU backend only supports building from source; for now, please follow the instructions below. -Same as cuda, you can compile bitsandbytes from source for Linux and Windows systems. Installing from source allows for more build options with different CMake configurations. +Like CUDA, you can compile bitsandbytes from source for Linux and Windows systems. Installing from source allows for more build options with different CMake configurations. From cc2f15f47df95326d5b9a199b98c1c5841bcdd24 Mon Sep 17 00:00:00 2001 From: jiqing-feng <107918818+jiqing-feng@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:11:34 +0800 Subject: [PATCH 10/10] Update docs/source/installation.mdx Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> --- docs/source/installation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 174bbc5ad..c84d0c2ef 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -151,7 +151,7 @@ To compile from source, you need CMake >= **3.22.1** and Python >= **3.8** insta apt-get install -y build-essential cmake ``` -We recommended you to install **GCC >= 11** and required to have at least **GCC >= 6**. +We recommend installing **GCC >= 11** and have at least **GCC >= 6**. Now to install the bitsandbytes package from source, run the following commands: