SeaWolf-AI commited on
Commit
6444aa4
·
verified ·
1 Parent(s): 87e88c2

use prebuilt llama.cpp release b10091 (qwen35moe, runtime CPU dispatch) - no compile (no OOM), no -march=native (no SIGILL)

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -13
Dockerfile CHANGED
@@ -1,20 +1,22 @@
1
  FROM python:3.11-slim
2
 
 
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
4
- build-essential cmake git curl ca-certificates && rm -rf /var/lib/apt/lists/*
5
 
6
- # Build llama.cpp from upstream master it registers the qwen35moe architecture
7
- # (hybrid GatedDeltaNet/SSM + MoE + MTP) that POCKET uses. Released llama-cpp-python
8
- # wheels are too old to load it. Portable CPU build: no -march=native / AVX512, so it
9
- # never SIGILLs (exit 132) when the runtime CPU differs from the build machine.
10
- RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp /opt/llama.cpp && \
11
- cmake -S /opt/llama.cpp -B /opt/llama.cpp/build \
12
- -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF \
13
- -DGGML_AVX2=ON -DGGML_FMA=ON -DGGML_F16C=ON -DGGML_AVX512=OFF \
14
- -DGGML_CUDA=OFF -DLLAMA_CURL=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BUILD_TESTS=OFF && \
15
- cmake --build /opt/llama.cpp/build --config Release -j 2 --target llama-server && \
16
- cp /opt/llama.cpp/build/bin/llama-server /usr/local/bin/llama-server && \
17
- rm -rf /opt/llama.cpp
 
18
 
19
  WORKDIR /app
20
  COPY requirements.txt .
 
1
  FROM python:3.11-slim
2
 
3
+ # curl brings libcurl (llama-server links it); libgomp1 for OpenMP.
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ curl ca-certificates libgomp1 && rm -rf /var/lib/apt/lists/*
6
 
7
+ # Prebuilt llama.cpp (CPU x64). A recent build (b10091) that registers the qwen35moe
8
+ # architecture POCKET uses. It ships runtime CPU-feature dispatch (libggml-cpu-*.so
9
+ # variants), so it's portable no SIGILL (exit 132) and needs no source compile,
10
+ # so there is no OOM (exit 137) during the build.
11
+ ARG LLAMA_TAG=b10091
12
+ RUN curl -fsSL -o /tmp/llama.tgz \
13
+ "https://github.com/ggml-org/llama.cpp/releases/download/${LLAMA_TAG}/llama-${LLAMA_TAG}-bin-ubuntu-x64.tar.gz" && \
14
+ mkdir -p /opt/llama && tar xzf /tmp/llama.tgz -C /opt/llama && rm /tmp/llama.tgz && \
15
+ ln -s "/opt/llama/llama-${LLAMA_TAG}" /opt/llama/bin && \
16
+ /opt/llama/bin/llama-server --version 2>&1 | head -3 || true
17
+
18
+ ENV LD_LIBRARY_PATH=/opt/llama/bin \
19
+ PATH="/opt/llama/bin:${PATH}"
20
 
21
  WORKDIR /app
22
  COPY requirements.txt .