recipe.toml 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # GLM-5.3-Flash on 4× DGX Spark — aiden image with the LAB's own DFlash2
  2. # drafter (local-inference-lab/GLM-5.3-Flash-DFlash2, 1.2 GB, on the shared
  3. # NAS HF) instead of incoai's — the competitive A/B the user asked for:
  4. # same image, same NVFP4 checkpoint, only the speculative model differs.
  5. # (This recipe = glm53-flash-aiden-4x with the drafter swapped.)
  6. #
  7. # PARKED 2026-09-04: with the MXFP8→bf16 dequantized lab drafter the target
  8. # loads clean and the drafter loads (no missing params), but the FIRST draft
  9. # pass at warmup dies in _project_context_kv: "mat1 and mat2 same dtype —
  10. # BFloat16 vs Float8_e4m3fn" (the fused KV-proj weight ends up fp8 at
  11. # runtime — the NVFP4 target's quant config bleeds into the draft's linears,
  12. # and the lab drafter's layout doesn't survive that path; incoai's does).
  13. # The lab drafter belongs to the lab's own vllm fork (newer dflash + aux-
  14. # capture). Revisit with a lab-fork image build.
  15. #
  16. # aiden's production 4-node profile, verbatim translation of
  17. # https://aidenle.com/recipes/glm-5-3-flash-4x-dgx-spark into our 4x launcher
  18. # shape. Reference numbers (his, single stream, idle cluster, thinking off):
  19. # ~84 tok/s decode (FP8, DFlash2 k=7) — NVFP4 +23% (110.7 structured);
  20. # prefill ~2,100 cold; TTFT 4 s @ 8K → 40 s @ 94K; KV 2.25M tokens at 16 GiB
  21. # pin; 393K context verified. Decode flat with context (34/45 KDA layers +
  22. # 11 sparse-MLA @ index_topk 2048).
  23. #
  24. # DFlash2: acceptance 0.5–0.8; k=7 (drafter block 8 − 1 target token); k=6
  25. # wins prose, loses structured. Native MTP fallback (production-1.0 image or
  26. # spec omitted) optimum k=5. ~15 min full relaunch on FP8 (963 s measured).
  27. # FP8-MLA + DFlash2 combination is STRUCTURALLY broken upstream (three trees
  28. # fail differently) — hence plain fp8_e4m3 KV.
  29. #
  30. # NOT READY TO DEPLOY: needs a 4-node cluster (ds4 + 2nodes-dac freed) and the
  31. # unsloth/GLM-5.3-Flash-FP8 checkpoint (328 GB — background download running
  32. # on dgx3, /tmp/dl_fp8.log; ~340 GB free per node required for weights + Triton
  33. # cache). Fabric: RoCE dual-HCA NCCL profile comes from the launcher (config
  34. # [nccl.*] / GID auto-detect) — his NCCL_* env block intentionally omitted.
  35. # NOTE: his launcher unsets VLLM_PREFIX_CACHE_RETENTION_INTERVAL via bash -lc
  36. # before exec; if our boot rejects it in the KV coordinator, add a mods script.
  37. engine = "vllm"
  38. name = "GLM-5.3-Flash aiden image (vLLM, 4x Spark, LAB DFlash2-7, NVFP4)"
  39. docker_image = "sparkrun-vllm-glm53-flash-aiden:glm53"
  40. docker_image_dir = "glm53-flash-aiden"
  41. model = "local-inference-lab/GLM-5.3-Flash-NVFP4"
  42. required_nodes = 4
  43. tensor_parallel_size = 4
  44. pipeline_parallel_size = 1
  45. distributed_backend = "mp"
  46. shm_size = "32gb"
  47. # image ships ENTRYPOINT ["vllm","serve"]; our launcher passes the recipe
  48. # entrypoint as CMD words after the image, which would double it. Empty clears.
  49. entrypoint = []
  50. args = [
  51. "--served-model-name", "glm53",
  52. "--trust-remote-code",
  53. "--reasoning-parser", "glm45",
  54. "--tool-call-parser", "glm47",
  55. "--enable-auto-tool-choice",
  56. "--default-chat-template-kwargs", """
  57. '{"enable_thinking": true, "reasoning_effort": "high"}'""",
  58. "--kv-cache-dtype", "fp8_e4m3",
  59. # "--block-size", "2304",
  60. "--moe-backend", "flashinfer_cutlass",
  61. "--max-model-len", "524288",
  62. "--max-num-batched-tokens", "8192",
  63. "--max-num-seqs", "16",
  64. "--enable-chunked-prefill",
  65. # "--enforce-eager",
  66. "--gpu-memory-utilization", "0.85",
  67. "--kv-cache-memory-bytes", "17179869184",
  68. "--speculative-config", """
  69. '{"method":"mtp","num_speculative_tokens":3}'""",
  70. # "--speculative-config", """
  71. #'{"method":"dflash","model":"local-inference-lab/GLM-5.3-Flash-DFlash2-bf16","num_speculative_tokens":7}'""",
  72. "--language-model-only",
  73. "--load-format", "instanttensor",
  74. # image requests need the mm template shipped/in-wallpaper on aiden's rigs:
  75. # "--chat-template", "<path-to>/chat_template_mm.jinja",
  76. ]
  77. [env]
  78. HF_HUB_OFFLINE = "1"
  79. TRANSFORMERS_OFFLINE = "1"
  80. TORCH_USE_RTLD_GLOBAL = "1"
  81. TORCHINDUCTOR_COMPILE_THREADS = "1"
  82. CUTE_DSL_ARCH = "sm_121a"
  83. TORCH_CUDA_ARCH_LIST = "12.1a"
  84. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  85. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  86. VLLM_ALLOW_LONG_MAX_MODEL_LEN = "1"
  87. VLLM_NO_USAGE_STATS = "1"
  88. OMP_NUM_THREADS = "2"
  89. MAX_JOBS = "2"