update bitsandbytes build system

This commit is contained in:
Mathieu Broillet 2024-06-30 22:19:28 +02:00
parent 00ca459ba4
commit 2471c3de53
Signed by: mathieu
GPG Key ID: A08E484FE95074C1
4 changed files with 21 additions and 4 deletions

View File

@ -27,6 +27,7 @@ RUN pip3 install -r requirements-dev.txt
## Build ## Build
RUN cmake -DCOMPUTE_BACKEND=hip -S . -DBNB_ROCM_ARCH=${ROCM_ARCH} RUN cmake -DCOMPUTE_BACKEND=hip -S . -DBNB_ROCM_ARCH=${ROCM_ARCH}
RUN make RUN make
RUN python3 setup.py bdist_wheel --universal
# Cleanup # Cleanup
RUN apt-get clean && pip3 cache purge RUN apt-get clean && pip3 cache purge

View File

@ -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.

2
bitsandbytes-rocm-build/build.sh Normal file → Executable file
View File

@ -1 +1 @@
docker build . -t 'bitsandbytes-rocm-build:6.1.2' -f Dockerfile docker build . -t 'bitsandbytes-rocm-build:6.1.2' -f Dockerfile

View File

@ -3,7 +3,7 @@
# Set variables # Set variables
IMAGE_NAME="bitsandbytes-rocm-build:6.1.2" IMAGE_NAME="bitsandbytes-rocm-build:6.1.2"
CONTAINER_NAME="bitsandbytes-rocm-build" CONTAINER_NAME="bitsandbytes-rocm-build"
FILE_IN_CONTAINER="/tmp/bitsandbytes" FILE_IN_CONTAINER="/tmp/bitsandbytes/dist/"
FILE_ON_HOST="./build_output/" FILE_ON_HOST="./build_output/"
# Run the Docker container # Run the Docker container
@ -28,4 +28,4 @@ fi
docker stop $CONTAINER_NAME docker stop $CONTAINER_NAME
docker rm $CONTAINER_NAME docker rm $CONTAINER_NAME
echo "Now you can install bitsandbytes locally using \"pip install .\" in the build_output/bitsandbytes folder" echo "Now you can install bitsandbytes locally using \"pip install\" with the file in the build_output/ folder"