Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # syntax=docker/dockerfile:1.7
  2. # GLM-5.3-Flash DFlash2 draft-model support for DGX Spark (SM121/GB10), TP=2.
  3. #
  4. # Stacks on glm53-flash-nvfp4-lab:local (day-0 base + NoPE-MLA + lab
  5. # checkpoint patches) and adds DFlash2 draft-model execution ported from
  6. # local-inference-lab/vllm `dev/jovian-judgement` (see UPSTREAM.md):
  7. # * qwen3_dflash.py — refreshed base (fork is a superset of the day-0
  8. # file; identical imports, +DFlash2 wiring incl.
  9. # native MXFP8 serialized projections)
  10. # * qwen3_dflash2.py — the DFlash2DraftModel itself (294 lines)
  11. # * dflash.py — v1 spec-decode proposer (+rope is_neox_style
  12. # handoff from the target, 1 hunk)
  13. # * registry.py — one line: DFlash2DraftModel -> qwen3_dflash2
  14. #
  15. # The day-0 base already ships W4A16_NVFP4, MIXED_PRECISION,
  16. # ModelOptMxFp8LinearMethod, CompressedTensorsW8A8Mxfp8 and the dflash
  17. # proposer — only the DFlash2 model class + registration were missing.
  18. ARG BASE_IMAGE
  19. FROM ${BASE_IMAGE}
  20. COPY qwen3_dflash.py qwen3_dflash2.py dflash.py /tmp/
  21. RUN set -eux; \
  22. B=/usr/local/lib/python3.12/dist-packages/vllm; \
  23. cp /tmp/qwen3_dflash.py /tmp/qwen3_dflash2.py "$B/model_executor/models/"; \
  24. cp /tmp/dflash.py "$B/v1/spec_decode/dflash.py"; \
  25. grep -q '"DFlashDraftModel": ("qwen3_dflash", "DFlashQwen3ForCausalLM"),' \
  26. "$B/model_executor/models/registry.py"; \
  27. sed -i '/"DFlashDraftModel": ("qwen3_dflash", "DFlashQwen3ForCausalLM"),/a\ "DFlash2DraftModel": ("qwen3_dflash2", "DFlash2Qwen3ForCausalLM"),' \
  28. "$B/model_executor/models/registry.py"; \
  29. grep -q '"DFlash2DraftModel"' "$B/model_executor/models/registry.py"; \
  30. python3 -m py_compile \
  31. "$B/model_executor/models/qwen3_dflash.py" \
  32. "$B/model_executor/models/qwen3_dflash2.py" \
  33. "$B/v1/spec_decode/dflash.py" \
  34. "$B/model_executor/models/registry.py"; \
  35. rm -f /tmp/qwen3_dflash.py /tmp/qwen3_dflash2.py /tmp/dflash.py