recipe.toml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # GLM-5.3-Flash on 2× DGX Spark — aidendle94 sparkrun image (TP=2).
  2. #
  3. # aiden's 4x guide (https://aidenle.com/recipes/glm-5-3-flash-4x-dgx-spark)
  4. # translated to our 2-node ds4 launcher: same image (production-1.2 — SM90
  5. # NoPE-MLA-to-capability-12 route + three functional fixes + DFlash2 overlay),
  6. # same serve flags, TP2 instead of TP4.
  7. #
  8. # Image: aidendle94/sparkrun-vllm-glm53-gb10:production-1.2 (Docker Hub).
  9. # production-1.0 = MTP-only fallback; 1.1 ships the DFlash2 drafter overlay
  10. # (drafter package + aux-capture patch + KV-page LCM patch + backend-registry
  11. # patch); 1.2 adds a fused Triton mHC prefill kernel (post-mix + pre-norm
  12. # GEMM + sinkhorn pre-mix + RMSNorm in one pass; aiden: 1.37x on the mHC
  13. # section at 4K tokens, prefill ≥1024 tokens, hc_mult=4). Same wheel and
  14. # overlays otherwise. VLLM_MHC_FUSED_LARGE=0 reverts to the 1.1 path.
  15. # Grep the log for "B12X PCIe|DFlash" style markers per his guide.
  16. #
  17. # Weights: LibertAIDAI/GLM-5.3-Flash-NVFP4 (194 GB, 97 GiB/node at TP2; cached
  18. # on both nodes). aiden: NVFP4 is ~23% faster than unsloth FP8 (which needs 4
  19. # nodes at 82 GB/rank). Drafter: incoai/GLM-5.3-Flash-DFlash2 (2.34 GB, cached).
  20. # spec k MUST be 7 = block_size(2304? no: drafter block 8) − 1; acceptance
  21. # 0.5–0.8, ~0.15 = broken aux capture (silent).
  22. #
  23. # Memory plan (2x): 97 GiB weights/node + KV pin 4 GiB + eager activations
  24. # ≈ 103 GiB vs GMU 0.85 × 121.63 = 103.4 GiB. If a boot dies on free-memory,
  25. # drop KV pin to 3 GiB or GMU to 0.83. KV pool ≈ 400-600K tokens — fine for
  26. # agent-class benches, NOT for the 393K context the 4x profile serves.
  27. #
  28. # WARNING (from aiden's guide, untested on our 2x boot): the image bakes
  29. # VLLM_PREFIX_CACHE_RETENTION_INTERVAL; his launcher unsets it via bash -lc.
  30. # If the boot rejects the value in the KV coordinator, add a mods script that
  31. # unsets it (ours cannot env-unset across the exec boundary).
  32. #
  33. # Boot markers: "Loading safetensors" (~2-4 min sequential from NVMe) →
  34. # "GPU KV cache size" → "Application startup complete". DFlash2 acceptance
  35. # 0.5-0.8 in SpecDecoding metrics.
  36. engine = "vllm"
  37. name = "GLM-5.3-Flash aiden image (vLLM, 2x Spark, DFlash2-7)"
  38. docker_image = "aidendle94/sparkrun-vllm-glm53-gb10:production-1.2"
  39. model = "LibertAIDAI/GLM-5.3-Flash-NVFP4"
  40. required_nodes = 2
  41. tensor_parallel_size = 2
  42. pipeline_parallel_size = 1
  43. distributed_backend = "mp"
  44. shm_size = "32gb"
  45. # image ships ENTRYPOINT ["vllm","serve"]; our launcher passes the recipe
  46. # entrypoint as CMD words after the image, which would double it. Empty clears.
  47. entrypoint = []
  48. args = [
  49. "--served-model-name", "glm53",
  50. "--trust-remote-code",
  51. # functional parity (silent client gaps in aiden's guide)
  52. "--reasoning-parser", "glm45",
  53. "--tool-call-parser", "glm47",
  54. "--enable-auto-tool-choice",
  55. # aiden ships thinking ON (his default template kwargs)
  56. "--default-chat-template-kwargs", """
  57. '{"enable_thinking": true, "reasoning_effort": "high"}'""",
  58. # the SM90-NoPE + FA2 route: plain fp8 cache, real qk_rope_head_dim=0
  59. "--kv-cache-dtype", "fp8_e4m3",
  60. "--block-size", "2304",
  61. "--moe-backend", "marlin",
  62. "--max-model-len", "393216",
  63. "--max-num-batched-tokens", "8192",
  64. "--max-num-seqs", "16",
  65. "--enable-chunked-prefill",
  66. # deliberate per aiden (graphs neutral at TP4+collective-bound step;
  67. # saves 0.6 GiB + 28 s capture — and we need every GiB on 2 nodes)
  68. "--enforce-eager",
  69. "--gpu-memory-utilization", "0.85",
  70. "--kv-cache-memory-bytes", "4294967296",
  71. "--speculative-config", """
  72. '{"method":"dflash","model":"incoai/GLM-5.3-Flash-DFlash2","num_speculative_tokens":7}'""",
  73. "--language-model-only",
  74. ]
  75. [env]
  76. HF_HUB_OFFLINE = "1"
  77. TRANSFORMERS_OFFLINE = "1"
  78. TORCH_USE_RTLD_GLOBAL = "1"
  79. TORCHINDUCTOR_COMPILE_THREADS = "1"
  80. CUTE_DSL_ARCH = "sm_121a"
  81. TORCH_CUDA_ARCH_LIST = "12.1a"
  82. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  83. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  84. VLLM_ALLOW_LONG_MAX_MODEL_LEN = "1"
  85. VLLM_NO_USAGE_STATS = "1"
  86. OMP_NUM_THREADS = "2"