recipe.toml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # GLM-5.3-Flash NVFP4-4p67 — local-inference-lab HIGHER-FIDELITY quant (vLLM)
  2. # — 2× DGX Spark, TP=2, MTP-3.
  3. #
  4. # "4p67" ≈ 4.67 bits/weight, KLD ~0.04 vs bf16 — the lab's fidelity-grade
  5. # variant of GLM-5.3-Flash-NVFP4 (our glm53-flash-nvfp4-lab recipe is the
  6. # workhorse). Quant recipe per the model card:
  7. # main model: routed experts NVFP4 (calibrated, ships A4 input scales)
  8. # + attention/shared/indexer MXFP8
  9. # MTP: routed experts NVFP4 A16-only + attention/shared MXFP8
  10. # hf_quant_config declares the routed experts as quant_algo=W4A16_NVFP4 under
  11. # MIXED_PRECISION — i.e. they execute via the Marlin W4A16 GEMM (bf16
  12. # activations), not the A4 path.
  13. # Model: https://huggingface.co/local-inference-lab/GLM-5.3-Flash-NVFP4-4p67
  14. #
  15. # IMAGE: the card says "should be used with local-inference-lab/vllm branch
  16. # dev/jovian-judgement" — every image they publish is amd64-only (RTX PRO
  17. # 6000 world). Our glm53-flash-nvfp4-lab:local base is the same day-0 family
  18. # and verifiably carries the whole required surface (W4A16_NVFP4 linear+MoE
  19. # methods, MIXED_PRECISION config, ModelOptMxFp8LinearMethod all present;
  20. # the FujitsuPolycom patches ride on top), so this quant runs on the SAME
  21. # image as the lab quant — zero extra build. Verified-by-inspection
  22. # 2026-08-29; first boot must pass the token-loop sanity check.
  23. #
  24. # Boot markers (engine log): weight load ~93 GiB/node (≈700 s) →
  25. # "GPU KV cache size: 1,164,369 tokens" → "Application startup complete"
  26. # with the MTP speculator attached. The lab-quant "[quantprobe] ...
  27. # algo=MXFP8" line is NOT expected: this checkpoint's MTP experts are
  28. # W4A16_NVFP4. Watch SpecDecoding acceptance lines (target: len ~3, same
  29. # MTP-3 draft path as the lab quant).
  30. #
  31. # Test request: chat completions need "chat_template_kwargs":{"reasoning_effort"
  32. # :"low"} — omitted/other values select MAX reasoning effort (empty content on
  33. # short max_tokens).
  34. #
  35. # PREREQUISITES: weights cached on both nodes:
  36. # hf download local-inference-lab/GLM-5.3-Flash-NVFP4-4p67
  37. engine = "vllm"
  38. name = "GLM-5.3-Flash NVFP4-4p67 (vLLM, 2x Spark, MTP-3)"
  39. docker_image = "glm53-flash-nvfp4-lab:local"
  40. docker_image_dir = "glm53-flash-nvfp4-lab"
  41. model = "local-inference-lab/GLM-5.3-Flash-NVFP4-4p67"
  42. required_nodes = 2
  43. tensor_parallel_size = 2
  44. pipeline_parallel_size = 1
  45. distributed_backend = "mp"
  46. shm_size = "32gb"
  47. args = [
  48. # Stable served name — quant-agnostic (shared across glm53 quants)
  49. "--served-model-name", "glm53",
  50. "--trust-remote-code",
  51. "--distributed-executor-backend", "mp",
  52. # GMU is superseded by the pinned KV pool; 0.90 as upstream boots with it
  53. "--gpu-memory-utilization", "0.90",
  54. # Pinned 10 GiB KV (≈1.16M tokens) — GMU sizing has no headroom at
  55. # ~93 GiB weights/node; pinning also keeps warmup off the swap path
  56. "--kv-cache-memory-bytes", "10737418240",
  57. "--kv-cache-dtype", "fp8_ds_mla",
  58. "--block-size", "256",
  59. "--max-model-len", "524288",
  60. "--max-num-seqs", "8",
  61. "--max-num-batched-tokens", "4096",
  62. "--enable-chunked-prefill",
  63. "--async-scheduling",
  64. "--enable-prefix-caching",
  65. "--disable-custom-all-reduce",
  66. # Proven lab boot: no flashinfer autotune, no CuTe-DSL warmup
  67. "--kernel-config", """
  68. '{"enable_cutedsl_warmup":false,"enable_flashinfer_autotune":false}'""",
  69. # MTP-3 draft (MTP experts are W4A16_NVFP4 in this checkpoint; needs the
  70. # modelopt.patch MTP-namespace fix baked into the image)
  71. "--speculative-config", """
  72. '{"method":"mtp","num_speculative_tokens":3}'""",
  73. "--language-model-only",
  74. # MTP + CUDA graphs degrades OUTPUT QUALITY on the glm53 day-0 dev build
  75. # (forum #381350/#44, CONFIRMED by A/B bench 2026-08-28: same seed/flags,
  76. # graphs on = 89/100, eager = 92/100). Same build → same guard here;
  77. # re-A/B only if the base image is ever refreshed past the fix.
  78. "--enforce-eager",
  79. "--tool-call-parser", "glm47",
  80. "--enable-auto-tool-choice",
  81. "--reasoning-parser", "glm45",
  82. ]
  83. [env]
  84. HF_HUB_OFFLINE = "1"
  85. # NoPE-MLA rope-pad runtime gate (mod baked into the image)
  86. VLLM_MLA_NOPE_PAD_ROPE = "1"
  87. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  88. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  89. VLLM_USE_AOT_COMPILE = "0"
  90. TORCH_USE_RTLD_GLOBAL = "1"
  91. VLLM_NO_USAGE_STATS = "1"
  92. # Architecture (aarch64 / sm_121a DGX Spark)
  93. TORCH_CUDA_ARCH_LIST = "12.1a"
  94. FLASHINFER_CUDA_ARCH_LIST = "12.1f"
  95. CUTE_DSL_ARCH = "sm_121a"
  96. CMAKE_CUDA_ARCHITECTURES = "121"
  97. OMP_NUM_THREADS = "4"