recipe.toml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # GLM-5.3 (full) MXFP4 — 8x DGX Spark @512K, no DCP.
  2. #
  3. # P2.1 of the 2026-09-18 night: the full model's first 8x trial. The 4x
  4. # 512K state is blocked by the DCP>1 sparse-decode crash
  5. # (deepseek_v32/attention.py:596, r35+r37); at 8x no DCP is needed:
  6. #
  7. # weights 403.4 GB / 8 = 50.4 GB/node
  8. # budget GMU 0.85 x 121.63 = 103.4 GiB
  9. # KV pool 103.4 - 50.4 - 12 (process) = ~41 GiB/rank
  10. # 512K req 26.3 GiB -> 1.5x concurrency (768K would be ~39.5, tight)
  11. #
  12. # Same image/contract as the qualified 4x 131K state (marlin linear, B12X
  13. # attention, instanttensor, block 256, RoCE allreduce) minus DCP and the KV
  14. # pin (the pool is GMU-driven at 8x). The 4x 131K anchor (dev67 no-spec):
  15. # 158/176, 934 pp / 19.0 tg / 2,124 ms.
  16. engine = "vllm"
  17. name = "GLM-5.3 (full) MXFP4 (r37 img, RedHatAI ckpt, 8x DCP1 @512K)"
  18. # Image: the r37 DS4.1 build (2026-09-14, night shift) - the r35 tree's DCP4
  19. # sparse-INDEXER path asserts interleave==1 and then crashes in the DCP sparse
  20. # decode reshape during graph capture ("shape '[16, 16, 512]' is invalid for
  21. # input of size 524288" - the x4 DCP factor in the attention.py _sparse_
  22. # decode). r37 is the newer DS4.1 lock whose DCP sparse-MLA path is the
  23. # qualified one (same tree family as our DCP2/DFlash2 work); the GlmMoeDsa
  24. # arch + MTP + b12x ship in the r37 image (verified 2026-09-13).
  25. docker_image = "jovian-judgement:r37-ds41"
  26. docker_image_dir = "jovian-judgement"
  27. # NOTE: build_profile must stay a TOP-LEVEL key — a bare key after
  28. # [[extra_mounts]] would parse into the last mount table and be silently
  29. # ignored (2026-09-08).
  30. build_profile = "r37-ds41"
  31. entrypoint = ["vllm", "serve"]
  32. model = "RedHatAI/GLM-5.3-MXFP4"
  33. parent_model = "zai-org/GLM-5.3"
  34. required_nodes = 8
  35. tensor_parallel_size = 8
  36. pipeline_parallel_size = 1
  37. distributed_backend = "mp"
  38. shm_size = "32gb"
  39. args = [
  40. # R31/r35 delta (their qualified locks): adaptive prefill/decode
  41. # compute-time sharing with a fixed 40% prefill floor.
  42. "--prefill-compute-share", "0.4",
  43. # Stable served name — quant-agnostic (shared across glm53 lanes)
  44. "--served-model-name", "glm53",
  45. "--trust-remote-code",
  46. "--distributed-executor-backend", "mp",
  47. # Admission guardrail only (KV is pinned below): 0.85×121.63 = 103.4 GiB.
  48. # 0.88 (107.0) is the Flash lane's value and is too tight here — the full
  49. # model's weights leave ~24 GiB before the engine's own ~12 GiB.
  50. "--gpu-memory-utilization", "0.85",
  51. # No KV pin: the pool is GMU-driven at 8x (~41 GiB/rank, see header).
  52. # No --kv-cache-dtype: let the r35 fork pick its native default for
  53. # GlmMoeDsa attention (the Flash lane's explicit fp8/fp8_ds_mla spellings
  54. # both failed auto-selection on this build, and those were Flash-MLA
  55. # knobs). The card's --kv-cache-dtype fp8_e4m3 is the fallback spelling
  56. # if the pool needs to shrink.
  57. "--attention-backend", "B12X",
  58. # MXFP4 kernel routing (measured on the first boot, 2026-09-13 ~23:10 UTC):
  59. # - MoE: the compressed-tensors W4A4-MXFP4 scheme picks MarlinExperts on
  60. # its own (A16 dequant GEMM - correct on GB10). The --moe-backend flag
  61. # does not reach that scheme (verified inert: it still logged "Using
  62. # MarlinExperts for MXFP4 MoE" with the flag set), so we do not set it.
  63. # - LINEAR: the default priority [FlashInfer, Marlin, Humming, B12x]
  64. # starts with the FlashInfer kernel, whose is_supported() wrongly
  65. # accepts capability 121 (the numeric has_device_capability(100) check
  66. # passes on GB10) while the cute-dsl mm_fp4 GEMM it calls rejects it at
  67. # runtime with:
  68. # BackendSupportedError: mm_fp4 does not support backend 'cute-dsl'
  69. # with capability 121
  70. # (the first probe boot died there, kv_b_proj dequant in mla_attention.py).
  71. # --linear-backend b12x forces the B12xMxFp4LinearKernel - "MXFP4 linear
  72. # through the native B12X SM120 dense GEMM" - the right path on GB10,
  73. # verified per component: is_device_capability_family(120)=True, b12x
  74. # blockscaled.is_supported()=True, and the cute-dsl input quantize
  75. # (flashinfer_mxfp4_quantize) works on capability 121; only the cute-dsl
  76. # mm_fp4 GEMM is unsupported there. Boot log to look for:
  77. # "Using B12xMxFp4LinearKernel for MXFP4 GEMM"
  78. # (The lab's GLM-5.1 runbook describes the same kernel family for the
  79. # quant_method=mxfp4 ingestion path - this checkpoint goes through the
  80. # compressed-tensors path, which is why --moe-backend was the wrong lever.)
  81. # First attempt: b12x (the native SM120 GEMM) - correct selection, but the
  82. # unconditional b12x warmup (b12x_warmup.py, no config gate) crashes on
  83. # this checkpoint's layer shapes during kernel compile:
  84. # RuntimeError: Expected source and destination tensors to have the same
  85. # rank, but got 3 and 4 (b12x/gemm/blockscaled/_linear.py dense_gemm,
  86. # via _apply_b12x_mxfp4_linear on a synthetic zero source)
  87. # so the mxfp4 LINEAR layers run on Marlin (weight-only A16 dequant GEMM -
  88. # the same family as the MarlinExperts the MoE scheme picked). Slower than
  89. # native FP4 for the attention projections, but the MoE experts (the
  90. # dominant cost) are Marlin either way. The b12x warmup rank bug is
  91. # filed-worthy for the lab (RedHatAI GLM-5.3-MXFP4 on GB10/sm_121a).
  92. "--linear-backend", "marlin",
  93. # pure I/O loader (kept across every GLM config)
  94. "--load-format", "instanttensor",
  95. "--block-size", "256",
  96. "--max-model-len", "524288",
  97. "--max-num-seqs", "8",
  98. "--max-num-batched-tokens", "4096",
  99. "--enable-chunked-prefill",
  100. "--async-scheduling",
  101. "--enable-prefix-caching",
  102. # Their proven boot: no flashinfer autotune, no CuTe-DSL warmup (the
  103. # autotune scratch at 512K shapes does not fit the headroom, 2026-08-28).
  104. "--kernel-config", """
  105. '{"enable_cutedsl_warmup":false,"enable_flashinfer_autotune":false}'""",
  106. "--language-model-only",
  107. # NO --speculative-config on the first boot — see the header. MTP head is
  108. # in the checkpoint (num_nextn_predict_layers=1); add mtp k=3 after a
  109. # clean boot + bench.
  110. "--tool-call-parser", "glm47",
  111. "--enable-auto-tool-choice",
  112. "--reasoning-parser", "glm45",
  113. ]
  114. [env]
  115. # R31 lock: 16 NCCL channels (their qualified runtime).
  116. NCCL_NCHANNELS = "16"
  117. HF_HUB_OFFLINE = "1"
  118. # RoCEnante (b12x one-shot RoCE all-reduce/all-gather) — default on for r27+
  119. # lanes since the 2026-09-08 A/B (4x DCP4: decode +31..+90%, quality 160 vs
  120. # 155; specs/tech-architecture/glm53-recipe-state.md). Needs the CX-7 RoCE
  121. # fabric (all of ours); single-node serves skip it silently.
  122. VLLM_ENABLE_ROCE_ALLREDUCE = "1"
  123. # Compile-OOM guard: first boot JIT-compiles the mxfp8 gemm module with 12
  124. # parallel nvcc jobs (~3 GiB each) behind ~94 GiB of resident weights →
  125. # cicc OOM-killed (2026-09-04). flashinfer's run_ninja reads MAX_JOBS.
  126. MAX_JOBS = "2"
  127. # NoPE-MLA rope-pad runtime gate (mod baked into the image)
  128. VLLM_MLA_NOPE_PAD_ROPE = "1"
  129. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  130. # Upstream launch-script env (memory + compile knobs)
  131. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  132. VLLM_USE_AOT_COMPILE = "0"
  133. VLLM_USE_STANDALONE_COMPILE = "1"
  134. VLLM_USE_FLASHINFER_SAMPLER = "1"
  135. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  136. TORCH_USE_RTLD_GLOBAL = "1"
  137. VLLM_NO_USAGE_STATS = "1"
  138. # Architecture (aarch64 / sm_121a DGX Spark)
  139. TORCH_CUDA_ARCH_LIST = "12.1a"
  140. FLASHINFER_CUDA_ARCH_LIST = "12.1f"
  141. CUTE_DSL_ARCH = "sm_121a"
  142. CMAKE_CUDA_ARCHITECTURES = "121"
  143. OMP_NUM_THREADS = "2"
  144. [[extra_mounts]]
  145. host = "~/sm121-cache/glm53-jit-121f/b12x"
  146. container = "/root/.cache/b12x"
  147. # JIT caches persist per-node across serves (was: cold /root/.cache per
  148. # container -> ~20 min flashinfer/torch recompile every serve). The host
  149. # dirs are shared between lanes of the same arch — each cache
  150. # self-namespaces by its engine version key internally.
  151. [[extra_mounts]]
  152. host = "~/sm121-cache/jit-121f/flashinfer"
  153. container = "/root/.cache/flashinfer"
  154. [[extra_mounts]]
  155. host = "~/sm121-cache/jit-121f/torchinductor"
  156. container = "/root/.cache/torchinductor"
  157. [[extra_mounts]]
  158. host = "~/sm121-cache/jit-121f/vllm"
  159. container = "/root/.cache/vllm"