recipe.toml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. # kindlingai/glm-5.3-flash-gx10 — integration mode B (operator 2026-10-01:
  2. # "image + patches first, their full stack later"). Their IMAGE (15 anchored
  3. # patches + FlashKDA rebuild, baked experimental/ overlay stack via
  4. # docker-images/glm53-kindling/build.sh) launched with sm121's mp rendezvous.
  5. # Every arg/env below is a 1:1 transcription of upstream `image/entrypoint.sh`
  6. # (`exec vllm serve …` and its `case "$TP"` block) plus the
  7. # `experimental/compose/*.yaml` env blocks (arx, snapshot, adaptive-k, fp8,
  8. # megamoe, fixes, sp, recoverssm, tp3-pads) — the stack the upstream README
  9. # headline numbers were measured with. Deviation ledger:
  10. # docker-images/glm53-kindling/README.md.
  11. #
  12. # NOT used (mode A territory): their entrypoint (mentatd roles/election,
  13. # preflight, fabric-check, status server, self-test, GID derivation) — sm121
  14. # owns orchestration, NCCL env comes from the cluster [nccl] block (auto GID
  15. # detect included). Weights: NAS HF cache (upstream demands local disks per
  16. # box — operator call, documented). KV pin: upstream per-TP value on GB10 UMA
  17. # (profiled-unpinned pools starve FlashInfer autotune at boot — upstream).
  18. # Build: `sm121 build` in docker-images/glm53-kindling (tag spark-glm53:v9).
  19. # Bench: seed 42 hardmode + perf c1,c2 + depth suite, as everywhere.
  20. engine = "vllm"
  21. name = "GLM-5.3-Flash NVFP4 (kindlingai gx10 stack, 4x, DFlash2, karmic-kraken)"
  22. docker_image = "spark-glm53-karmic:local"
  23. # shared image build dir (all three TP variants build the same image)
  24. docker_image_dir = "karmic-kraken"
  25. entrypoint = ["vllm", "serve"]
  26. # Floating model: the engine resolves the org/model id via the NAS HF cache
  27. # (refs/main → latest snapshot), so a model re-upload is picked up without
  28. # touching the recipe. The NAS copy stood at snapshot da920bb0 on 2026-10-02
  29. # (the 94/100 campaign) — informational only; the path follows refs/main.
  30. model = "nvidia/GLM-5.3-Flash-NVFP4"
  31. parent_model = "nvidia/GLM-5.3-Flash-NVFP4"
  32. port = 30000
  33. required_nodes = 4
  34. tensor_parallel_size = 4
  35. pipeline_parallel_size = 1
  36. distributed_backend = "mp"
  37. shm_size = "32gb"
  38. args = [
  39. # --- upstream entrypoint.sh `exec vllm serve …`, TP=4 case block -----
  40. "--served-model-name", "glm53",
  41. "--distributed-executor-backend", "mp",
  42. "--load-format", "b12x",
  43. "--gpu-memory-utilization", "0.86",
  44. "--max-model-len", "524288",
  45. "--kv-cache-dtype", "fp8",
  46. "--block-size", "256",
  47. "--kv-cache-memory", "27917287424",
  48. "--trust-remote-code",
  49. "--enable-prefix-caching",
  50. "--max-num-batched-tokens", "16384",
  51. "--max-num-seqs", "64",
  52. "--long-prefill-token-threshold", "2304",
  53. # Karmic-qualified B12X stack (local-inference-lab docker configurator,
  54. # glm53-flash profile): the B12X attention backend is the one that handles
  55. # GLM-5.3's hybrid fp8_ds_mla KV (both the MHA and the sparse-MLA parts);
  56. # fp8 KV + B12X linear/MoE backends. (The kindling transcription used
  57. # flashinfer_cutlass + auto backend, which the karmic vLLM tip can't
  58. # reconcile for this model.)
  59. "--attention-backend", "B12X",
  60. "--linear-backend", "b12x",
  61. "--moe-backend", "b12x",
  62. "--mamba-cache-mode", "align",
  63. "--recurrent-checkpoint-policy", "request_boundaries",
  64. "--cp-kv-cache-interleave-size", "4",
  65. "--additional-config", "{\"glm53_kda_decode_backend\": \"auto\", \"kda_prefill_backend\": \"b12x\"}",
  66. "--limit-mm-per-prompt", '{"image":16,"video":0}',
  67. # upstream's chat template: thinking:false -> low reasoning effort (the
  68. # model has no real non-thinking mode; an open breaks long output)
  69. "--chat-template", "/usr/local/share/glm53-chat-template.jinja",
  70. # entrypoint TOOL_ARGS / TOPK_ARGS (vendor parser-name notes apply)
  71. "--enable-auto-tool-choice",
  72. "--tool-call-parser", "glm47",
  73. "--sparse-indexer-topk-backend", "per_row",
  74. "--reasoning-parser", "glm45",
  75. # adaptive-k overlay EXTRA_ARGS — upstream appends it AFTER the entrypoint's
  76. # own spec line, so this JSON is the effective one (same race resolved).
  77. "--scheduler-cls", "vllm.v1.core.sched.adaptive_k.AdaptiveKScheduler",
  78. "--speculative-config", """
  79. '{"method":"dflash","disable_eagle_block_drop":true,"model":"{{dflash}}","num_speculative_tokens":7,"num_speculative_tokens_per_batch_size":[[1,1,7],[2,2,5],[3,3,4],[4,4,3],[5,5,2],[6,32,7]]}'""",
  80. ]
  81. # DFlash2 drafter: {{dflash}} resolves per node from the NAS HF
  82. # cache (upstream mounts DFLASH_HOST_DIR on every box instead).
  83. [[extra_mounts]]
  84. repo = "incoai/GLM-5.3-Flash-DFlash2"
  85. container = "dflash"
  86. # Node-local persistence, upstream CACHE_HOME equivalent (processed weight
  87. # snapshots ~48 GB/rank for their ~3-min restarts + JIT tiers + adaptive-k/
  88. # draft-trunc control state). One dir per cache root — NOT /root/.cache whole
  89. # (that would nest over the HF mount).
  90. [[extra_mounts]]
  91. host = "~/sm121-cache/glm53-kindling/snapshots"
  92. container = "/root/.cache/weight-snapshots"
  93. [[extra_mounts]]
  94. host = "~/sm121-cache/glm53-kindling/triton"
  95. container = "/root/.cache/triton"
  96. [[extra_mounts]]
  97. host = "~/sm121-cache/glm53-kindling/tilelang"
  98. container = "/root/.cache/tilelang"
  99. [[extra_mounts]]
  100. host = "~/sm121-cache/glm53-kindling/flashinfer"
  101. container = "/root/.cache/flashinfer"
  102. [[extra_mounts]]
  103. host = "~/sm121-cache/glm53-kindling/vllm"
  104. container = "/root/.cache/vllm"
  105. [[extra_mounts]]
  106. host = "~/sm121-cache/glm53-kindling/adaptive-k"
  107. container = "/root/.cache/adaptive-k"
  108. [[extra_mounts]]
  109. host = "~/sm121-cache/glm53-kindling/draft-trunc"
  110. container = "/root/.cache/draft-trunc"
  111. # Last-moment drop_caches: the built-in (pre-container) one is too early —
  112. # by worker init the container stack (torch+CUDA+code page cache from
  113. # overlay/NFS) refills ~11 GiB, and the GB10 UMA gate (free >= GMU*total)
  114. # is a ~0.75 GiB coin flip per node (observed: 106.28/106.92 vs 107.03 on
  115. # random nodes). Dropping caches right before the engine exec reclaims the
  116. # code-cache part. GMU 0.88->0.86 below gives the extra margin; the hard
  117. # --kv-cache-memory pin is untouched, so the KV pool is unchanged.
  118. [mods]
  119. commands = [
  120. { command = "sh -c 'echo 3 > /proc/sys/vm/drop_caches 2>/dev/null || true'", on_failure = "warn" },
  121. ]
  122. [env]
  123. HF_HUB_OFFLINE = "1"
  124. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  125. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  126. TORCH_MEM_FRACTION = "0.92"
  127. MAX_JOBS = "4"
  128. # entrypoint cache layout (dirs above): autotune per-boot and EPHEMERAL — a
  129. # persisted autotune cache deadlocks the next TP>1 boot (upstream measurement)
  130. TRITON_CACHE_DIR = "/root/.cache/triton"
  131. TILELANG_CACHE_DIR = "/root/.cache/tilelang"
  132. VLLM_CACHE_ROOT = "/root/.cache/vllm"
  133. VLLM_FLASHINFER_AUTOTUNE_CACHE_DIR = "/tmp/flashinfer_autotune"
  134. # Karmic B12X stack env (lil-catalog glm53-flash profile): the dynamic-split
  135. # MHC/KDA kernels that handle GLM-5.3's hybrid attention on the B12X backend.
  136. B12X_DYNAMIC_SPLIT_B12X_MHC_TILE_LANG = "0"
  137. B12X_MHC_TILE_LANG = "1"
  138. B12X_MHC_TILE_LANG_FAST = "1"
  139. B12X_MHC_TILE_LANG_PREFILL = "1"
  140. B12X_MHC_TILE_LANG_PREFILL_FAST = "1"
  141. B12X_TQ_TILE_LANG = "1"
  142. VLLM_WEIGHT_SNAPSHOT_DIR = "/root/.cache/weight-snapshots"
  143. # TP-scoped tag (OURS — upstream snapshots are per TP rank; its single shared
  144. # tag is safe only on a fixed-topology box set; TP2/TP4 must not collide)
  145. VLLM_WEIGHT_SNAPSHOT_TAG = "fp8w4c-tp4-2026-09-28"
  146. # arx.yaml — RDMA collectives: decode two-shot, prefill RS gather
  147. VLLM_ARX_ALLREDUCE = "1"
  148. VLLM_ARXBIG = "1"
  149. VLLM_ARXBIG_RS = "1"
  150. VLLM_ARXBIG_AG = "0"
  151. VLLM_ARX_TWO_SHOT_MAX_KB = "2048"
  152. # adaptive-k.yaml — online step-cost learner + draft truncation
  153. VLLM_ADAPTIVE_K_CONTROL = "/root/.cache/adaptive-k/control"
  154. VLLM_ADAPTIVE_K_MODEL = "26.4,0.660,0.484"
  155. VLLM_ADAPTIVE_K_PER_REQUEST = "0"
  156. VLLM_ADAPTIVE_K_CODE_MODE = "gated"
  157. VLLM_ADAPTIVE_K_ONLINE = "1"
  158. VLLM_ADAPTIVE_K_COST_MS = "2:29.7,3:33.1,4:36.5,5:39.8,6:43.1,7:46.0,8:48.9"
  159. VLLM_DRAFT_TRUNC_TAU = "0.3"
  160. VLLM_DRAFT_TRUNC_EXPLORE = "4"
  161. VLLM_DRAFT_TRUNC_CONTROL = "/root/.cache/draft-trunc/control"
  162. VLLM_DRAFT_TRUNC_LOG = ""
  163. # fp8.yaml — dense linears the checkpoint kept in bf16 -> FP8/NVFP4 (the
  164. # measured ~1% NLL-on-prose cost is upstream's documented tuned default)
  165. VLLM_DENSE_FP8 = "1"
  166. VLLM_DENSE_FP8_LM_HEAD = "1"
  167. VLLM_DENSE_W4 = 'in_proj_qkvbfg_a$|^model\.|self_attn\.o_proj$|shared_experts\.(gate_up_proj|down_proj)$' # literal string (TOML backslash escapes)
  168. # megamoe.yaml — W4A16 decode MoE (batch<=8) + fused prefill >=1024 tokens
  169. VLLM_MEGAMOE = "1"
  170. VLLM_MEGAMOE_MAX_TOKENS = "8"
  171. VLLM_MEGAMOE_VARIANT = "20"
  172. VLLM_MOE_PREFILL = "1"
  173. VLLM_MOE_PREFILL_MIN_TOKENS = "1024"
  174. VLLM_MOE_PREFILL_CHECK = "0"
  175. VLLM_MOE_PREFILL_Y8 = "1"
  176. # fixes.yaml — triton sparse MLA (3.3x vs FA2), drafter KV pool, fused mHC
  177. # cap, KDA/conv1d copy elision, KV coordinator files
  178. VLLM_MHC_FUSED_MAX_TOKENS = "32"
  179. VLLM_TRITON_SPARSE_MLA = "1"
  180. VLLM_GLM5NEXT_DRAFT_POOL = "1"
  181. VLLM_GLM5NEXT_DRAFT_BLOCK_SIZE = ""
  182. # sp.yaml — sequence-parallel prefill over TP, quantized gathers, arx prefetch
  183. VLLM_GLM_SP_TP = "1"
  184. VLLM_GLM_SP_MIN_TOKENS = "1024"
  185. VLLM_GLM_SP_FP8_GATHER = "1"
  186. VLLM_GLM_ARX_PREFETCH = "1"
  187. VLLM_GLM_SP_MOE_FUSED = "1"
  188. VLLM_GLM_SP_MOE_QUANT_GATHER = "1"
  189. VLLM_GLM_SP_MOE_CHECK = "0"
  190. # recoverssm.yaml — KDA verify from one state per request (seqs raised above)
  191. VLLM_GLM5NEXT_RECOVERSSM = "1"