Skip to content

Commit 776a36b

Browse files
Update Dockerfile to reflect how to compile bnb from source (huggingface#1437)
* Update Dockerfile * Update Dockerfile * Update build_docker_images.yml * Update build_docker_images.yml * Update Dockerfile * Update Dockerfile * add cmake to dockerfile * use pip install instead * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * final fix * Update .github/workflows/build_docker_images.yml
1 parent a6dda2c commit 776a36b

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

docker/peft-gpu-bnb-latest/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN chsh -s /bin/bash
3131
SHELL ["/bin/bash", "-c"]
3232

3333
# Stage 2
34-
FROM nvidia/cuda:12.2.2-devel-ubuntu22.04 AS build-image
34+
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 AS build-image
3535
COPY --from=compile-image /opt/conda /opt/conda
3636
ENV PATH /opt/conda/bin:$PATH
3737

@@ -40,7 +40,7 @@ SHELL ["/bin/bash", "-c"]
4040

4141
# Install apt libs
4242
RUN apt-get update && \
43-
apt-get install -y curl git wget && \
43+
apt-get install -y curl git wget cmake && \
4444
apt-get clean && \
4545
rm -rf /var/lib/apt/lists*
4646

@@ -57,8 +57,9 @@ RUN source activate peft && \
5757
optimum \
5858
auto-gptq && \
5959
git clone https://github.com/TimDettmers/bitsandbytes && cd bitsandbytes && \
60-
CUDA_VERSION=121 make cuda12x && \
61-
python setup.py develop && \
60+
cmake -B . -DCOMPUTE_BACKEND=cuda -S . && \
61+
cmake --build . && \
62+
pip install -e . && \
6263
pip freeze | grep bitsandbytes
6364

6465
RUN echo "source activate peft" >> ~/.profile

docker/peft-gpu-bnb-source/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN chsh -s /bin/bash
3131
SHELL ["/bin/bash", "-c"]
3232

3333
# Stage 2
34-
FROM nvidia/cuda:12.2.2-devel-ubuntu22.04 AS build-image
34+
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 AS build-image
3535
COPY --from=compile-image /opt/conda /opt/conda
3636
ENV PATH /opt/conda/bin:$PATH
3737

@@ -40,7 +40,7 @@ SHELL ["/bin/bash", "-c"]
4040

4141
# Install apt libs
4242
RUN apt-get update && \
43-
apt-get install -y curl git wget && \
43+
apt-get install -y curl git wget cmake && \
4444
apt-get clean && \
4545
rm -rf /var/lib/apt/lists*
4646

@@ -57,8 +57,9 @@ RUN source activate peft && \
5757
optimum \
5858
auto-gptq && \
5959
git clone https://github.com/TimDettmers/bitsandbytes && cd bitsandbytes && \
60-
CUDA_VERSION=121 make cuda12x && \
61-
python setup.py develop && \
60+
cmake -B . -DCOMPUTE_BACKEND=cuda -S . && \
61+
cmake --build . && \
62+
pip install -e . && \
6263
pip freeze | grep bitsandbytes
6364

6465
RUN echo "source activate peft" >> ~/.profile

0 commit comments

Comments
 (0)