recipe.toml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. # GLM-5.3-Flash r35 + DFlash2 K7 draft — A/B vs the r35 MTP3 prod recipe.
  2. #
  3. # Clone of recipes/glm53-flash-r35-4x-dcp4 with ONLY the speculative-config
  4. # swapped: MTP3 -> DFlash2 (lab's block-diffusion ~1B draft, offline MXFP8,
  5. # on the shared NAS from the 2026-08-28 port work). Same image
  6. # (jovian-judgement:r35-glm53, checksum 8bb87348 — DFlash2 machinery is in-tree),
  7. # same 4x DCP4 shape, same KV/scheduler pins. Night-shift A/B: stop the MTP3
  8. # prod, serve this, bench (dev65, seed 42, hardmode, c1/c2) vs the 163/176
  9. # r35 anchor, decide, restore.
  10. #
  11. # R35 is lab-qualified for DFlash2 at TP4/DCP1 AND TP4/DCP4 (RTX quartet;
  12. # C1/C8, cold 32K prefill). GB10 is our own claim: the 08-29 2x blocker
  13. # (draft-KV page unification on the day-0 base) is void here — the r35 tree
  14. # has the dedicated dflash_attn backend + b12x built for GB10.
  15. engine = "vllm"
  16. name = "GLM-5.3-Flash NVFP4 (r35 img, lab ckpt, 4x DCP4, DFlash2 K7)"
  17. docker_image = "jovian-judgement:r35-glm53" # full r35 lock (build_profile) over the jovian-judgement image tree
  18. docker_image_dir = "jovian-judgement"
  19. # NOTE: build_profile must stay a TOP-LEVEL key — a bare key after
  20. # [[extra_mounts]] would parse into the last mount table and be silently
  21. # ignored (2026-09-08).
  22. # FULL r28 source lock (2026-09-06 cut, all three forks): the named version
  23. # profile docker-images/jovian-judgement/profiles/r28.env — vLLM
  24. # 62f6385c + b12x 7216f6b9 (21 commits over r27: GLM/DeepSeek loader fixes,
  25. # MoE perf) + LMCache 934c287a (3 MP-transfer fixes). Merged over the image
  26. # dir's versions.env and folded into the build checksum, so this is a
  27. # distinct image (tag jovian-judgement:r28-glm53) sharing the r27 build tree.
  28. # Clone-at-pin fetches each commit directly; the Dockerfile gates HEAD + tree
  29. # hash per repo. Both r28 branches are strictly ahead of their r27/r26 pins
  30. # (0 behind) — a clean superset. The r28 vLLM tree has NO requirements/cmake
  31. # changes vs r27 (verified via the GitHub compare API, 13 commits / 29 files),
  32. # so the fetch-deps.sh dep gates still hold.
  33. build_profile = "r35"
  34. # Required: the clean r12 image follows the solar contract (ENTRYPOINT []
  35. # + CMD bash), so the recipe carries the entrypoint (the old day-0-based
  36. # r12 image had ["vllm","serve"] baked in, which is why this was absent
  37. # until the clean rebuild).
  38. entrypoint = ["vllm", "serve"]
  39. model = "local-inference-lab/GLM-5.3-Flash-NVFP4"
  40. parent_model = "zai-org/GLM-5.3-Flash"
  41. required_nodes = 4
  42. tensor_parallel_size = 4
  43. pipeline_parallel_size = 1
  44. distributed_backend = "mp"
  45. shm_size = "32gb"
  46. args = [
  47. # R31 delta (their r28.1-r31 locks): adaptive prefill/decode
  48. # compute-time sharing with a fixed 40% prefill floor.
  49. "--prefill-compute-share", "0.4",
  50. # Stable served name — quant-agnostic (shared across glm53 quants)
  51. "--served-model-name", "glm53",
  52. "--trust-remote-code",
  53. "--distributed-executor-backend", "mp",
  54. # GMU is ONLY a startup guardrail here (KV pool is pinned below): 0.90
  55. # demands 109.46 GiB free on GB10's 121.63 GiB, but driver reserve +
  56. # page cache routinely leave ~108.5 -> flaky
  57. # "Free memory ... less than desired" boot deaths (this was the class
  58. # of the old "54-second death"), and post-crash reruns see ~106.6 GiB.
  59. # 0.82 = 99.7 GiB, below any realistic dip; does NOT change what gets
  60. # allocated (weights ~93 + pinned KV 10 + activations).
  61. # 0.88 (not 0.90): the startup admission gate is free-mem >= GMU*total
  62. # (107.0 vs 109.5 GiB); ~12 GiB of starting vLLM processes + docker
  63. # daemon can push the 0.90 check under the line (2026-09-08, #48140).
  64. # KV is explicitly pinned (--kv-cache-memory-bytes) so capacity is unchanged.
  65. "--gpu-memory-utilization", "0.88",
  66. # Pinned 10 GiB KV (≈1.16M tokens) — GMU sizing has no headroom at
  67. # 92.72 GiB weights/node; pinning also keeps warmup off the swap path
  68. "--kv-cache-memory-bytes", "17179869184", # 16 GiB: 4x NVFP4 has the headroom (47.1 GiB weights/node vs 108 usable); 2x stays 10
  69. "--decode-context-parallel-size", "4",
  70. "--cp-kv-cache-interleave-size", "4",
  71. # No --kv-cache-dtype: let the r12 fork pick its default (the explicit
  72. # fp8 / fp8_ds_mla both failed auto-selection on this build).
  73. # The GLM5Next model wires the B12X sparse-MLA backend (sm_120/sm_121)
  74. # when the global backend is B12X (glm5next/nvidia/attention.py:
  75. # _select_sparse_backend); the sm12x auto-priority list never offers it
  76. # (FLASHINFER_MLA_SPARSE_SM120 only supports head 576, not GLM's 512).
  77. "--attention-backend", "B12X",
  78. # pure I/O loader (kept across every config; 171 GB in ~5.5 min vs ~16 NFS)
  79. "--load-format", "instanttensor",
  80. # [R17 FULL-CLUSTER TEST] lil manifest backends (quality gate: hardmode
  81. # must stay ≥88; r12-era this cluster dropped it to 74 — r17 may carry
  82. # the fix through — one boot decides).
  83. "--block-size", "256",
  84. # FINAL BISECT (2026-09-03, hardmode 176pt, r17 img):
  85. # knobs-only 87: d0 c1 24.1, d8192 23.8
  86. # +moe b12x 88: d0 c1 23.5, d8192 26.6 <- SHIP (2 pts d8192)
  87. # +linear b12x 44: W4A4 linear kernel destroys numerics (param-precision 0%)
  88. # +align 88: but d0 c1 18.6 (-5) — perf-negative, dropped
  89. # (all three together = 44-74; the lab needs its private packed package)
  90. "--max-model-len", "524288",
  91. "--max-num-seqs", "16",
  92. "--max-num-batched-tokens", "4096",
  93. "--enable-chunked-prefill",
  94. "--async-scheduling",
  95. "--enable-prefix-caching",
  96. # NO --disable-custom-all-reduce here: in the r27 fork the RoCEnante
  97. # adapter is gated on the custom-all-reduce enable flag
  98. # (use_roce_allreduce = use_custom_allreduce && VLLM_ENABLE_ROCE_ALLREDUCE).
  99. # On 2x/4x 1-GPU-node clusters vLLM's own CUDA-IPC custom AR is functionally
  100. # inert (no cross-node P2P), so dropping the flag only opens the b12x path;
  101. # the b12x-PCIe branch stays off (VLLM_ENABLE_PCIE_ALLREDUCE defaults False).
  102. # Their proven boot: no flashinfer autotune, no CuTe-DSL warmup
  103. "--kernel-config", """
  104. '{"enable_cutedsl_warmup":false,"enable_flashinfer_autotune":false}'""",
  105. # DFlash2 A/B: lab-qualified DFlash2 K7 draft (block-diffusion, ~1B,
  106. # offline MXFP8 — local-inference-lab/GLM-5.3-Flash-DFlash2-MXFP8,
  107. # already on the shared NAS). Everything else is byte-identical to the
  108. # r35 MTP3 prod recipe, so the bench delta isolates the speculator.
  109. # R35 tree ships the DFlash2 machinery natively (dflash proposer,
  110. # DFlash2DraftModel, dedicated dflash_attn graph-safe split-KV
  111. # backend); K7 is lab-qualified at TP4/DCP1 and TP4/DCP4 (RTX quartet).
  112. # Draft attention: left to the tree default (the r35 wrapper maps
  113. # DFLASH_ATTENTION_BACKEND, defaulting to the dflash path); fallbacks
  114. # if boot fails: "FLASH_ATTN" (card's explicit choice) or "B12X".
  115. # kv_cache_dtype auto = BF16 draft pages (the card's DFLASH_KV_CACHE_DTYPE).
  116. "--speculative-config", """
  117. '{"method":"dflash","model":"local-inference-lab/GLM-5.3-Flash-DFlash2-MXFP8","num_speculative_tokens":7,"kv_cache_dtype":"auto"}'""",
  118. "--language-model-only",
  119. # MTP + CUDA graphs degrades OUTPUT QUALITY on the glm53 day-0 dev build
  120. # (forum #381350/#44, CONFIRMED by A/B bench 2026-08-28: same seed/flags,
  121. # graphs on = 89/100, eager = 92/100; decode unchanged 28.4 t/s @ c1,
  122. # c2 -7%, TTFT +1.6s). The b12x glm52 stack does NOT need this (its
  123. # graphs+MTP combo benches clean at 100/100) — bug is build-specific.
  124. # graphs moved BEFORE tool-call-parser; enforce-eager removed for the
  125. # r17-graphs test (bisect A2 was 88/100 eager; graphs+MTP fix is public
  126. # in r17 refs? verify by bench).
  127. "--tool-call-parser", "glm47",
  128. "--enable-auto-tool-choice",
  129. "--reasoning-parser", "glm45",
  130. ]
  131. [env]
  132. # R31 lock: 16 NCCL channels (their qualified runtime).
  133. NCCL_NCHANNELS = "16"
  134. HF_HUB_OFFLINE = "1"
  135. # RoCEnante (b12x one-shot RoCE all-reduce/all-gather) — default on for r27
  136. # lanes since the 2026-09-08 A/B (4x DCP4: decode +31..+90%, quality 160 vs
  137. # 155, prefill within noise; specs/tech-architecture/glm53-recipe-state.md,
  138. # history/night-shifts/2026-09-07.md). Needs the CX-7 RoCE fabric (all of
  139. # ours); single-node serves skip it silently. Caps default 2MB AR / 16MB AG.
  140. VLLM_ENABLE_ROCE_ALLREDUCE = "1"
  141. # FlashInfer JIT (mxfp8_gemm_cutlass_sm120, ~12 kernels) compiles at first
  142. # boot with 12 parallel nvcc jobs -> OOM-killed (code 137) on GB10's
  143. # 121 GB unified while the 93 GB weights + 10 GB KV pin are resident.
  144. # MAX_JOBS caps ninja parallelism so the JIT fits in the remaining ~20 GB.
  145. MAX_JOBS = "2"
  146. # NoPE-MLA rope-pad runtime gate (mod baked into the image)
  147. VLLM_MLA_NOPE_PAD_ROPE = "1"
  148. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  149. # Upstream launch-script env (memory + compile knobs)
  150. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  151. VLLM_USE_AOT_COMPILE = "0"
  152. VLLM_USE_STANDALONE_COMPILE = "1"
  153. VLLM_USE_FLASHINFER_SAMPLER = "1"
  154. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  155. TORCH_USE_RTLD_GLOBAL = "1"
  156. VLLM_NO_USAGE_STATS = "1"
  157. # Architecture (aarch64 / sm_121a DGX Spark)
  158. TORCH_CUDA_ARCH_LIST = "12.1a"
  159. FLASHINFER_CUDA_ARCH_LIST = "12.1f"
  160. CUTE_DSL_ARCH = "sm_121a"
  161. CMAKE_CUDA_ARCHITECTURES = "121"
  162. OMP_NUM_THREADS = "2"
  163. [[extra_mounts]]
  164. host = "~/sm121-cache/glm53-jit-121f/b12x"
  165. container = "/root/.cache/b12x"
  166. # JIT caches persist per-node across serves (was: cold /root/.cache per
  167. # container -> ~20 min flashinfer/torch recompile every serve). The host
  168. # dirs are shared between lanes of the same arch — each cache
  169. # self-namespaces by its engine version key internally.
  170. [[extra_mounts]]
  171. host = "~/sm121-cache/jit-121f/flashinfer"
  172. container = "/root/.cache/flashinfer"
  173. [[extra_mounts]]
  174. host = "~/sm121-cache/jit-121f/torchinductor"
  175. container = "/root/.cache/torchinductor"
  176. [[extra_mounts]]
  177. host = "~/sm121-cache/jit-121f/vllm"
  178. container = "/root/.cache/vllm"