recipe.toml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # BLOCKED 2026-09-08 (r28 re-test): the r28 tree advanced the DCP+DFlash
  2. # boundary logic (fa4720ea) but the drafter still dies — now at
  3. # backend selection, not the old C4 assert: the DFlash attention kernel
  4. # is BF16-KV-only ("K and V caches must be bfloat16") while the GLM-5.3
  5. # engine runs fp8_ds_mla KV (fork default; no per-drafter dtype override
  6. # in this tree) -> "No valid attention backend found ... kv_cache_dtype=
  7. # fp8_ds_mla, use_mla=False, block_size=256". Fork-side work: teach
  8. # DFlashAttention the fp8_ds_mla KV, or add a drafter bf16-KV override.
  9. #
  10. # DFlash2 re-test on the r28 full stack (2026-09-08, operator: "maybe it
  11. # works now"). The 2026-09-06 blocker (C4 parent-page stride assert + FP8-KV
  12. # drafter backend rejection) targeted the r27 tree; r28's vLLM carries
  13. # fa4720ea "fix(cache): restore GLM boundaries across DCP and DFlash groups"
  14. # + the #646 2048/256 page split, so the geometry may now line up.
  15. # Recipe = the r27-dflash2 2x shape (deleted at 17a91a9) retargeted:
  16. # method "dflash", incoai/GLM-5.3-Flash-DFlash2 draft, k=7, B12X backend,
  17. # block-size 256, 10 GiB KV pin (2x profile).
  18. #
  19. engine = "vllm"
  20. name = "GLM-5.3-Flash NVFP4 (r28 img, DFlash2 k=7, 2x re-test)"
  21. docker_image = "jovian-judgement:r28-glm53" # full r28 lock via build_profile
  22. build_profile = "r28"
  23. docker_image_dir = "jovian-judgement"
  24. # Required: the clean r12 image follows the solar contract (ENTRYPOINT []
  25. # + CMD bash), so the recipe carries the entrypoint (the old day-0-based
  26. # r12 image had ["vllm","serve"] baked in, which is why this was absent
  27. # until the clean rebuild).
  28. entrypoint = ["vllm", "serve"]
  29. model = "local-inference-lab/GLM-5.3-Flash-NVFP4"
  30. parent_model = "zai-org/GLM-5.3-Flash"
  31. required_nodes = 2
  32. tensor_parallel_size = 2
  33. pipeline_parallel_size = 1
  34. distributed_backend = "mp"
  35. shm_size = "32gb"
  36. args = [
  37. # Stable served name — quant-agnostic (shared across glm53 quants)
  38. "--served-model-name", "glm53",
  39. "--trust-remote-code",
  40. "--distributed-executor-backend", "mp",
  41. # GMU is ONLY a startup guardrail here (KV pool is pinned below): 0.90
  42. # demands 109.46 GiB free on GB10's 121.63 GiB, but driver reserve +
  43. # page cache routinely leave ~108.5 -> flaky
  44. # "Free memory ... less than desired" boot deaths (this was the class
  45. # of the old "54-second death"), and post-crash reruns see ~106.6 GiB.
  46. # 0.82 = 99.7 GiB, below any realistic dip; does NOT change what gets
  47. # allocated (weights ~93 + pinned KV 10 + activations).
  48. "--gpu-memory-utilization", "0.90",
  49. # Pinned 10 GiB KV (≈1.16M tokens) — GMU sizing has no headroom at
  50. # 92.72 GiB weights/node; pinning also keeps warmup off the swap path
  51. "--kv-cache-memory-bytes", "10737418240",
  52. # No --kv-cache-dtype: let the r12 fork pick its default (the explicit
  53. # fp8 / fp8_ds_mla both failed auto-selection on this build).
  54. # The GLM5Next model wires the B12X sparse-MLA backend (sm_120/sm_121)
  55. # when the global backend is B12X (glm5next/nvidia/attention.py:
  56. # _select_sparse_backend); the sm12x auto-priority list never offers it
  57. # (FLASHINFER_MLA_SPARSE_SM120 only supports head 576, not GLM's 512).
  58. "--attention-backend", "B12X",
  59. # pure I/O loader (kept across every config; 171 GB in ~5.5 min vs ~16 NFS)
  60. "--load-format", "instanttensor",
  61. # [R17 FULL-CLUSTER TEST] lil manifest backends (quality gate: hardmode
  62. # must stay ≥88; r12-era this cluster dropped it to 74 — r17 may carry
  63. # the fix through — one boot decides).
  64. "--block-size", "256",
  65. # FINAL BISECT (2026-09-03, hardmode 176pt, r17 img):
  66. # knobs-only 87: d0 c1 24.1, d8192 23.8
  67. # +moe b12x 88: d0 c1 23.5, d8192 26.6 <- SHIP (2 pts d8192)
  68. # +linear b12x 44: W4A4 linear kernel destroys numerics (param-precision 0%)
  69. # +align 88: but d0 c1 18.6 (-5) — perf-negative, dropped
  70. # (all three together = 44-74; the lab needs its private packed package)
  71. "--max-model-len", "524288",
  72. "--max-num-seqs", "16",
  73. "--max-num-batched-tokens", "4096",
  74. "--enable-chunked-prefill",
  75. "--async-scheduling",
  76. "--enable-prefix-caching",
  77. "--disable-custom-all-reduce",
  78. # Their proven boot: no flashinfer autotune, no CuTe-DSL warmup
  79. "--kernel-config", """
  80. '{"enable_cutedsl_warmup":false,"enable_flashinfer_autotune":false}'""",
  81. # Built-in MTP draft, 3 tokens (the r12-qualified "mtp:3" mode — their
  82. # x86 numbers: 254 tok/s CC1, 2.37 accept; the checkpoint embeds up to
  83. # 5 via the model-mtp-0000x shards but 3 is the verified depth). This is
  84. # the checkpoint's own MTP head (Glm5NextMTPModel), NOT dspark — dspark
  85. # is the DeepSeek-V4 family's mechanism; GLM's other r12 mode is
  86. # dflash2:7 with a separate trained draft checkpoint.
  87. # The draft model's vllm_config takes its attention backend from the
  88. # SPECULATIVE config, not the global flag (eagle/utils.py:
  89. # _make_eagle_draft_vllm_config) — B12X here mirrors the main model's.
  90. # r18 used draft_model/FLASH_ATTN/kv auto — both rejected on that fork
  91. # (FP8-KV-drafter backend check + C4-page stride assert). r27 qualifies
  92. # dflash2 upstream (the #646 2048+256 page split is in this tree); the
  93. # drafter/depth follow the working aiden GB10 lane (method "dflash").
  94. "--speculative-config", """
  95. '{"method":"dflash","model":"incoai/GLM-5.3-Flash-DFlash2","num_speculative_tokens":7}'""",
  96. "--language-model-only",
  97. # MTP + CUDA graphs degrades OUTPUT QUALITY on the glm53 day-0 dev build
  98. # (forum #381350/#44, CONFIRMED by A/B bench 2026-08-28: same seed/flags,
  99. # graphs on = 89/100, eager = 92/100; decode unchanged 28.4 t/s @ c1,
  100. # c2 -7%, TTFT +1.6s). The b12x glm52 stack does NOT need this (its
  101. # graphs+MTP combo benches clean at 100/100) — bug is build-specific.
  102. # graphs moved BEFORE tool-call-parser; enforce-eager removed for the
  103. # r17-graphs test (bisect A2 was 88/100 eager; graphs+MTP fix is public
  104. # in r17 refs? verify by bench).
  105. "--tool-call-parser", "glm47",
  106. "--enable-auto-tool-choice",
  107. "--reasoning-parser", "glm45",
  108. ]
  109. archived = true
  110. [env]
  111. HF_HUB_OFFLINE = "1"
  112. # FlashInfer JIT (mxfp8_gemm_cutlass_sm120, ~12 kernels) compiles at first
  113. # boot with 12 parallel nvcc jobs -> OOM-killed (code 137) on GB10's
  114. # 121 GB unified while the 93 GB weights + 10 GB KV pin are resident.
  115. # MAX_JOBS caps ninja parallelism so the JIT fits in the remaining ~20 GB.
  116. MAX_JOBS = "2"
  117. # NoPE-MLA rope-pad runtime gate (mod baked into the image)
  118. VLLM_MLA_NOPE_PAD_ROPE = "1"
  119. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  120. # Upstream launch-script env (memory + compile knobs)
  121. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  122. VLLM_USE_AOT_COMPILE = "0"
  123. VLLM_USE_STANDALONE_COMPILE = "1"
  124. VLLM_USE_FLASHINFER_SAMPLER = "1"
  125. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  126. TORCH_USE_RTLD_GLOBAL = "1"
  127. VLLM_NO_USAGE_STATS = "1"
  128. # Architecture (aarch64 / sm_121a DGX Spark)
  129. TORCH_CUDA_ARCH_LIST = "12.1a"
  130. FLASHINFER_CUDA_ARCH_LIST = "12.1f"
  131. CUTE_DSL_ARCH = "sm_121a"
  132. CMAKE_CUDA_ARCHITECTURES = "121"
  133. OMP_NUM_THREADS = "2"
  134. [[extra_mounts]]
  135. host = "~/sm121-cache/glm53-jit-121f/b12x"
  136. container = "/root/.cache/b12x"
  137. # JIT caches persist per-node across serves (was: cold /root/.cache per
  138. # container -> ~20 min flashinfer/torch recompile every serve). The host
  139. # dirs are shared between lanes of the same arch — each cache
  140. # self-namespaces by its engine version key internally.
  141. [[extra_mounts]]
  142. host = "~/sm121-cache/jit-121f/flashinfer"
  143. container = "/root/.cache/flashinfer"
  144. [[extra_mounts]]
  145. host = "~/sm121-cache/jit-121f/torchinductor"
  146. container = "/root/.cache/torchinductor"
  147. [[extra_mounts]]
  148. host = "~/sm121-cache/jit-121f/vllm"
  149. container = "/root/.cache/vllm"