Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
- scikit-build -> scikit-build-core
- Remove -DGGML_BLAS=ON, OpenBLAS cmake tags from build
  - Needed (see ggerganov/llama.cpp#5780 (review)) to get this to work properly
- Built, deployed, and tested with llama3.1 with q4_0_4_4 quantization
  • Loading branch information
tc-wolf committed Sep 10, 2024
1 parent b196925 commit da9f15a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV HOST=0.0.0.0

# Install the package
RUN apt update && apt install -y ninja-build build-essential pkg-config python3 python3-pip git
RUN python3 -m pip install --upgrade pip cmake scikit-build setuptools pyinstaller
RUN python3 -m pip install --upgrade pip cmake scikit-build-core[pyproject] setuptools pyinstaller

COPY . .

Expand All @@ -19,7 +19,10 @@ ENV mtune=cortex-a78c

ENV compiler_flags="-march=${march} -mcpu=${mcpu} -mtune=${mtune}"

RUN PKG_CONFIG_PATH="/opt/OpenBLAS/install/lib/pkgconfig" CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DGGML_LLAMAFILE=OFF -DCMAKE_C_FLAGS='${compiler_flags}' -DCMAKE_CXX_FLAGS='${compiler_flags}'" pip install -v -e .[server] 2>&1 | tee buildlog.txt
# This is the build that uses OpenBLAS + LLAMAFILE
# RUN PKG_CONFIG_PATH="/opt/OpenBLAS/install/lib/pkgconfig" CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DGGML_LLAMAFILE=ON -DCMAKE_C_FLAGS='${compiler_flags}' -DCMAKE_CXX_FLAGS='${compiler_flags}'" pip install -v -e .[server] 2>&1 | tee buildlog.txt
# This is a release build that works
RUN CMAKE_ARGS="-DGGML_LLAMAFILE=OFF -DCMAKE_C_FLAGS='${compiler_flags}' -DCMAKE_CXX_FLAGS='${compiler_flags}' -DCMAKE_BUILD_TYPE=Release" pip install -v -e .[server] 2>&1 | tee buildlog.txt

RUN cd /root && pyinstaller -DF /llama_cpp/server/__main__.py \
--add-data /usr/lib/libopenblas.so:. \
Expand Down

0 comments on commit da9f15a

Please sign in to comment.