recipe.toml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # DeepSeek-V4.1-Flash — local-inference-lab r37 (jovian-judgement, 2026-09-13), 4x.
  2. #
  3. # Clone of dsv41-flash-jovian-r36-4x retargeted at the r37 source lock — the
  4. # lab's newest published DS4.1 qualification. r37's headline is a
  5. # kernel-dispatch overhead removal: no more repeated CPU argument-list
  6. # expansion, mutable-schema inspection, scalar dtype allocations or
  7. # tensor-equality calls per dispatch (no quantization or sampling change);
  8. # plus measured B12X projection tiles, four FP32 projection partials, visible
  9. # index-score tiles, a compact mHC prefill config, removed attention-output
  10. # copies and bounded short-index scratch. Their RTX-quartet qualification
  11. # (public-source control -> r37): uncached 32K prefill 14,896 -> 21,399 tok/s
  12. # (+43.65%), C1 output 238.80 -> 281.08 tok/s (+17.70%, budget-50 three-cell
  13. # median), C1 verifier +11.92%, Sieve +8.17%. r37 also corrects the named
  14. # `high` reasoning budget 50 -> 75 (behaviour, not speed — our benches pass
  15. # reasoning_effort explicitly). Carries the B12X small-tile barrier fix (#363)
  16. # and TP3 prefill-head support (TP3 is not serving-qualified here).
  17. #
  18. # Image: our own build for GB10 sm_121a from docker-images/glm53-jovian-r27
  19. # with profile jovian-r37-ds41 (vLLM c687594b8a8 + b12x f1c4e9dd5b1; LMCache
  20. # 29bc5a2e / FlashKDA 3b225bf2 / DeepGEMM 8b1392b9 unchanged; torch 2.13.0 +
  21. # flashinfer 0.6.17 = the same GB10 pins as r35/r36, dep gates re-checked
  22. # against the r37 tree; liburing 2.5 + dev headers already in the apt lock).
  23. # The published lab image is CUDA 13.3 x86 / sm_120 — ours is the documented
  24. # CUDA 13.2 aarch64 / sm_121a deviation.
  25. #
  26. # Serving profile, GB10 deviations and the Engram-on-node-NVMe mechanism are
  27. # unchanged from r36 (see that recipe's header + history/night-shifts/
  28. # 2026-09-12.md "Day follow-up 2/3"): TP4/DCP1, native DSpark K7 (greedy
  29. # draft, standard rejection, adaptive verification), 512K (our floor — their
  30. # 131K qualified profile is not usable for us), GMU 0.88, B12X attn/MoE/linear,
  31. # block 256, instanttensor, Engram table on disk via
  32. # [composed_model].local_files hardlinked from the eugr lane's per-rank sparse
  33. # copies in /var/tmp/engram-local (48 GB real per node, zero extra disk).
  34. #
  35. # Measured reference points (dev65/seed 42, d0 c1):
  36. # r36 + local Engram @512K 154/176 (88), 3,774 pp / 45.7 tg / 822 ms TTFT
  37. # r36 + local Engram @131K 149/176 (85), 3,654 pp / 43.9 tg / 826 ms
  38. # r36 + Engram over NFS 158/176 (90), 401 pp / 33.7 tg / 5,061 ms
  39. # eugr dsv41 prod (K5) 167/176 (95), 1,642 pp / 47.0 tg / 1,738 ms
  40. # What r37 targets: the same r36 profile with their +43% prefill fix. The A/B
  41. # vs the eugr prod decides (quality gap vs speed lead) — plan:
  42. # history/night-shifts/2026-09-13.md.
  43. #
  44. # PREREQUISITE: weights in the shared NAS HF cache; per-node local Engram
  45. # sparse copies under /var/tmp/engram-local/DeepSeek-V4.1-Flash.
  46. engine = "vllm"
  47. name = "DeepSeek-V4.1-Flash (jovian r37 img, 4x DCP1, DSpark K7 greedy + Engram disk)"
  48. docker_image = "jovian-r37-ds41:local"
  49. docker_image_dir = "glm53-jovian-r27"
  50. build_profile = "jovian-r37-ds41"
  51. model = "deepseek-ai/DeepSeek-V4.1-Flash"
  52. parent_model = "deepseek-ai/DeepSeek-V4.1-Flash"
  53. required_nodes = 4
  54. tensor_parallel_size = 4
  55. pipeline_parallel_size = 1
  56. distributed_backend = "mp"
  57. shm_size = "32gb"
  58. # Our r27 build dir images ship with ENTRYPOINT [] — set it explicitly.
  59. entrypoint = ["vllm", "serve"]
  60. args = [
  61. "--served-model-name", "dsv41",
  62. "--trust-remote-code",
  63. "--distributed-executor-backend", "mp",
  64. # GB10 startup-gate value (see header); KV pool is engine-computed from
  65. # the remainder (no pin — their profile pins nothing either).
  66. "--gpu-memory-utilization", "0.88",
  67. # 512K context (our floor — their qualified 131K is not usable for us;
  68. # the KV pool is engine-computed from the memory budget, unchanged):
  69. "--max-model-len", "524288",
  70. "--decode-context-parallel-size", "1",
  71. "--max-num-seqs", "4",
  72. "--max-num-batched-tokens", "4096",
  73. "--prefill-compute-share", "0.4",
  74. "--block-size", "256",
  75. "--enable-chunked-prefill",
  76. "--enable-prefix-caching",
  77. "--kv-cache-dtype", "fp8",
  78. "--attention-backend", "B12X",
  79. "--linear-backend", "b12x",
  80. "--moe-backend", "b12x",
  81. "--compilation-config", """
  82. '{"cudagraph_mode":"FULL_AND_PIECEWISE"}'""",
  83. "--max_cudagraph_capture_size", "128",
  84. # Native DSpark K7 — the draft weights live inside the target checkpoint
  85. # (no separate draft repo). Greedy draft, standard rejection, adaptive
  86. # verification (the lab's r36 qualified trio vs our prod's K5
  87. # probabilistic/block).
  88. "--speculative-config", """
  89. '{"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}'""",
  90. # Engram: the model's 196B learned ngram lookup storage. disk mode =
  91. # io_uring reads of the table rows from the checkpoint dir (bounded
  92. # staging; NOT pinned RAM). cpu_offload stays false (no generic CPU
  93. # model offload).
  94. "--engram-config", """
  95. '{"cpu_offload":false,"table_memory":"disk"}'""",
  96. "--load-format", "instanttensor",
  97. "--safetensors-load-strategy", "lazy",
  98. "--generation-config", "vllm",
  99. "--override-generation-config", """
  100. '{"temperature":1.0,"top_p":0.95}'""",
  101. "--limit-mm-per-prompt", """
  102. '{"image":2}'""",
  103. "--reasoning-parser", "deepseek_v41",
  104. "--tool-call-parser", "deepseek_v41",
  105. "--enable-auto-tool-choice",
  106. "--jit-monitor-mode", "error",
  107. ]
  108. [env]
  109. # Their serve-ds41-jovian.sh runtime env (multi-node-adapted; the launcher
  110. # injects NCCL_SOCKET_IFNAME/IB_HCA/GID + VLLM_HOST_IP per node).
  111. # 2026-09-14 (night shift, operator's typo report): the lab tree's runtime
  112. # LM-head quantization (vocab_parallel_embedding.py) quantizes an unquantized
  113. # LM head to MXFP8 BY DEFAULT (envs.py: VLLM_MXFP8_LM_HEAD, default "1").
  114. # The eugr 2026-09-10 nightly (our prod image) has NO such feature and keeps
  115. # the BF16 head - the coarsened 8-bit vocab-logit layer is the suspected cause
  116. # of the typo-rate regression (close-token logits distorted). Opting out.
  117. VLLM_MXFP8_LM_HEAD = "0"
  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"