From 2471c3de53598323f56b38ff8ac0ce6938119dfe Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Sun, 30 Jun 2024 22:19:28 +0200 Subject: [PATCH] update bitsandbytes build system --- bitsandbytes-rocm-build/Dockerfile | 3 ++- bitsandbytes-rocm-build/README.md | 16 ++++++++++++++++ bitsandbytes-rocm-build/build.sh | 2 +- bitsandbytes-rocm-build/extract_build.sh | 4 ++-- 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 bitsandbytes-rocm-build/README.md mode change 100644 => 100755 bitsandbytes-rocm-build/build.sh diff --git a/bitsandbytes-rocm-build/Dockerfile b/bitsandbytes-rocm-build/Dockerfile index 72e2d27..6735e05 100644 --- a/bitsandbytes-rocm-build/Dockerfile +++ b/bitsandbytes-rocm-build/Dockerfile @@ -27,6 +27,7 @@ RUN pip3 install -r requirements-dev.txt ## Build RUN cmake -DCOMPUTE_BACKEND=hip -S . -DBNB_ROCM_ARCH=${ROCM_ARCH} RUN make +RUN python3 setup.py bdist_wheel --universal # Cleanup -RUN apt-get clean && pip3 cache purge \ No newline at end of file +RUN apt-get clean && pip3 cache purge diff --git a/bitsandbytes-rocm-build/README.md b/bitsandbytes-rocm-build/README.md new file mode 100644 index 0000000..dca2e26 --- /dev/null +++ b/bitsandbytes-rocm-build/README.md @@ -0,0 +1,16 @@ +# bitsandbytes-rocm-build-pip + +This is a simple script to help you build the latest bitsandbytes for rocm. +The official build process requires a lot of ROCM-related packages and can mess up your computer easily if you install the wrong packages. + +This creates a Docker image that builds the package and extract the built wheel file that you can then easily install using pip. + +```bash +./build.sh +./extract_build.sh +``` + +The wheel file will be in a folder named ``build_output/`` + +You can also find my latest build in the releases section. + diff --git a/bitsandbytes-rocm-build/build.sh b/bitsandbytes-rocm-build/build.sh old mode 100644 new mode 100755 index ef9cfd6..cd38e05 --- a/bitsandbytes-rocm-build/build.sh +++ b/bitsandbytes-rocm-build/build.sh @@ -1 +1 @@ -docker build . -t 'bitsandbytes-rocm-build:6.1.2' -f Dockerfile \ No newline at end of file +docker build . -t 'bitsandbytes-rocm-build:6.1.2' -f Dockerfile diff --git a/bitsandbytes-rocm-build/extract_build.sh b/bitsandbytes-rocm-build/extract_build.sh index 38a32d5..41a684f 100755 --- a/bitsandbytes-rocm-build/extract_build.sh +++ b/bitsandbytes-rocm-build/extract_build.sh @@ -3,7 +3,7 @@ # Set variables IMAGE_NAME="bitsandbytes-rocm-build:6.1.2" CONTAINER_NAME="bitsandbytes-rocm-build" -FILE_IN_CONTAINER="/tmp/bitsandbytes" +FILE_IN_CONTAINER="/tmp/bitsandbytes/dist/" FILE_ON_HOST="./build_output/" # Run the Docker container @@ -28,4 +28,4 @@ fi docker stop $CONTAINER_NAME docker rm $CONTAINER_NAME -echo "Now you can install bitsandbytes locally using \"pip install .\" in the build_output/bitsandbytes folder" \ No newline at end of file +echo "Now you can install bitsandbytes locally using \"pip install\" with the file in the build_output/ folder"