recipe.toml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # GLM-5.3-Flash NVFP4 — eugr B12X full-cluster variant (vLLM) — 2× DGX Spark, TP=2.
  2. #
  3. # PRODUCTION DEFAULT for the eugr stack: run this 2x lane until the 4x test
  4. # variant (recipes/glm53-flash-nvfp4-eugr-4x) delivers a dramatic
  5. # improvement (night shift compares them).
  6. #
  7. # Port of eugr's dual-Spark recipe (eugr/spark-vllm-docker @ 94b3c30,
  8. # 2026-09-04, recipes/glm-5.3-flash.yaml) onto our launcher, on their
  9. # prebuilt image. A/B cell against our r18 fork build: same lab branch line
  10. # (dev/jovian-judgement) — their image = 09-04 tip + lukealonso/b12x master
  11. # + their patch set; our r18 pin = 09-05 tip + lab b12x + eugr-derived
  12. # patches. Compare quality (hardmode) + decode + TTFT before trusting either.
  13. #
  14. # Image: eugr/spark-vllm-b12x:nightly-20260904 (digest c3b44d3f…, = :latest).
  15. # Built from local-inference-lab/vllm dev/jovian-judgement (their e91bc76,
  16. # 2026-09-03, switched the ref from dev/infernal-invocation) +
  17. # lukealonso/b12x @ master; torch 2.13.0, CUDA 13.0.2,
  18. # nvidia-cutlass-dsl 4.7.0; their docker/patch_vllm_*.py set +
  19. # instanttensor + fastsafetensors; system-NCCL symlink fix. Exact b12x
  20. # commit baked in-image: /workspace/b12x-source-commit (+ build-metadata.yaml).
  21. # NOTE: the image ships NO ENTRYPOINT — this recipe must carry
  22. # entrypoint = ["vllm","serve"] (unlike the sparkrun/aiden images).
  23. #
  24. # Model: local-inference-lab/GLM-5.3-Flash-NVFP4-Spark (their recipe's model —
  25. # NOT the GLM-5.3-NVFP4-Spark repo the aiden lane uses). ~180 GB class:
  26. # huggingface-cli download on BOTH nodes before the first serve
  27. # (HF_HUB_OFFLINE=1 below).
  28. #
  29. # What this lane tests (vs our r17/r18 findings):
  30. # - FULL b12x cluster: --attention-backend B12X + --moe-backend b12x +
  31. # --linear-backend b12x. On our r17 image, --linear-backend b12x was THE
  32. # quality TOXIN (44/100 hardmode). Their 09-04 b12x predates the SM121
  33. # A16-precision commits, so the answer is open — measure, don't trust.
  34. # - RoCEnante one-shot RoCE collectives: VLLM_ENABLE_ROCE_ALLREDUCE=1
  35. # (their vllm #597 / b12x #295 pair; −5–19% decode per-step,
  36. # +15–23% c16 measured on 4× Spark TP4).
  37. # - MTP k=5 with drafter moe_backend=humming + B12X attention (vendor-card
  38. # parity), AOT=1 + MEGA_AOT=1 + V2 runner, mamba-cache-mode align,
  39. # instanttensor buffered loader, prefix caching ON (we run prefix-cache
  40. # off elsewhere — perf-relevant, not quality-relevant).
  41. #
  42. # Deliberate parity deviations from our house lanes:
  43. # - NO --language-model-only (their recipe loads the vision tower; add the
  44. # flag only if memory is tight)
  45. # - --kv-cache-dtype fp8 (plain), not fp8_ds_mla
  46. # - no --decode-context-parallel-size (their DCP=1 is the default; no-op)
  47. # - NCCL/cluster env comes from the launcher (their NCCL_* block omitted)
  48. #
  49. # REFERENCE:
  50. # https://github.com/eugr/spark-vllm-docker (recipes/glm-5.3-flash.yaml)
  51. # https://hub.docker.com/r/eugr/spark-vllm-b12x/tags
  52. # https://forums.developer.nvidia.com/t/381350/364 — public confirmation of
  53. # this flag set (2026-09-05, tea24864 on 4x/TP4, perf-only: ~60 tok/s c1,
  54. # ~73 c4 decode, prefill 2.3-2.8k tok/s) + the DFlash2 alternative spec
  55. # ("method":"dflash" + "incoai/GLM-5.3-Flash-DFlash2" drafter, k=7, see
  56. # night queue 3b)
  57. engine = "vllm"
  58. name = "GLM-5.3-Flash NVFP4 eugr B12X (vLLM, 2x Spark, MTP k=5, RoCE)"
  59. docker_image = "eugr/spark-vllm-b12x:nightly-20260904"
  60. model = "local-inference-lab/GLM-5.3-Flash-NVFP4-Spark"
  61. required_nodes = 2
  62. tensor_parallel_size = 2
  63. pipeline_parallel_size = 1
  64. distributed_backend = "mp"
  65. shm_size = "32gb"
  66. # image ships no ENTRYPOINT — the launcher supplies the vllm command
  67. entrypoint = ["vllm", "serve"]
  68. args = [
  69. # Stable served name — quant-agnostic (shared across glm53 quants)
  70. "--served-model-name", "glm53",
  71. "--trust-remote-code",
  72. "--distributed-executor-backend", "mp",
  73. # eugr parity: FULL b12x cluster (linear-b12x = the r17 quality toxin —
  74. # measure before trusting)
  75. "--attention-backend", "B12X",
  76. "--moe-backend", "b12x",
  77. "--linear-backend", "b12x",
  78. "--mamba-cache-mode", "align",
  79. "--enable-prefix-caching",
  80. "--enable-chunked-prefill",
  81. "--dtype", "bfloat16",
  82. "--kv-cache-dtype", "fp8",
  83. "--quantization", "modelopt_mixed",
  84. "--no-enable-flashinfer-autotune",
  85. "--load-format", "instanttensor",
  86. "--model-loader-extra-config", """
  87. '{"instanttensor_copy":false}'""",
  88. "--block-size", "256",
  89. "--max-model-len", "1048576",
  90. "--max-num-seqs", "4",
  91. "--max-num-batched-tokens", "4096",
  92. # MTP k=5 (eugr recipe / vendor card); drafter on humming MoE + B12X attn
  93. "--speculative-config", """
  94. '{"method":"mtp","num_speculative_tokens":5,"moe_backend":"humming","attention_backend":"B12X"}'""",
  95. "--reasoning-parser", "glm45",
  96. "--tool-call-parser", "glm47",
  97. "--enable-auto-tool-choice",
  98. "--kv-cache-memory-bytes", "10737418240",
  99. "--gpu-memory-utilization", "0.87",
  100. ]
  101. [env]
  102. HF_HUB_OFFLINE = "1"
  103. VLLM_ENGINE_READY_TIMEOUT_S = "3600"
  104. PYTORCH_CUDA_ALLOC_CONF = "expandable_segments:True"
  105. CUTE_DSL_ARCH = "sm_121a"
  106. SAFETENSORS_FAST_GPU = "1"
  107. # RoCEnante one-shot RoCE collectives (ON in eugr's recipe; off-by-default flag)
  108. VLLM_ENABLE_ROCE_ALLREDUCE = "1"
  109. VLLM_ROCE_ALLREDUCE_MAX_SIZE = "2MB"
  110. VLLM_ENABLE_PCIE_ALLREDUCE = "0"
  111. VLLM_WORKER_MULTIPROC_METHOD = "spawn"
  112. VLLM_SSM_CONV_STATE_LAYOUT = "DS"
  113. VLLM_USE_AOT_COMPILE = "1"
  114. VLLM_USE_MEGA_AOT_ARTIFACT = "1"
  115. VLLM_USE_V2_MODEL_RUNNER = "1"
  116. B12X_POLICY_MODE = "auto"
  117. # instanttensor buffered loader (eugr's defaults)
  118. INSTANTTENSOR_BACKEND = "BUFFERED"
  119. INSTANTTENSOR_BUFFER_SIZE = "67108864"
  120. INSTANTTENSOR_CHUNK_SIZE = "8388608"
  121. INSTANTTENSOR_CONCURRENCY = "1"
  122. INSTANTTENSOR_IO_DEPTH = "3"
  123. # JIT caches persist per-node across serves (was: cold /root/.cache per
  124. # container -> ~20 min flashinfer/torch recompile every serve). The host
  125. # dirs are shared between lanes of the same arch — each cache
  126. # self-namespaces by its engine version key internally.
  127. [[extra_mounts]]
  128. host = "~/sm121-cache/jit-121f/flashinfer"
  129. container = "/root/.cache/flashinfer"
  130. [[extra_mounts]]
  131. host = "~/sm121-cache/jit-121f/torchinductor"
  132. container = "/root/.cache/torchinductor"
  133. [[extra_mounts]]
  134. host = "~/sm121-cache/jit-121f/vllm"
  135. container = "/root/.cache/vllm"