-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (40 loc) · 1.7 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (40 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# vllm-i64 :: Docker image
# Integer-first inference for token-routed models
#
# Build: docker build -t vllm-i64 .
# Run: docker run --gpus all -p 8000:8000 vllm-i64 serve tr-moe-306
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 python3.11-dev python3-pip cmake ninja-build git \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
RUN python3 -m pip install --upgrade pip setuptools wheel
WORKDIR /build
COPY . .
# Install PyTorch (CUDA 12.4)
RUN pip install torch --index-url https://download.pytorch.org/whl/cu124
# Build CUDA kernels
RUN mkdir -p build && cd build && \
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release && \
ninja
# Install vllm-i64
RUN pip install -e ".[dev]"
# =========================================================================
# Runtime image
# =========================================================================
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
WORKDIR /app
# Copy installed packages and built kernels
COPY --from=builder /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=builder /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
COPY --from=builder /build /app
ENV PYTHONPATH=/app
EXPOSE 8000
ENTRYPOINT ["python3", "-m", "vllm_i64.cli"]
CMD ["serve", "tr-moe-306", "--port", "8000", "--quantization", "none"]