recipe.toml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # GLM-5.3-Flash NVFP4 (vLLM) — 2× DGX Spark / GB10 (sm_121), TP=2.
  2. #
  3. # 320B/18B-active, hybrid 34 KDA linear-attention + 11 sparse-MLA layers,
  4. # glm5_next arch (NoPE-MLA, qk_rope_head_dim=0), in-checkpoint MTP head.
  5. # Text-only here (--language-model-only — the multimodal processor balloons
  6. # the API front-end to ~15.7 GB and the GB10 kernel OOM-kills it).
  7. #
  8. # WHY NVFP4 on 2 nodes (not the official FP8 on 4): LibertAIDAI's weight-only
  9. # NVFP4-A16 quant halves the footprint (~155 GB) so it fits 2 Sparks; the
  10. # sparse+linear attention keeps KV nearly free (KV pool ~738K tok at GMU 0.85).
  11. # Model: https://huggingface.co/LibertAIDAI/GLM-5.3-Flash-NVFP4
  12. #
  13. # Engine: vLLM day-0 per-model image (glm5_next support baked in). The arch
  14. # fails every sm_121 attention backend out of the box; a 4-part build-time
  15. # mod (docker-images/glm53-flash-nvfp4/patches/patch_mla.py) dresses GLM's
  16. # NoPE-MLA in DeepSeek's fp8_ds_mla 512+64 layout and compacts the sm120
  17. # sparse-MLA topk table 2176->2048. Applied at image build; this recipe
  18. # activates it at runtime via VLLM_MLA_NOPE_PAD_ROPE=1.
  19. #
  20. # TWO SILENT GB10 GOTCHAS (from the reference — both already handled here):
  21. # 1. SILENT FP4 MoE CORRUPTION: the auto-selected FLASHINFER_CUTLASS NVFP4
  22. # MoE backend emits degenerate token loops with ZERO errors (model loads,
  23. # /health green, every completion garbage). --moe-backend marlin fixes it.
  24. # If a GB10 NVFP4 serve "works" but loops, check which MoE backend engaged
  25. # before blaming the quant.
  26. # 2. A 60+ MIN "No available shared memory broadcast block found" loop at
  27. # boot is NOT a hang — the worker is FlashInfer-autotuning a kernel flavor
  28. # (tune persists to ~/.cache/vllm, pays once). VLLM_ENGINE_READY_TIMEOUT_S
  29. # is raised to 3600 so the launcher doesn't give up first.
  30. #
  31. # Measured (median of 3, temp 0, single stream, 2x Spark, MTP-5 acceptance ~2.55):
  32. # 24.74 code / 30.30 structured / 19.58 prose tok/s; no-spec baseline 14.6 flat.
  33. # 256K needle-exact (30K/100K/200K deep); ~1150 tok/s prefill.
  34. #
  35. # Image: glm53-flash-nvfp4:local (built from vllm/vllm-openai:glm53-flash-arm64-cu130
  36. # + the patch). `sm121 serve` builds it on the build node if the checksum label
  37. # is stale (docker_image_dir below).
  38. #
  39. # PREREQUISITES:
  40. # Weights cached on both nodes (NAS ~/.cache/huggingface):
  41. # huggingface-cli download LibertAIDAI/GLM-5.3-Flash-NVFP4
  42. #
  43. # REFERENCE (provenance):
  44. # https://github.com/kingjones30/GLM-5.3-Flash-2x-DGX-Spark
  45. # https://forums.developer.nvidia.com/t/381433
  46. engine = "vllm"
  47. name = "GLM-5.3-Flash NVFP4 (vLLM, 2x Spark)"
  48. docker_image = "glm53-flash-nvfp4:local"
  49. docker_image_dir = "glm53-flash-nvfp4"
  50. model = "LibertAIDAI/GLM-5.3-Flash-NVFP4"
  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. # GLM tokenizer
  60. "--trust-remote-code",
  61. # Executor (mp, no ray)
  62. "--distributed-executor-backend", "mp",
  63. # Memory — weights ~77.5 GiB of 119.6 GiB/node; sparse+linear KV nearly free
  64. "--gpu-memory-utilization", "0.85",
  65. "--max-model-len", "262144",
  66. "--max-num-seqs", "1",
  67. # DeepSeek-MLA KV layout the NoPE-pad mod dresses the attention in
  68. "--kv-cache-dtype", "fp8_ds_mla",
  69. # Text-only (multimodal processor OOM-kills the GB10 front-end)
  70. "--language-model-only",
  71. # GOTCHA 1: marlin avoids the silent FP4 MoE corruption
  72. "--moe-backend", "marlin",
  73. # MTP=5 (in-checkpoint drafter; acceptance length ~2.55)
  74. "--speculative-config", """
  75. '{"method":"mtp","num_speculative_tokens":5}'""",
  76. # Tokenizer / reasoning / tool calling (GLM family)
  77. "--tool-call-parser", "glm47",
  78. "--enable-auto-tool-choice",
  79. "--reasoning-parser", "glm45",
  80. ]
  81. [env]
  82. # Offline — weights must be cached on each node
  83. HF_HUB_OFFLINE = "1"
  84. # Activates the build-time NoPE-MLA rope-pad mod (mathematically a no-op:
  85. # zeros are rotation-free and add exactly 0 to every logit)
  86. VLLM_MLA_NOPE_PAD_ROPE = "1"
  87. # GOTCHA 2: survive the 60+ min FlashInfer-autotune boot window
  88. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  89. # Architecture (aarch64 / sm_121a DGX Spark)
  90. TORCH_CUDA_ARCH_LIST = "12.1a"
  91. CUTE_DSL_ARCH = "sm_121a"
  92. OMP_NUM_THREADS = "4"