recipe.toml 3.7 KB

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