recipe.toml 3.5 KB

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