recipe.toml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # GLM-5.3-Flash NVFP4 — RedHatAI quant (vLLM) — 2× DGX Spark, TP=2.
  2. #
  3. # RedHatAI/LLM-Compressor quant: MoE experts W4A4 NVFP4 (group-16, local
  4. # per-group FP8 scales, compressed-tensors nvfp4-pack-quantized). Vision /
  5. # embeddings / lm_head kept original precision. Quantizes via regex targets,
  6. # so no name-prefix matching bugs.
  7. # Model: https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4
  8. # (~177 GB → ~88 GB/node on 2 Sparks)
  9. # KV: pinned --kv-cache-memory-bytes 10 GiB (same as -lab, identical MLA
  10. # geometry) → ~1.16 M-token pool @ fp8_ds_mla = 2.22× concurrency at the
  11. # 524288 ctx. GMU 0.90 matches the proven lab config; the pin overrides
  12. # GMU-based KV sizing.
  13. #
  14. # MTP (added 2026-09-05): the checkpoint now ships the MTP drafter as
  15. # model_mtp.safetensors (7.6 GB, added to the repo after our 2026-08-28
  16. # index scan that found zero MTP weights) — vendor card section "Enable
  17. # Speculative Decoding" recommends k=5. Cost: +~7.6 GB weights/node on top
  18. # of the 88 GB base; if the boot dies on free-memory or KV shrinks, drop
  19. # the KV pin 10 → 8 GiB. k=3 is the fallback if k=5 regresses quality.
  20. #
  21. # Image: the -lab overlay (day-0 vLLM image + NoPE-MLA mod + FujitsuPolycom
  22. # arch patches). The sparse_attn_indexer CC-12.0 guards are REQUIRED at the
  23. # 512K ctx: at 262K the indexer topk fit 48 SMs, at 512K it wants 62 CTAs and
  24. # the fallback needs 128 KB smem (GB10 has 99 KB) → hard boot abort
  25. # (launch_persistent_topk oversubscribe, 2026-08-28). The patches are
  26. # arch-level, not quant-level: the modelopt quantprobe is a no-op for this
  27. # compressed-tensors checkpoint, the model.py naming shim anchors on
  28. # arch-internal names.
  29. #
  30. # GB10 gotchas handled (see glm53-flash-nvfp4 header for detail):
  31. # --moe-backend marlin → if vLLM rejects marlin for W4A4 at startup (marlin
  32. # is mainly W4A16), remove the flag — but then verify output is not
  33. # token-loop garbage (the silent FLASHINFER_CUTLASS corruption) before
  34. # trusting it; `--moe-backend triton` is the other candidate.
  35. #
  36. # GB10 gotcha (MEASURED): at 524288 ctx WITH flashinfer autotune on, rank 0
  37. # dies mid-boot on a driver OOM (NVRM NV_ERR_NO_MEMORY _memdescAllocInternal,
  38. # 2026-08-28 05:01) — autotune/graph scratch at the 512K verify shapes doesn't
  39. # fit the unified-memory headroom. The 262144 ctx + autotune combo booted
  40. # fine. Fix = the lab-proven boot: autotune + cutedsl warmup off (a perf
  41. # micro-opt only; the sparse-MLA kernels have a non-autotuned fallback) and
  42. # expandable_segments to cut fragmentation.
  43. #
  44. # PREREQUISITES: weights cached on both nodes:
  45. # huggingface-cli download RedHatAI/GLM-5.3-Flash-NVFP4
  46. # (re-run the download on nodes cached before 2026-09-04: model_mtp.safetensors
  47. # 7.6 GB was added to the repo after the initial pulls; HF_HUB_OFFLINE=1 means
  48. # a missing file is a hard load failure)
  49. #
  50. # REFERENCE:
  51. # https://huggingface.co/RedHatAI/GLM-5.3-Flash-NVFP4 (vendor vLLM cmd)
  52. # https://github.com/kingjones30/GLM-5.3-Flash-2x-DGX-Spark (mod)
  53. engine = "vllm"
  54. name = "GLM-5.3-Flash NVFP4-redhat (vLLM, 2x Spark, MTP k=5)"
  55. docker_image = "glm53-flash-nvfp4-lab:local"
  56. docker_image_dir = "glm53-flash-nvfp4-lab"
  57. model = "RedHatAI/GLM-5.3-Flash-NVFP4"
  58. parent_model = "zai-org/GLM-5.3-Flash"
  59. required_nodes = 2
  60. tensor_parallel_size = 2
  61. pipeline_parallel_size = 1
  62. distributed_backend = "mp"
  63. shm_size = "32gb"
  64. args = [
  65. # Stable served name — quant-agnostic (shared across glm53 quants)
  66. "--served-model-name", "glm53",
  67. "--trust-remote-code",
  68. "--distributed-executor-backend", "mp",
  69. # GMU is ONLY a startup guardrail here (KV pool is pinned below): 0.90
  70. # demands 109.46 GiB free on GB10's 121.63 GiB, but driver reserve +
  71. # page cache routinely leave ~108.5 (and ~106.6 after a crashed boot)
  72. # -> flaky "Free memory ... less than desired" boot deaths. 0.82 is
  73. # below any realistic dip and does NOT change what gets allocated.
  74. "--gpu-memory-utilization", "0.82",
  75. "--kv-cache-memory-bytes", "10737418240",
  76. "--max-model-len", "524288",
  77. # Scan/graph scratch scales with the prefill chunk: 8192 OOMs the driver
  78. # at 512K ctx (05:38 NVRM OOM), 4096 is the lab-proven ceiling here.
  79. "--max-num-batched-tokens", "4096",
  80. "--block-size", "256",
  81. "--max-num-seqs", "1",
  82. "--kv-cache-dtype", "fp8_ds_mla",
  83. "--language-model-only",
  84. "--moe-backend", "marlin",
  85. # MTP drafter: model_mtp.safetensors in the main repo (vendor card
  86. # "Enable Speculative Decoding": k=5; no separate drafter repo needed)
  87. "--speculative-config", """
  88. '{"method":"mtp","num_speculative_tokens":5}'""",
  89. "--tool-call-parser", "glm47",
  90. "--enable-auto-tool-choice",
  91. "--reasoning-parser", "glm45",
  92. "--kernel-config", """
  93. '{"enable_cutedsl_warmup":false,"enable_flashinfer_autotune":false}'""",
  94. ]
  95. [env]
  96. HF_HUB_OFFLINE = "1"
  97. VLLM_MLA_NOPE_PAD_ROPE = "1"
  98. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  99. TORCH_CUDA_ARCH_LIST = "12.1a"
  100. CUTE_DSL_ARCH = "sm_121a"
  101. OMP_NUM_THREADS = "4"
  102. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  103. # JIT caches persist per-node across serves (was: cold /root/.cache per
  104. # container -> ~20 min flashinfer/torch recompile every serve). The host
  105. # dirs are shared between lanes of the same arch — each cache
  106. # self-namespaces by its engine version key internally.
  107. [[extra_mounts]]
  108. host = "~/sm121-cache/jit-121f/flashinfer"
  109. container = "/root/.cache/flashinfer"
  110. [[extra_mounts]]
  111. host = "~/sm121-cache/jit-121f/torchinductor"
  112. container = "/root/.cache/torchinductor"
  113. [[extra_mounts]]
  114. host = "~/sm121-cache/jit-121f/vllm"
  115. container = "/root/.cache/vllm"