recipe.toml 5.9 KB

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