recipe.toml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # PARKED 2026-09-04: the lab image's GLM5Next target model does not implement
  2. # the SupportsEagle3 interface, but its model_runner requires aux hidden-state
  3. # outputs for the dflash method (model_runner.py:240) → "Model does not
  4. # support EAGLE3 interface" at boot. The lab's own qualified DFlash2 runs use
  5. # a newer fork with the aux-capture plumbing; porting it here is not worth it
  6. # tonight. The competitive A/B lives on the aiden image (glm53-flash-aiden-4x-
  7. # labdrafter) which ships the DFlash2 overlay.
  8. #
  9. # NOTE: the lab's DFlash2 checkpoints are MXFP8-quantized (weight_scale
  10. # tensors) and their config names the arch DFlash2DraftModel — the lab image
  11. # registers the drafter under DFlashDraftModel and its loader has no MXFP8
  12. # scale support (ValueError: no parameter 'weight_scale'). So this lane uses
  13. # a dequantized bf16 copy (exact value reconstruction of the MXFP8 tensors)
  14. # packaged as local-inference-lab/GLM-5.3-Flash-DFlash2-bf16-lab (arch
  15. # DFlashDraftModel) in the shared NAS hub. The aiden-image lane uses the
  16. # sibling -bf16 repo (arch DFlash2DraftModel). Hand-rolled HF hub repos: refs/main
  17. # must be the snapshot dir name as EXACT 40-hex, no trailing newline (the hub
  18. # offline resolver reads it unstripped — `echo` breaks resolution, use printf).
  19. # GLM-5.3-Flash NVFP4 — local-inference-lab quant (vLLM) — 2× DGX Spark, TP=2.
  20. #
  21. # local-inference-lab mixed quant: NVFP4 routed experts (layers 3–44,
  22. # group-16) + MXFP8 MTP experts (layer 45) + W4A4 input scales. Best agent
  23. # quant so far: tool-eval-bench 89/100 (vs 85 LibertAIDAI, 90 official FP8).
  24. # Model: https://huggingface.co/local-inference-lab/GLM-5.3-Flash-NVFP4
  25. # (~186 GB → 92.72 GiB weights/node; KV pinned at 10 GiB, see below)
  26. #
  27. # Image: glm53-flash-nvfp4-lab:local (docker-images/glm53-flash-nvfp4-lab/ —
  28. # day-0 arm64 image + NoPE-MLA mod + the four FujitsuPolycom lab-checkpoint
  29. # patches: model naming shim, modelopt MTP namespace fix, persistent_topk
  30. # CC-12.x guards). Their launch config is mirrored below.
  31. # PROVENANCE: https://github.com/FujitsuPolycom/glm53-flash-tp2-spark
  32. # (Apache-2.0; see patches/UPSTREAM.md) + forum 381350 #41.
  33. #
  34. # Deviations from their launch script (intentional):
  35. # * no --kda-prefill-backend flashkda (needs their base-image patch — skipped)
  36. # * --kv-cache-dtype fp8_ds_mla instead of `fp8` (same packed layout; this
  37. # spelling is what the NoPE-MLA mod booted with on the LibertAIDAI stack)
  38. # * --language-model-only + no mm-renderer patch/env (text-only)
  39. # * no bundled NCCL/LD_PRELOAD, no NCCL_* fabric block (our switched fabric
  40. # is configured via [nccl.ds4] + launcher GID auto-detect)
  41. # * no --moe-backend marlin: their proven stack uses the default backend for
  42. # THIS quant and reports clean evals. Sanity-check output for token loops
  43. # anyway (the silent FP4 MoE corruption gotcha) before trusting a new node.
  44. # * flashinfer autotune disabled via --kernel-config (their proven boot);
  45. # VLLM_ENGINE_READY_TIMEOUT_S stays high regardless.
  46. #
  47. # Boot success markers (engine log, in order):
  48. # "Model loading took 92.72 GiB" → "[quantprobe] ... algo=MXFP8" (MTP fix
  49. # active; algo=None means broken) → "GPU KV cache size: 1,164,369 tokens" →
  50. # "Application startup complete". ~700 s sequential weight load.
  51. #
  52. # Test request: chat completions need "chat_template_kwargs":{"reasoning_effort"
  53. # :"low"} — omitted/other values select MAX reasoning effort (empty content on
  54. # short max_tokens).
  55. #
  56. # instanttensor loader — baked into the image (Dockerfile step 3) and enabled
  57. # via args + env knobs below. MEASURED 2026-09-03: 631 s total load vs ~700 s
  58. # sequential (lab model resolves TWO passes: target + MTP/draft shards; the
  59. # r12 spark stack loads once in ~5.5 min). Modest gain, worth keeping.
  60. #
  61. # PREREQUISITES: weights cached on both nodes:
  62. # hf download local-inference-lab/GLM-5.3-Flash-NVFP4
  63. engine = "vllm"
  64. name = "GLM-5.3-Flash NVFP4-lab (vLLM, 2x Spark, LAB DFlash2-7)"
  65. docker_image = "glm53-flash-nvfp4-lab:local"
  66. docker_image_dir = "glm53-flash-nvfp4-lab"
  67. model = "local-inference-lab/GLM-5.3-Flash-NVFP4"
  68. parent_model = "zai-org/GLM-5.3-Flash"
  69. required_nodes = 2
  70. tensor_parallel_size = 2
  71. pipeline_parallel_size = 1
  72. distributed_backend = "mp"
  73. shm_size = "32gb"
  74. args = [
  75. # Stable served name — quant-agnostic (shared across glm53 quants)
  76. "--served-model-name", "glm53",
  77. "--trust-remote-code",
  78. "--distributed-executor-backend", "mp",
  79. # GMU is ONLY a startup guardrail here (KV pool is pinned below): 0.90
  80. # demands 109.46 GiB free on GB10's 121.63 GiB, but driver reserve +
  81. # page cache routinely leave ~108.5 -> flaky
  82. # "Free memory ... less than desired" boot deaths (this was the class
  83. # of the old "54-second death"), and post-crash reruns see ~106.6 GiB.
  84. # 0.82 = 99.7 GiB, below any realistic dip; does NOT change what gets
  85. # allocated (weights ~93 + pinned KV 10 + activations).
  86. "--gpu-memory-utilization", "0.82",
  87. # Pinned 10 GiB KV (≈1.16M tokens) — GMU sizing has no headroom at
  88. # 92.72 GiB weights/node; pinning also keeps warmup off the swap path
  89. "--kv-cache-memory-bytes", "10737418240",
  90. "--kv-cache-dtype", "fp8_ds_mla",
  91. "--block-size", "256",
  92. "--max-model-len", "524288",
  93. "--max-num-seqs", "8",
  94. "--max-num-batched-tokens", "4096",
  95. "--enable-chunked-prefill",
  96. "--async-scheduling",
  97. "--enable-prefix-caching",
  98. "--disable-custom-all-reduce",
  99. # Their proven boot: no flashinfer autotune, no CuTe-DSL warmup
  100. "--kernel-config", """
  101. '{"enable_cutedsl_warmup":false,"enable_flashinfer_autotune":false}'""",
  102. # MTP-3 draft from the MXFP8 layer-45 shard (needs modelopt.patch in image)
  103. "--speculative-config", """
  104. '{"method":"dflash","model":"local-inference-lab/GLM-5.3-Flash-DFlash2-bf16-lab","num_speculative_tokens":7}'""",
  105. "--language-model-only",
  106. # MTP + CUDA graphs degrades OUTPUT QUALITY on the glm53 day-0 dev build
  107. # (forum #381350/#44, CONFIRMED by A/B bench 2026-08-28: same seed/flags,
  108. # graphs on = 89/100, eager = 92/100; decode unchanged 28.4 t/s @ c1,
  109. # c2 -7%, TTFT +1.6s). The b12x glm52 stack does NOT need this (its
  110. # graphs+MTP combo benches clean at 100/100) — bug is build-specific.
  111. "--enforce-eager",
  112. # instanttensor loader (0.1.9 baked in image; ~30 s load vs ~700 s NFS)
  113. "--load-format", "instanttensor",
  114. "--tool-call-parser", "glm47",
  115. "--enable-auto-tool-choice",
  116. "--reasoning-parser", "glm45",
  117. ]
  118. [env]
  119. HF_HUB_OFFLINE = "1"
  120. # lab INSTANTTENSOR loader knobs (same values the spark recipe validated:
  121. # lil render BACKEND/CONCURRENCY/IO_DEPTH + lil.yaml BUFFER_SIZE/CHUNK)
  122. INSTANTTENSOR_BACKEND = "BUFFERED"
  123. INSTANTTENSOR_CONCURRENCY = "1"
  124. INSTANTTENSOR_IO_DEPTH = "3"
  125. INSTANTTENSOR_BUFFER_SIZE = "67108864"
  126. INSTANTTENSOR_CHUNK_SIZE = "8388608"
  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. TORCH_USE_RTLD_GLOBAL = "1"
  134. VLLM_NO_USAGE_STATS = "1"
  135. # Architecture (aarch64 / sm_121a DGX Spark)
  136. TORCH_CUDA_ARCH_LIST = "12.1a"
  137. FLASHINFER_CUDA_ARCH_LIST = "12.1f"
  138. CUTE_DSL_ARCH = "sm_121a"
  139. CMAKE_CUDA_ARCHITECTURES = "121"
  140. OMP_NUM_THREADS = "4"