Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930
  1. # syntax=docker/dockerfile:1.7
  2. # GLM-5.3-Flash NVFP4 (LibertAIDAI weight-only NVFP4-A16) on DGX Spark
  3. # (SM121 / GB10), TP=2.
  4. #
  5. # Base: vllm/vllm-openai:glm53-flash-arm64-cu130 — vLLM's day-0 per-model
  6. # image (arm64/cu130, glm5_next arch support baked in). It CANNOT serve this
  7. # model on GB10 stock: glm5_next's NoPE-MLA (qk_rope_head_dim=0) + KDA linear
  8. # attention + the sparse kpool indexer fail every attention backend the sm_121
  9. # selector offers, and the auto-selected NVFP4 MoE backend silently corrupts
  10. # output (degenerate token loops, zero errors).
  11. # * --moe-backend marlin (runtime, in the recipe) fixes the MoE corruption.
  12. # * The 4-part patch below fixes the MLA.
  13. #
  14. # The patch (patches/patch_mla.py) dresses GLM's NoPE-MLA (kv_lora 512, rope 0)
  15. # in DeepSeek's fp8_ds_mla 512+64 layout and compacts the sm120 sparse-MLA
  16. # topk table from 2176 to the compiled 2048. It is applied at build time;
  17. # runtime activates the NoPE-pad path via VLLM_MLA_NOPE_PAD_ROPE=1 (recipe env).
  18. #
  19. # Provenance + measured numbers (24.74 code / 30.30 structured / 19.58 prose
  20. # tok/s at MTP-5, 2x Spark, 256K needle-exact):
  21. # https://github.com/kingjones30/GLM-5.3-Flash-2x-DGX-Spark
  22. # https://forums.developer.nvidia.com/t/381433
  23. ARG BASE_IMAGE
  24. FROM ${BASE_IMAGE}
  25. COPY patches/patch_mla.py /tmp/patch_mla.py
  26. RUN set -eux; \
  27. python3 /tmp/patch_mla.py; \
  28. rm -f /tmp/patch_mla.py