recipe.toml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. # TP=6 ONLY, on the ZERO-PADDED checkpoint — first run on a node
  19. # (bootstrap task):
  20. # python3 experimental/tp3/make_padded.py \
  21. # /mnt/nas/ai/huggingface/hub/models--nvidia--GLM-5.3-Flash-NVFP4/snapshots/da920bb0b9f... \
  22. # /mnt/nas/ai/huggingface/glm-5.3-flash-nvfp4-tp6pad \
  23. # /mnt/nas/ai/huggingface/hub/models--incoai--GLM-5.3-Flash-DFlash2/snapshots/bf582e4eacc... \
  24. # /mnt/nas/ai/huggingface/glm-5.3-flash-dflash2-tp6pad \
  25. # --tp 6 --draft-heads 48 --draft-kv-heads 12
  26. # 66 MLA / 66 KDA heads and 2304 MoE columns do not split by 6;
  27. # tp3pad.py zeroes the extra rows at load (baked into the image).
  28. # Build: `sm121 build` in docker-images/glm53-kindling (tag spark-glm53:v9).
  29. # Bench: seed 42 hardmode + perf c1,c2 + depth suite, as everywhere.
  30. engine = "vllm"
  31. name = "GLM-5.3-Flash NVFP4 (kindlingai gx10 stack, 6x, DFlash2)"
  32. docker_image = "spark-glm53:v9"
  33. # shared image build dir (all three TP variants build the same image)
  34. docker_image_dir = "glm53-kindling"
  35. entrypoint = ["vllm", "serve"]
  36. model = "/root/.cache/huggingface/glm-5.3-flash-nvfp4-tp6pad"
  37. parent_model = "nvidia/GLM-5.3-Flash-NVFP4"
  38. port = 30000
  39. required_nodes = 6
  40. tensor_parallel_size = 6
  41. pipeline_parallel_size = 1
  42. distributed_backend = "mp"
  43. shm_size = "32gb"
  44. # GB10 UMA gate (vLLM #48140): reclaim the page cache before the engine startup check reads MemFree — leftover weight/NFS page cache (~10-15 GiB)
  45. # tipped random nodes below the 0.88 GMU threshold at boot.
  46. before_serve = [
  47. { command = "sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'", on_failure = "warn" },
  48. ]
  49. args = [
  50. # --- upstream entrypoint.sh `exec vllm serve …`, TP=6 case block -----
  51. "--served-model-name", "glm53",
  52. "--distributed-executor-backend", "mp",
  53. "--load-format", "auto",
  54. "--safetensors-load-strategy", "eager",
  55. "--gpu-memory-utilization", "0.88",
  56. "--max-model-len", "524288",
  57. "--kv-cache-dtype", "fp8_e4m3",
  58. "--block-size", "1792",
  59. "--kv-cache-memory", "27917287424",
  60. "--trust-remote-code",
  61. "--enable-prefix-caching",
  62. "--max-num-batched-tokens", "16384",
  63. "--max-num-seqs", "64",
  64. "--long-prefill-token-threshold", "2304",
  65. # flashinfer_cutlass — native NVFP4 MoE on the checkpoint's per-projection
  66. # input scales (marlin branch of their entrypoint not used). NO explicit
  67. # cudagraph cap: adaptive-k's num_speculative_tokens_per_batch_size makes
  68. # vLLM pick its own ceiling (upstream entrypoint deliberately leaves it).
  69. "--moe-backend", "flashinfer_cutlass",
  70. "--limit-mm-per-prompt", '{"image":16,"video":0}',
  71. # upstream's chat template: thinking:false -> low reasoning effort (the
  72. # model has no real non-thinking mode; an open breaks long output)
  73. "--chat-template", "/usr/local/share/glm53-chat-template.jinja",
  74. # entrypoint TOOL_ARGS / TOPK_ARGS (vendor parser-name notes apply)
  75. "--enable-auto-tool-choice",
  76. "--tool-call-parser", "glm47",
  77. "--sparse-indexer-topk-backend", "per_row",
  78. "--reasoning-parser", "glm45",
  79. # adaptive-k overlay EXTRA_ARGS — upstream appends it AFTER the entrypoint's
  80. # own spec line, so this JSON is the effective one (same race resolved).
  81. "--scheduler-cls", "vllm.v1.core.sched.adaptive_k.AdaptiveKScheduler",
  82. "--speculative-config", """
  83. '{"method":"dflash","disable_eagle_block_drop":true,"model":"/root/.cache/huggingface/glm-5.3-flash-dflash2-tp6pad","num_speculative_tokens":7,"attention_backend":"TRITON_ATTN","num_speculative_tokens_per_batch_size":[[1,1,7],[2,2,5],[3,3,4],[4,4,3],[5,5,2],[6,32,7]]}'""",
  84. # tp6.yaml: the vision tower does not split by 6
  85. "--mm-encoder-tp-mode", "data",
  86. ]
  87. # Node-local persistence, upstream CACHE_HOME equivalent (processed weight
  88. # snapshots ~48 GB/rank for their ~3-min restarts + JIT tiers + adaptive-k/
  89. # draft-trunc control state). One dir per cache root — NOT /root/.cache whole
  90. # (that would nest over the HF mount).
  91. [[extra_mounts]]
  92. host = "~/sm121-cache/glm53-kindling-tp6/snapshots"
  93. container = "/root/.cache/weight-snapshots"
  94. [[extra_mounts]]
  95. host = "~/sm121-cache/glm53-kindling-tp6/triton"
  96. container = "/root/.cache/triton"
  97. [[extra_mounts]]
  98. host = "~/sm121-cache/glm53-kindling-tp6/tilelang"
  99. container = "/root/.cache/tilelang"
  100. [[extra_mounts]]
  101. host = "~/sm121-cache/glm53-kindling-tp6/flashinfer"
  102. container = "/root/.cache/flashinfer"
  103. [[extra_mounts]]
  104. host = "~/sm121-cache/glm53-kindling-tp6/vllm"
  105. container = "/root/.cache/vllm"
  106. [[extra_mounts]]
  107. host = "~/sm121-cache/glm53-kindling-tp6/adaptive-k"
  108. container = "/root/.cache/adaptive-k"
  109. [[extra_mounts]]
  110. host = "~/sm121-cache/glm53-kindling-tp6/draft-trunc"
  111. container = "/root/.cache/draft-trunc"
  112. [env]
  113. HF_HUB_OFFLINE = "1"
  114. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  115. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  116. TORCH_MEM_FRACTION = "0.92"
  117. MAX_JOBS = "4"
  118. # entrypoint cache layout (dirs above): autotune per-boot and EPHEMERAL — a
  119. # persisted autotune cache deadlocks the next TP>1 boot (upstream measurement)
  120. TRITON_CACHE_DIR = "/root/.cache/triton"
  121. TILELANG_CACHE_DIR = "/root/.cache/tilelang"
  122. VLLM_CACHE_ROOT = "/root/.cache/vllm"
  123. VLLM_FLASHINFER_AUTOTUNE_CACHE_DIR = "/tmp/flashinfer_autotune"
  124. VLLM_WEIGHT_SNAPSHOT_DIR = "/root/.cache/weight-snapshots"
  125. # TP-scoped tag (OURS — upstream snapshots are per TP rank; its single shared
  126. # tag is safe only on a fixed-topology box set; TP2/TP4 must not collide)
  127. VLLM_WEIGHT_SNAPSHOT_TAG = "tp6pad-2026-09-29"
  128. # arx.yaml — RDMA collectives: decode two-shot, prefill RS gather
  129. VLLM_ARX_ALLREDUCE = "1"
  130. VLLM_ARXBIG = "1"
  131. VLLM_ARXBIG_RS = "1"
  132. VLLM_ARXBIG_AG = "0"
  133. VLLM_ARX_TWO_SHOT_MAX_KB = "2048"
  134. # adaptive-k.yaml — online step-cost learner + draft truncation
  135. VLLM_ADAPTIVE_K_CONTROL = "/root/.cache/adaptive-k"
  136. VLLM_ADAPTIVE_K_MODEL = "19.3,0.50,0.40"
  137. VLLM_ADAPTIVE_K_PER_REQUEST = "0"
  138. VLLM_ADAPTIVE_K_CODE_MODE = "gated"
  139. VLLM_ADAPTIVE_K_ONLINE = "1"
  140. 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"
  141. VLLM_DRAFT_TRUNC_TAU = "0.3"
  142. VLLM_DRAFT_TRUNC_EXPLORE = "4"
  143. VLLM_DRAFT_TRUNC_CONTROL = "/root/.cache/draft-trunc"
  144. VLLM_DRAFT_TRUNC_LOG = ""
  145. # fp8.yaml — dense linears the checkpoint kept in bf16 -> FP8/NVFP4 (the
  146. # measured ~1% NLL-on-prose cost is upstream's documented tuned default)
  147. VLLM_DENSE_FP8 = "1"
  148. VLLM_DENSE_FP8_LM_HEAD = "1"
  149. VLLM_DENSE_W4 = 'in_proj_qkvbfg_a$|^model\.|self_attn\.o_proj$|shared_experts\.(gate_up_proj|down_proj)$' # literal string (TOML backslash escapes)
  150. # megamoe.yaml — W4A16 decode MoE (batch<=8) + fused prefill >=1024 tokens
  151. VLLM_MEGAMOE = "1"
  152. VLLM_MEGAMOE_MAX_TOKENS = "8"
  153. VLLM_MEGAMOE_VARIANT = "20"
  154. VLLM_MOE_PREFILL = "1"
  155. VLLM_MOE_PREFILL_MIN_TOKENS = "1024"
  156. VLLM_MOE_PREFILL_CHECK = "0"
  157. VLLM_MOE_PREFILL_Y8 = "1"
  158. # fixes.yaml — triton sparse MLA (3.3x vs FA2), drafter KV pool, fused mHC
  159. # cap, KDA/conv1d copy elision, KV coordinator files
  160. VLLM_MHC_FUSED_MAX_TOKENS = "32"
  161. VLLM_TRITON_SPARSE_MLA = "1"
  162. VLLM_GLM5NEXT_DRAFT_POOL = "1"
  163. VLLM_GLM5NEXT_DRAFT_BLOCK_SIZE = ""
  164. # sp.yaml — sequence-parallel prefill over TP, quantized gathers, arx prefetch
  165. VLLM_GLM_SP_TP = "1"
  166. VLLM_GLM_SP_MIN_TOKENS = "1024"
  167. VLLM_GLM_SP_FP8_GATHER = "1"
  168. VLLM_GLM_ARX_PREFETCH = "1"
  169. VLLM_GLM_SP_MOE_FUSED = "1"
  170. VLLM_GLM_SP_MOE_QUANT_GATHER = "1"
  171. VLLM_GLM_SP_MOE_CHECK = "0"
  172. # recoverssm.yaml — KDA verify from one state per request (seqs raised above)
  173. VLLM_GLM5NEXT_RECOVERSSM = "1"