| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| FROM nvidia/cuda:12.9.0-cudnn-devel-ubuntu24.04 AS builder |
|
|
| ENV DEBIAN_FRONTEND=noninteractive \ |
| PIP_NO_INPUT=1 \ |
| PIP_DISABLE_PIP_VERSION_CHECK=1 \ |
| PYTHONUNBUFFERED=1 \ |
| PYTHONDONTWRITEBYTECODE=1 \ |
| TORCH_CUDA_ARCH_LIST=12.0a \ |
| CUDA_ARCH_LIST=120a |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3.12 python3.12-dev python3.12-venv python3-pip \ |
| git curl ca-certificates build-essential ninja-build \ |
| libnuma-dev \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| RUN python3.12 -m venv /opt/venv \ |
| && /opt/venv/bin/pip install --upgrade pip wheel setuptools |
| ENV PATH=/opt/venv/bin:$PATH |
|
|
| |
| |
| |
| RUN pip install --no-cache-dir \ |
| "torch==2.11.0+cu128" \ |
| "torchvision==0.26.0+cu128" \ |
| "torchaudio==2.11.0+cu128" \ |
| --index-url https://download.pytorch.org/whl/cu128 |
|
|
| RUN pip install --no-cache-dir \ |
| "transformers==5.8.0" \ |
| "compressed-tensors==0.15.0.1" \ |
| "safetensors>=0.7" \ |
| "huggingface_hub>=1.14" \ |
| hf_transfer |
|
|
| |
| |
| |
| |
| |
| |
| |
| WORKDIR /src |
| RUN git init -q vllm \ |
| && cd vllm \ |
| && git config user.email "build@dsv4" \ |
| && git config user.name "dsv4 builder" \ |
| && git fetch --depth 1 https://github.com/jasl/vllm.git abad5dc712b15b7062c699a97fb64d7508ed31fd \ |
| && git checkout FETCH_HEAD |
|
|
| COPY kyle-ct-quant.patch /src/kyle-ct-quant.patch |
| RUN cd /src/vllm \ |
| && git apply --index /src/kyle-ct-quant.patch \ |
| && rm /src/kyle-ct-quant.patch |
|
|
| |
| |
| |
| RUN curl -fsSL https://raw.githubusercontent.com/pasta-paul/dsv4-flash-w4a16-fp8/main/scripts/patch_v4_packed_mapping.py \ |
| -o /tmp/patch_v4_packed_mapping.py \ |
| && python /tmp/patch_v4_packed_mapping.py /src/vllm/vllm/model_executor/models/deepseek_v4.py \ |
| && rm /tmp/patch_v4_packed_mapping.py |
|
|
| |
| COPY apply_mtp_patches.py /tmp/apply_mtp_patches.py |
| RUN python /tmp/apply_mtp_patches.py /src/vllm/vllm/model_executor/models/deepseek_v4_mtp.py \ |
| && rm /tmp/apply_mtp_patches.py |
|
|
| |
| WORKDIR /src/vllm |
| ENV CC=/usr/bin/gcc CXX=/usr/bin/g++ CUDAHOSTCXX=/usr/bin/g++ \ |
| NVCC_PREPEND_FLAGS="-ccbin /usr/bin/g++" |
| RUN pip install --no-cache-dir -e . |
|
|
| |
| RUN python -c "import vllm; print('vllm', vllm.__version__)" \ |
| && python -c "from vllm.model_executor.models.deepseek_v4 import DeepseekV4ForCausalLM; print('DSV4 import OK')" \ |
| && python -c "from vllm.model_executor.models.deepseek_v4_mtp import DeepSeekV4MTP; print('DSV4 MTP import OK')" |
|
|
|
|
| |
| |
| |
| |
| FROM nvidia/cuda:12.9.0-cudnn-devel-ubuntu24.04 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive \ |
| PIP_NO_INPUT=1 \ |
| PYTHONUNBUFFERED=1 \ |
| HF_HUB_ENABLE_HF_TRANSFER=1 \ |
| VLLM_USE_FLASHINFER_SAMPLER=0 \ |
| VLLM_ENABLE_DEEPSEEK_V4_SPARSE_MLA_WARMUP=0 \ |
| NCCL_DEBUG=WARN \ |
| NCCL_P2P_DISABLE=1 \ |
| NCCL_SHM_DISABLE=0 \ |
| NCCL_IB_DISABLE=1 \ |
| NCCL_PROTO=LL \ |
| NCCL_ALGO=Ring \ |
| NCCL_MIN_NCHANNELS=8 \ |
| NCCL_NTHREADS=512 |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3.12 python3.12-dev python3.12-venv \ |
| curl ca-certificates libnuma1 \ |
| gcc g++ build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
| |
| |
| |
|
|
| ENV CC=/usr/bin/gcc CXX=/usr/bin/g++ |
|
|
| |
| COPY --from=builder /opt/venv /opt/venv |
| COPY --from=builder /src/vllm /src/vllm |
| ENV PATH=/opt/venv/bin:$PATH |
|
|
| |
| ENV MODEL_PATH=/models/DeepSeek-V4-Flash-Acti-MTP-W4A16-FP8 \ |
| TENSOR_PARALLEL_SIZE=2 \ |
| MAX_MODEL_LEN=524288 \ |
| MAX_NUM_SEQS=2 \ |
| MAX_NUM_BATCHED_TOKENS=8192 \ |
| GPU_MEMORY_UTILIZATION=0.93 \ |
| BLOCK_SIZE=256 \ |
| HOST=0.0.0.0 \ |
| PORT=8000 \ |
| DISABLE_CUSTOM_ALL_REDUCE=1 \ |
| ENABLE_MTP=1 |
|
|
| COPY entrypoint.sh /entrypoint.sh |
| RUN chmod +x /entrypoint.sh |
|
|
| EXPOSE 8000 |
| ENTRYPOINT ["/entrypoint.sh"] |
|
|