recipe.toml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # GLM-5.3-Flash + DFlash2 draft (MXFP8) — speculative decoding — 2× Spark TP=2
  2. #
  3. # DFlash2-MXFP8 (local-inference-lab) is a ~1B BLOCK-DIFFUSION DRAFT model,
  4. # NOT a standalone LLM. It is loaded beside the TARGET
  5. # `local-inference-lab/GLM-5.3-Flash-NVFP4` (the lab quant) and every drafted
  6. # token is verified against it. Draft: 5 sliding-attention layers, block_size
  7. # 8, proposal length 7, reads target hidden states at layers 5/14/24/33/42.
  8. # Model card: https://huggingface.co/local-inference-lab/GLM-5.3-Flash-DFlash2-MXFP8
  9. #
  10. # DRAFT LICENSE: source incoai/GLM-5.3-Flash-DFlash2 is CC BY-NC-ND 4.0
  11. # (non-commercial, no derivatives) — this image is a quantization of it; the
  12. # MXFP8 conversion itself is the "qualified" upstream artifact. Keep to
  13. # personal/non-commercial use.
  14. #
  15. # WHY THIS IMAGE: the card's qualified image (voipmonitor/vllm, TP=4 B12X on
  16. # 4× RTX PRO 6000) is amd64-only and its B12X attention/moe/linear/allreduce
  17. # backends do not exist on GB10. Neither DFlash2DraftModel nor the DFlash2
  18. # serialized-MXFP8 projection path was in our day-0 base. So we PORTED the
  19. # three DFlash2 source files from local-inference-lab/vllm
  20. # dev/jovian-judgement @ da4d7be6 (Apache-2.0, see docker-images/.../UPSTREAM.md)
  21. # onto our proven lab image → glm53-flash-dflash2:local. The day-0 base
  22. # already shipped W4A16_NVFP4 / MIXED_PRECISION / ModelOptMxFp8LinearMethod /
  23. # the dflash proposer, so the whole port is those 3 files + 1 registry line.
  24. #
  25. # DEVIATIONS from the card's qualified config (forced by hardware):
  26. # * TP=4 → TP=2; no B12X attention/moe/linear/allreduce (fall back to the
  27. # lab image's proven SM121 backends).
  28. # * --enforce-eager ON: CUDA-graph+spec-decode quality regression is
  29. # build-specific to this day-0 base (our 2026-08-28 A/B: graphs+MTP
  30. # 89 vs eager 92). Card runs CUDAGRAPH_MODE=FULL on a newer build.
  31. # * TP=2 keeps draft KV in BF16 (auto), same as the card's config.
  32. # Adopted verbatim from the card: --speculative-config {method:dflash,
  33. # model:...DFlash2-MXFP8, num_speculative_tokens:7, kv_cache_dtype:auto}.
  34. #
  35. # Boot markers: target loads as in glm53-flash-nvfp4-lab (92.72 GiB/node) →
  36. # a "DFlash2" speculator/drafter line in the spec-decode init → "Application
  37. # startup complete". A "DFlash2DraftModel not in registry" error means the
  38. # image overlay didn't apply (rebuild glm53-flash-dflash2:local). Verify the
  39. # DFlash proposal acceptance rate is > the lab MTP-3 baseline (that's the
  40. # whole point of DFlash2); if accuracy looks off, this recipe is the eager
  41. # control.
  42. #
  43. # PREREQUISITES: BOTH models cached on both nodes:
  44. # hf download local-inference-lab/GLM-5.3-Flash-NVFP4
  45. # hf download local-inference-lab/GLM-5.3-Flash-DFlash2-MXFP8
  46. engine = "vllm"
  47. name = "GLM-5.3-Flash + DFlash2 draft (vLLM, 2x Spark, spec-k7)"
  48. docker_image = "glm53-flash-dflash2:local"
  49. docker_image_dir = "glm53-flash-dflash2"
  50. # TARGET model — the DFlash2 draft model is referenced only via
  51. # --speculative-config below, never as the top-level model.
  52. model = "local-inference-lab/GLM-5.3-Flash-NVFP4"
  53. required_nodes = 2
  54. tensor_parallel_size = 2
  55. pipeline_parallel_size = 1
  56. distributed_backend = "mp"
  57. shm_size = "32gb"
  58. args = [
  59. # Stable served name — quant-agnostic (shared across glm53 quants)
  60. "--served-model-name", "glm53",
  61. "--trust-remote-code",
  62. "--distributed-executor-backend", "mp",
  63. "--gpu-memory-utilization", "0.90",
  64. # Pinned 10 GiB KV; the draft adds 5 small sliding-window layers on top
  65. "--kv-cache-memory-bytes", "10737418240",
  66. "--kv-cache-dtype", "fp8_ds_mla",
  67. "--block-size", "256",
  68. "--max-model-len", "262144",
  69. "--max-num-seqs", "8",
  70. "--max-num-batched-tokens", "4096",
  71. "--enable-chunked-prefill",
  72. "--async-scheduling",
  73. "--enable-prefix-caching",
  74. "--disable-custom-all-reduce",
  75. # DFlash2 draft from local-inference-lab/GLM-5.3-Flash-DFlash2-MXFP8
  76. # (block-diffusion drafter, proposal length 7 — verbatim from the card)
  77. "--speculative-config", """
  78. '{"method":"dflash","model":"local-inference-lab/GLM-5.3-Flash-DFlash2-MXFP8","num_speculative_tokens":7,"kv_cache_dtype":"auto"}'""",
  79. "--language-model-only",
  80. # See header: eager is the safe control on the day-0 base (graphs+spec
  81. # quality regression). The card's newer build runs FULL graphs.
  82. "--enforce-eager",
  83. "--tool-call-parser", "glm47",
  84. "--enable-auto-tool-choice",
  85. "--reasoning-parser", "glm45",
  86. ]
  87. [env]
  88. HF_HUB_OFFLINE = "1"
  89. VLLM_MLA_NOPE_PAD_ROPE = "1"
  90. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  91. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  92. VLLM_USE_AOT_COMPILE = "0"
  93. TORCH_USE_RTLD_GLOBAL = "1"
  94. VLLM_NO_USAGE_STATS = "1"
  95. # Architecture (aarch64 / sm_121a DGX Spark)
  96. TORCH_CUDA_ARCH_LIST = "12.1a"
  97. FLASHINFER_CUDA_ARCH_LIST = "12.1f"
  98. CUTE_DSL_ARCH = "sm_121a"
  99. CMAKE_CUDA_ARCHITECTURES = "121"
  100. OMP_NUM_THREADS = "4"