recipe.toml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. parent_model = "zai-org/GLM-5.3-Flash"
  41. required_nodes = 2
  42. tensor_parallel_size = 2
  43. pipeline_parallel_size = 1
  44. distributed_backend = "mp"
  45. shm_size = "32gb"
  46. # image ships ENTRYPOINT ["vllm","serve"]; our launcher passes the recipe
  47. # entrypoint as CMD words after the image, which would double it. Empty clears.
  48. entrypoint = []
  49. args = [
  50. "--served-model-name", "glm53",
  51. "--trust-remote-code",
  52. # functional parity (silent client gaps in aiden's guide)
  53. "--reasoning-parser", "glm45",
  54. "--tool-call-parser", "glm47",
  55. "--enable-auto-tool-choice",
  56. # aiden ships thinking ON (his default template kwargs)
  57. "--default-chat-template-kwargs", """
  58. '{"enable_thinking": true, "reasoning_effort": "high"}'""",
  59. # the SM90-NoPE + FA2 route: plain fp8 cache, real qk_rope_head_dim=0
  60. "--kv-cache-dtype", "fp8_e4m3",
  61. "--block-size", "2304",
  62. "--moe-backend", "marlin",
  63. "--max-model-len", "393216",
  64. "--max-num-batched-tokens", "8192",
  65. "--max-num-seqs", "16",
  66. "--enable-chunked-prefill",
  67. # deliberate per aiden (graphs neutral at TP4+collective-bound step;
  68. # saves 0.6 GiB + 28 s capture — and we need every GiB on 2 nodes)
  69. "--enforce-eager",
  70. "--gpu-memory-utilization", "0.85",
  71. "--kv-cache-memory-bytes", "4294967296",
  72. "--speculative-config", """
  73. '{"method":"dflash","model":"incoai/GLM-5.3-Flash-DFlash2","num_speculative_tokens":7}'""",
  74. "--language-model-only",
  75. ]
  76. [env]
  77. HF_HUB_OFFLINE = "1"
  78. TRANSFORMERS_OFFLINE = "1"
  79. TORCH_USE_RTLD_GLOBAL = "1"
  80. TORCHINDUCTOR_COMPILE_THREADS = "1"
  81. CUTE_DSL_ARCH = "sm_121a"
  82. TORCH_CUDA_ARCH_LIST = "12.1a"
  83. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  84. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  85. VLLM_ALLOW_LONG_MAX_MODEL_LEN = "1"
  86. VLLM_NO_USAGE_STATS = "1"
  87. OMP_NUM_THREADS = "2"