recipe.toml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # DeepSeek-V4.1-Flash — local-inference-lab r36 (jovian-judgement), 4x DCP1.
  2. #
  3. # THE lab's first published DS4.1 lock (qualified 2026-09-12): their image
  4. # localinferencelab/vllm:jovian-judgement-community-20260912-r36 serves GLM
  5. # (r35 lane) + DS4.1 (this recipe) in one two-layer image. We build the same
  6. # source composition for GB10 sm_121a from our own build dir
  7. # (docker-images/glm53-jovian-r27, profile jovian-r36-ds41 — the r36 delta
  8. # over our r35 pins is only vLLM 202a11a98eb + b12x 323107ff + liburing 2.5;
  9. # LMCache/FlashKDA/DeepGEMM/FI/torch are the SAME pins as the r35 build).
  10. #
  11. # Lab DS4.1 serving profile (models/deepseek-v4.1-flash.md, compose +
  12. # serve-ds41-jovian.sh/serve-ds41-flash.sh in the repo): TP4/DCP1, native
  13. # DSpark K7 (draft weights INSIDE the target checkpoint — no separate draft
  14. # download), greedy draft + standard rejection + adaptive verification,
  15. # B12X attention/MoE/linear, 131K context, 4 seqs / 4096 batched, block 256,
  16. # FULL_AND_PIECEWISE graphs capped at 128, InstantTensor, Engram ngram tables
  17. # in disk mode (io_uring; their 188.83 GiB RAM mode cannot fit a GB10 node —
  18. # 121.63 GiB unified pool).
  19. #
  20. # GB10 deviations from the RTX-qualified profile (documented):
  21. # - GMU 0.88 (theirs 0.95 on 96 GB RTX hosts; 0.95 fails GB10's startup
  22. # free-mem gate — the #48140 class, see the glm53 r35 recipe notes).
  23. # - CUTE_DSL_ARCH=sm_121a / arch 12.1a (theirs sm_120a; the published
  24. # image's native extension is sm_120 SASS — ours is built for GB10).
  25. # - NO VLLM_ENABLE_PCIE_ALLREDUCE (theirs is single-host PCIe; on our
  26. # 4-node switch fabric the launcher's NCCL/RoCE env is the transport).
  27. # - Engram disk mode, table on node-local NVMe (see [composed_model]
  28. # below): the NFS read path was the 4.1x prefill collapse (day
  29. # follow-up 2); their 188.83 GiB RAM mode cannot fit a GB10 node
  30. # (121.63 GiB unified pool) either way.
  31. # - VLLM_USE_V2_MODEL_RUNNER/AOT/MEGA_AOT env from their serve script
  32. # (their image bakes them; ours must carry them explicitly).
  33. #
  34. # A/B results (2026-09-13, 4nodes-switch, dev65/seed 42, vs the eugr dsv41
  35. # prod 167/176 / 1,642 pp / 47.0 tg / 1,738 ms TTFT):
  36. # - Engram on NFS: 158/176 (90), 401 pp, 33.7 tg, 5,061 ms TTFT — prefill
  37. # collapse (io_uring row reads over NFS).
  38. # - Engram on local NVMe (this recipe, composed_model.local_files + the
  39. # eugr lane's per-rank sparse copies), 131K: 149/176 (85), 3,654 pp,
  40. # 43.9 tg, 826 ms TTFT. At 512K (our floor): **154/176 (88), 3,774 pp,
  41. # 45.7 tg, 822 ms TTFT, KV 9.62M tokens (18.3x @512K)** — prefill 2.3x
  42. # prod, TTFT 2.1x better, decode −3%. Storage suspect CONFIRMED (9.1x
  43. # prefill vs the NFS run). Quality −13 vs prod = the K7 stack's
  44. # long-horizon cluster (TC-82/85 fail-or-partial in every r36 run,
  45. # TC-60/74 flapping). Status: CANDIDATE lane — best prefill/TTFT in
  46. # the fleet, −13 quality. Full write-up: history/night-shifts/2026-09-12.md
  47. # ("Day follow-up 2" / "3 09-13").
  48. #
  49. # A/B target: the current dsv41 prod (eugr image, DSpark K5 probabilistic,
  50. # 167/176, 1,642 pp / 47.0 tg / 1,738 ms TTFT @d0 c1, 512K, dev65). Same
  51. # bench (tool-eval-bench dev65, seed 42, hardmode, c1/c2) — the clean delta
  52. # isolates the engine stack (K7+adaptive+V2-runner+AOT+b12x-moe vs K5).
  53. engine = "vllm"
  54. name = "DeepSeek-V4.1-Flash (jovian r36 img, 4x DCP1, DSpark K7 greedy + Engram disk)"
  55. docker_image = "jovian-r36-ds41:local"
  56. docker_image_dir = "glm53-jovian-r27"
  57. build_profile = "jovian-r36-ds41"
  58. model = "deepseek-ai/DeepSeek-V4.1-Flash"
  59. parent_model = "deepseek-ai/DeepSeek-V4.1-Flash"
  60. required_nodes = 4
  61. tensor_parallel_size = 4
  62. pipeline_parallel_size = 1
  63. distributed_backend = "mp"
  64. shm_size = "32gb"
  65. # Our r27 build dir images ship with ENTRYPOINT [] — set it explicitly.
  66. entrypoint = ["vllm", "serve"]
  67. args = [
  68. "--served-model-name", "dsv41",
  69. "--trust-remote-code",
  70. "--distributed-executor-backend", "mp",
  71. # GB10 startup-gate value (see header); KV pool is engine-computed from
  72. # the remainder (no pin — their profile pins nothing either).
  73. "--gpu-memory-utilization", "0.88",
  74. # 512K context (our floor — their qualified 131K is not usable for us;
  75. # the KV pool is engine-computed from the memory budget, unchanged):
  76. "--max-model-len", "524288",
  77. "--decode-context-parallel-size", "1",
  78. "--max-num-seqs", "4",
  79. "--max-num-batched-tokens", "4096",
  80. "--prefill-compute-share", "0.4",
  81. "--block-size", "256",
  82. "--enable-chunked-prefill",
  83. "--enable-prefix-caching",
  84. "--kv-cache-dtype", "fp8",
  85. "--attention-backend", "B12X",
  86. "--linear-backend", "b12x",
  87. "--moe-backend", "b12x",
  88. "--compilation-config", """
  89. '{"cudagraph_mode":"FULL_AND_PIECEWISE"}'""",
  90. "--max_cudagraph_capture_size", "128",
  91. # Native DSpark K7 — the draft weights live inside the target checkpoint
  92. # (no separate draft repo). Greedy draft, standard rejection, adaptive
  93. # verification (the lab's r36 qualified trio vs our prod's K5
  94. # probabilistic/block).
  95. "--speculative-config", """
  96. '{"method":"dspark","num_speculative_tokens":7,"draft_tensor_parallel_size":4,"attention_backend":"B12X","draft_sample_method":"greedy","rejection_sample_method":"standard","enable_adaptive_verification":true}'""",
  97. # Engram: the model's 196B learned ngram lookup storage. disk mode =
  98. # io_uring reads of the table rows from the checkpoint dir (bounded
  99. # staging; NOT pinned RAM). cpu_offload stays false (no generic CPU
  100. # model offload).
  101. "--engram-config", """
  102. '{"cpu_offload":false,"table_memory":"disk"}'""",
  103. "--load-format", "instanttensor",
  104. "--safetensors-load-strategy", "lazy",
  105. "--generation-config", "vllm",
  106. "--override-generation-config", """
  107. '{"temperature":1.0,"top_p":0.95}'""",
  108. "--limit-mm-per-prompt", """
  109. '{"image":2}'""",
  110. "--reasoning-parser", "deepseek_v41",
  111. "--tool-call-parser", "deepseek_v41",
  112. "--enable-auto-tool-choice",
  113. "--jit-monitor-mode", "error",
  114. ]
  115. [env]
  116. # Their serve-ds41-jovian.sh runtime env (multi-node-adapted; the launcher
  117. # injects NCCL_SOCKET_IFNAME/IB_HCA/GID + VLLM_HOST_IP per node).
  118. NCCL_NCHANNELS = "16"
  119. NCCL_MIN_NCHANNELS = "16"
  120. NCCL_MAX_NCHANNELS = "16"
  121. NCCL_BUFFSIZE = "2097152"
  122. OMP_NUM_THREADS = "8"
  123. CUDA_DEVICE_MAX_CONNECTIONS = "32"
  124. # GB10 arch (theirs sm_120a on RTX PRO 6000):
  125. CUTE_DSL_ARCH = "sm_121a"
  126. TORCH_CUDA_ARCH_LIST = "12.1a"
  127. # Their V2 model-runner + AOT compile pipeline (baked in their image env):
  128. VLLM_USE_V2_MODEL_RUNNER = "1"
  129. VLLM_USE_AOT_COMPILE = "1"
  130. VLLM_USE_STANDALONE_COMPILE = "1"
  131. VLLM_USE_MEGA_AOT_ARTIFACT = "1"
  132. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  133. VLLM_USE_FLASHINFER_SAMPLER = "1"
  134. VLLM_WORKER_MULTIPROC_METHOD = "spawn"
  135. VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS = "900"
  136. HF_HUB_OFFLINE = "1"
  137. # Deliberately NOT set: VLLM_ENABLE_PCIE_ALLREDUCE (single-host PCIe in
  138. # their profile; cross-node on the switch fabric uses the launcher's NCCL),
  139. # VLLM_HOST_IP (launcher per-node), NCCL_SOCKET_IFNAME (launcher per cluster).
  140. # --- Engram from node-local NVMe, the rest from the shared NAS ---
  141. # [composed_model] (standard launcher feature) builds a per-node /tmp dir:
  142. # the whole DSV4.1 snapshot symlinked into the HF cache + the two 101.5 GB
  143. # Engram table shards (model-00047/00048) HARDLINKED from the pre-existing
  144. # per-rank sparse copies in /var/tmp/engram-local (48 GB real per node, built
  145. # for the eugr/aiden lanes — offset-preserving full-size files, only this
  146. # rank's rows materialized; hardlink = zero extra disk, same fs as /tmp).
  147. # The r36 io_uring PLE reader then reads this rank's table rows from local
  148. # NVMe (no NFS); weights stream from the NAS at load time (one-shot, same as
  149. # prod). Local files run after the repo symlinks and win at the same name.
  150. [composed_model]
  151. mount = "/model"
  152. [[composed_model.sources]]
  153. repo = "deepseek-ai/DeepSeek-V4.1-Flash" # whole snapshot, symlinked into the HF cache
  154. [[composed_model.local_files]] # hardlinks win over the symlinks above
  155. host = "/var/tmp/engram-local/DeepSeek-V4.1-Flash/model-00047-of-00048.safetensors"
  156. [[composed_model.local_files]]
  157. host = "/var/tmp/engram-local/DeepSeek-V4.1-Flash/model-00048-of-00048.safetensors"