recipe.toml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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): 149/176 (85), 3,654 pp (2.2x
  40. # prod), 43.9 tg, 826 ms TTFT (2.1x better than prod), KV 3.34M @131K.
  41. # Storage suspect CONFIRMED (prefill 9.1x faster than NFS run). Quality
  42. # 149 = run variance vs the NFS run (11 tool-discipline wobbles); the
  43. # r36-vs-prod gap is the engine stack (K7 vs K5). Status: CANDIDATE lane
  44. # — fastest prefill/TTFT we have, -18 quality vs prod. Full write-up:
  45. # history/night-shifts/2026-09-12.md ("Day follow-up 2 09-13").
  46. #
  47. # A/B target: the current dsv41 prod (eugr image, DSpark K5 probabilistic,
  48. # 167/176, 1,642 pp / 47.0 tg / 1,738 ms TTFT @d0 c1, 512K, dev65). Same
  49. # bench (tool-eval-bench dev65, seed 42, hardmode, c1/c2) — the clean delta
  50. # isolates the engine stack (K7+adaptive+V2-runner+AOT+b12x-moe vs K5).
  51. engine = "vllm"
  52. name = "DeepSeek-V4.1-Flash (jovian r36 img, 4x DCP1, DSpark K7 greedy + Engram disk)"
  53. docker_image = "jovian-r36-ds41:local"
  54. docker_image_dir = "glm53-jovian-r27"
  55. build_profile = "jovian-r36-ds41"
  56. model = "deepseek-ai/DeepSeek-V4.1-Flash"
  57. parent_model = "deepseek-ai/DeepSeek-V4.1-Flash"
  58. required_nodes = 4
  59. tensor_parallel_size = 4
  60. pipeline_parallel_size = 1
  61. distributed_backend = "mp"
  62. shm_size = "32gb"
  63. # Our r27 build dir images ship with ENTRYPOINT [] — set it explicitly.
  64. entrypoint = ["vllm", "serve"]
  65. args = [
  66. "--served-model-name", "dsv41",
  67. "--trust-remote-code",
  68. "--distributed-executor-backend", "mp",
  69. # GB10 startup-gate value (see header); KV pool is engine-computed from
  70. # the remainder (no pin — their profile pins nothing either).
  71. "--gpu-memory-utilization", "0.88",
  72. # 512K context (our floor — their qualified 131K is not usable for us;
  73. # the KV pool is engine-computed from the memory budget, unchanged):
  74. "--max-model-len", "524288",
  75. "--decode-context-parallel-size", "1",
  76. "--max-num-seqs", "4",
  77. "--max-num-batched-tokens", "4096",
  78. "--prefill-compute-share", "0.4",
  79. "--block-size", "256",
  80. "--enable-chunked-prefill",
  81. "--enable-prefix-caching",
  82. "--kv-cache-dtype", "fp8",
  83. "--attention-backend", "B12X",
  84. "--linear-backend", "b12x",
  85. "--moe-backend", "b12x",
  86. "--compilation-config", """
  87. '{"cudagraph_mode":"FULL_AND_PIECEWISE"}'""",
  88. "--max_cudagraph_capture_size", "128",
  89. # Native DSpark K7 — the draft weights live inside the target checkpoint
  90. # (no separate draft repo). Greedy draft, standard rejection, adaptive
  91. # verification (the lab's r36 qualified trio vs our prod's K5
  92. # probabilistic/block).
  93. "--speculative-config", """
  94. '{"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}'""",
  95. # Engram: the model's 196B learned ngram lookup storage. disk mode =
  96. # io_uring reads of the table rows from the checkpoint dir (bounded
  97. # staging; NOT pinned RAM). cpu_offload stays false (no generic CPU
  98. # model offload).
  99. "--engram-config", """
  100. '{"cpu_offload":false,"table_memory":"disk"}'""",
  101. "--load-format", "instanttensor",
  102. "--safetensors-load-strategy", "lazy",
  103. "--generation-config", "vllm",
  104. "--override-generation-config", """
  105. '{"temperature":1.0,"top_p":0.95}'""",
  106. "--limit-mm-per-prompt", """
  107. '{"image":2}'""",
  108. "--reasoning-parser", "deepseek_v41",
  109. "--tool-call-parser", "deepseek_v41",
  110. "--enable-auto-tool-choice",
  111. "--jit-monitor-mode", "error",
  112. ]
  113. [env]
  114. # Their serve-ds41-jovian.sh runtime env (multi-node-adapted; the launcher
  115. # injects NCCL_SOCKET_IFNAME/IB_HCA/GID + VLLM_HOST_IP per node).
  116. NCCL_NCHANNELS = "16"
  117. NCCL_MIN_NCHANNELS = "16"
  118. NCCL_MAX_NCHANNELS = "16"
  119. NCCL_BUFFSIZE = "2097152"
  120. OMP_NUM_THREADS = "8"
  121. CUDA_DEVICE_MAX_CONNECTIONS = "32"
  122. # GB10 arch (theirs sm_120a on RTX PRO 6000):
  123. CUTE_DSL_ARCH = "sm_121a"
  124. TORCH_CUDA_ARCH_LIST = "12.1a"
  125. # Their V2 model-runner + AOT compile pipeline (baked in their image env):
  126. VLLM_USE_V2_MODEL_RUNNER = "1"
  127. VLLM_USE_AOT_COMPILE = "1"
  128. VLLM_USE_STANDALONE_COMPILE = "1"
  129. VLLM_USE_MEGA_AOT_ARTIFACT = "1"
  130. VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
  131. VLLM_USE_FLASHINFER_SAMPLER = "1"
  132. VLLM_WORKER_MULTIPROC_METHOD = "spawn"
  133. VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS = "900"
  134. HF_HUB_OFFLINE = "1"
  135. # Deliberately NOT set: VLLM_ENABLE_PCIE_ALLREDUCE (single-host PCIe in
  136. # their profile; cross-node on the switch fabric uses the launcher's NCCL),
  137. # VLLM_HOST_IP (launcher per-node), NCCL_SOCKET_IFNAME (launcher per cluster).
  138. # --- Engram from node-local NVMe, the rest from the shared NAS ---
  139. # [composed_model] (standard launcher feature) builds a per-node /tmp dir:
  140. # the whole DSV4.1 snapshot symlinked into the HF cache + the two 101.5 GB
  141. # Engram table shards (model-00047/00048) HARDLINKED from the pre-existing
  142. # per-rank sparse copies in /var/tmp/engram-local (48 GB real per node, built
  143. # for the eugr/aiden lanes — offset-preserving full-size files, only this
  144. # rank's rows materialized; hardlink = zero extra disk, same fs as /tmp).
  145. # The r36 io_uring PLE reader then reads this rank's table rows from local
  146. # NVMe (no NFS); weights stream from the NAS at load time (one-shot, same as
  147. # prod). Local files run after the repo symlinks and win at the same name.
  148. [composed_model]
  149. mount = "/model"
  150. [[composed_model.sources]]
  151. repo = "deepseek-ai/DeepSeek-V4.1-Flash" # whole snapshot, symlinked into the HF cache
  152. [[composed_model.local_files]] # hardlinks win over the symlinks above
  153. host = "/var/tmp/engram-local/DeepSeek-V4.1-Flash/model-00047-of-00048.safetensors"
  154. [[composed_model.local_files]]
  155. host = "/var/tmp/engram-local/DeepSeek-V4.1-Flash/model-00048-of-00048.safetensors"