SamilG2 commited on
Commit
3670f55
·
1 Parent(s): cd159ce

fix: wheel CUDA precompilado (--only-binary) en base runtime, sin compilar

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -14
Dockerfile CHANGED
@@ -1,16 +1,15 @@
1
- # Imagen base CUDA 12.1 *devel*: trae nvcc + compilador para construir
2
- # llama-cpp-python CON soporte GPU (no existe wheel precompilado cu121 para
3
- # Python 3.10, así que hay que compilar desde fuente).
4
- FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
5
 
6
  ENV DEBIAN_FRONTEND=noninteractive
7
 
8
- # Python + Stockfish + libs de OpenCV + toolchain de compilación
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
- python3 python3-pip python3-dev \
11
  stockfish \
12
  libgl1 libglib2.0-0 \
13
- build-essential cmake git \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  WORKDIR /app
@@ -26,13 +25,12 @@ RUN pip3 install --no-cache-dir --upgrade pip \
26
  RUN pip3 install --no-cache-dir torch torchvision \
27
  --index-url https://download.pytorch.org/whl/cu121
28
 
29
- # llama-cpp-python COMPILADO desde fuente con CUDA (arch 75 = Tesla T4).
30
- # CMAKE_BUILD_PARALLEL_LEVEL=1 → un solo nvcc a la vez. Los kernels mmq/fattn son
31
- # muy pesados en RAM; con 2 en paralelo el builder de HF moría por OOM. Más lento
32
- # pero a prueba de OOM.
33
- RUN CMAKE_ARGS="-DGGML_CUDA=on -DCMAKE_CUDA_ARCHITECTURES=75" \
34
- CMAKE_BUILD_PARALLEL_LEVEL=1 FORCE_CMAKE=1 \
35
- pip3 install --no-cache-dir llama-cpp-python==0.3.2
36
 
37
  # Resto de dependencias de la app
38
  RUN pip3 install --no-cache-dir -r requirements.txt
 
1
+ # Imagen base CUDA 12.1 *runtime*: trae las libs CUDA para que el wheel
2
+ # precompilado de llama-cpp-python offloadee a la T4. NO compilamos (compilar
3
+ # en el builder de HF muere por OOM); usamos wheel ya hecho del indice cu121.
4
+ FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
5
 
6
  ENV DEBIAN_FRONTEND=noninteractive
7
 
8
+ # Python + Stockfish + libs de OpenCV (sin toolchain: no compilamos nada)
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ python3 python3-pip \
11
  stockfish \
12
  libgl1 libglib2.0-0 \
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
  WORKDIR /app
 
25
  RUN pip3 install --no-cache-dir torch torchvision \
26
  --index-url https://download.pytorch.org/whl/cu121
27
 
28
+ # llama-cpp-python: SOLO wheel precompilado con CUDA (--only-binary). Sin fijar
29
+ # version → toma la más nueva que tenga wheel cu121 para py3.10. Si no hay wheel,
30
+ # falla en SEGUNDOS (no intenta compilar 25 min). La API que usa qwen.py es estable.
31
+ RUN pip3 install --no-cache-dir --only-binary llama-cpp-python \
32
+ llama-cpp-python \
33
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
 
34
 
35
  # Resto de dependencias de la app
36
  RUN pip3 install --no-cache-dir -r requirements.txt