gfdfg
This commit is contained in:
35
bayarea-ai-server/Dockerfile.cuda
Normal file
35
bayarea-ai-server/Dockerfile.cuda
Normal file
@@ -0,0 +1,35 @@
|
||||
# llama-server für Qwen3.6 Vision — NVIDIA RTX PRO 6000 Blackwell (sm_120)
|
||||
#
|
||||
# WICHTIG:
|
||||
# - Muss aus aktuellem Source gebaut werden: Qwen3.6 nutzt ein neues
|
||||
# Rope-Encoding (rope.dimension_sections 3 statt 4), alte Images/Builds
|
||||
# brechen mit "wrong array length".
|
||||
# - Blackwell braucht CUDA >= 12.8. KEIN CUDA 13.2 verwenden — erzeugt
|
||||
# mit Qwen3.6 Gibberish (bekannter NVIDIA-Bug).
|
||||
|
||||
FROM nvidia/cuda:12.8.1-devel-ubuntu24.04 AS build
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git cmake build-essential libcurl4-openssl-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp /src
|
||||
|
||||
# 120 = Blackwell (RTX PRO 6000). Für andere Karten anpassen.
|
||||
RUN cmake /src -B /build \
|
||||
-DGGML_CUDA=ON \
|
||||
-DCMAKE_CUDA_ARCHITECTURES=120 \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DLLAMA_CURL=ON \
|
||||
&& cmake --build /build --config Release -j --target llama-server
|
||||
|
||||
FROM nvidia/cuda:12.8.1-runtime-ubuntu24.04
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libcurl4 libgomp1 curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=build /build/bin/llama-server /usr/local/bin/llama-server
|
||||
|
||||
EXPOSE 8000
|
||||
ENTRYPOINT ["llama-server"]
|
||||
32
bayarea-ai-server/Dockerfile.vulkan
Normal file
32
bayarea-ai-server/Dockerfile.vulkan
Normal file
@@ -0,0 +1,32 @@
|
||||
# llama-server für Qwen3.6 Vision — AMD Radeon AI Pro R9700, Vulkan-Backend
|
||||
#
|
||||
# Muss aus aktuellem Source gebaut werden (Qwen3.6-Rope-Änderung, s. Dockerfile.cuda).
|
||||
# Vulkan statt ROCm — hat sich bei Vision als stabiler erwiesen.
|
||||
|
||||
FROM ubuntu:24.04 AS build
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git cmake build-essential libcurl4-openssl-dev \
|
||||
libvulkan-dev glslc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp /src
|
||||
|
||||
RUN cmake /src -B /build \
|
||||
-DGGML_VULKAN=ON \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DLLAMA_CURL=ON \
|
||||
&& cmake --build /build --config Release -j --target llama-server
|
||||
|
||||
FROM ubuntu:24.04
|
||||
|
||||
# mesa-vulkan-drivers = RADV-Treiber im Container (GPU via /dev/dri durchgereicht)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libvulkan1 mesa-vulkan-drivers vulkan-tools \
|
||||
libcurl4 libgomp1 curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=build /build/bin/llama-server /usr/local/bin/llama-server
|
||||
|
||||
EXPOSE 8000
|
||||
ENTRYPOINT ["llama-server"]
|
||||
@@ -1,47 +1,140 @@
|
||||
# llama.cpp + Gemma-4-12B (Vision) auf CUDA (AWS G7e / RTX PRO 6000).
|
||||
# llama-server für Qwen3.6 Vision — zwei Profile:
|
||||
# docker compose --profile cuda up -d --build (EC2, RTX PRO 6000 Blackwell)
|
||||
# docker compose --profile vulkan up -d --build (inhouse, Radeon AI Pro R9700)
|
||||
#
|
||||
# Bewusst SCHLANK gehalten: keine ROCm/Vulkan-Workarounds. Wir testen, ob
|
||||
# CUDA die Instabilitaeten von vornherein vermeidet. Nur die inhaltlich noetigen
|
||||
# Flags (--reasoning off gegen leeres content) bleiben.
|
||||
# Modelle nach ./models legen (Haupt-GGUF + zugehöriger mmproj aus demselben Repo!):
|
||||
# CUDA: unsloth/Qwen3.6-27B-GGUF → Qwen3.6-27B-UD-Q4_K_XL.gguf + mmproj-BF16.gguf
|
||||
# Vulkan: unsloth/Qwen3.6-35B-A3B-GGUF → Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf + mmproj-BF16.gguf
|
||||
#
|
||||
# Voraussetzung: DLAMI mit NVIDIA Container Toolkit (docker --gpus all funktioniert).
|
||||
#
|
||||
# Start: docker compose -f docker-compose-cuda.yml up -d
|
||||
# Logs: docker compose -f docker-compose-cuda.yml logs -f
|
||||
# Bewusst KEIN MTP: --mmproj + MTP ist laut Unsloth nicht unterstützt und hat
|
||||
# offene OOM-/Hänger-Bugs (llama.cpp #23371, #23430). Für Batch-Extraktion
|
||||
# irrelevant, da die Zeit im Image-Encoding steckt, nicht in der Generierung.
|
||||
|
||||
services:
|
||||
llamacpp-gemma12b:
|
||||
image: ghcr.io/ggml-org/llama.cpp:server-cuda
|
||||
container_name: llamacpp-gemma12b
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
# GPU-Zugriff ueber das NVIDIA Container Toolkit
|
||||
llama-cuda:
|
||||
profiles: ["cuda"]
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.cuda
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./models:/models
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
count: all
|
||||
capabilities: [gpu]
|
||||
ports:
|
||||
- "8000:8080"
|
||||
volumes:
|
||||
- ~/.cache/llama.cpp:/root/.cache/llama.cpp
|
||||
command:
|
||||
- -hf
|
||||
- unsloth/gemma-4-12b-it-GGUF:UD-Q4_K_XL
|
||||
- -m
|
||||
- /models/Qwen3.6-27B-UD-Q4_K_XL.gguf
|
||||
- --mmproj
|
||||
- /models/mmproj-BF16.gguf
|
||||
- --host
|
||||
- 0.0.0.0
|
||||
- --port
|
||||
- "8080"
|
||||
- "8000"
|
||||
- --alias
|
||||
- qwen3.6
|
||||
- -ngl
|
||||
- "99"
|
||||
- --ctx-size
|
||||
- "16384"
|
||||
- -fa
|
||||
- "on"
|
||||
- -c
|
||||
- "32768"
|
||||
- --parallel
|
||||
- "1"
|
||||
- --jinja
|
||||
- --reasoning
|
||||
- "off"
|
||||
# Erlernte Stabilitäts-Settings (Vision + Checkpoints = OOM-Bug):
|
||||
- --ctx-checkpoints
|
||||
- "0"
|
||||
# Qwen-VL braucht min. 1024 Image-Tokens für korrektes Grounding:
|
||||
- --image-min-tokens
|
||||
- "1024"
|
||||
- --image-max-tokens
|
||||
- "4096"
|
||||
# Extraktion: niedrige Temperatur, kein Repeat-Penalty
|
||||
- --temp
|
||||
- "0.1"
|
||||
- --top-p
|
||||
- "0.95"
|
||||
- --top-k
|
||||
- "20"
|
||||
- --repeat-penalty
|
||||
- "1.0"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 40
|
||||
start_period: 60s
|
||||
restart: unless-stopped
|
||||
|
||||
llama-vulkan:
|
||||
profiles: ["vulkan"]
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.vulkan
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./models:/models
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
- /dev/kfd:/dev/kfd
|
||||
group_add:
|
||||
- video
|
||||
- render
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
command:
|
||||
- -m
|
||||
- /models/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf
|
||||
- --mmproj
|
||||
- /models/mmproj-BF16.gguf
|
||||
- --host
|
||||
- 0.0.0.0
|
||||
- --port
|
||||
- "8000"
|
||||
- --alias
|
||||
- gemma-4-12b
|
||||
- qwen3.6
|
||||
- -ngl
|
||||
- "99"
|
||||
- -fa
|
||||
- "on"
|
||||
- -c
|
||||
- "32768"
|
||||
- --parallel
|
||||
- "1"
|
||||
# KV-Cache quantisieren — 32GB VRAM, 35B-A3B + mmproj + Bildkontext:
|
||||
- -ctk
|
||||
- q8_0
|
||||
- -ctv
|
||||
- q8_0
|
||||
- --jinja
|
||||
- --ctx-checkpoints
|
||||
- "0"
|
||||
- --image-min-tokens
|
||||
- "1024"
|
||||
- --image-max-tokens
|
||||
- "4096"
|
||||
- --temp
|
||||
- "0.1"
|
||||
- --top-p
|
||||
- "0.95"
|
||||
- --top-k
|
||||
- "20"
|
||||
- --repeat-penalty
|
||||
- "1.0"
|
||||
# NOTFALL-Fallback bei Vision-Hängern/OOM unter RADV — mmproj auf CPU,
|
||||
# Bildverarbeitung wird DEUTLICH langsamer. Nur aktivieren wenn nötig:
|
||||
# - --no-mmproj-offload
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 40
|
||||
start_period: 120s
|
||||
restart: unless-stopped
|
||||
Reference in New Issue
Block a user