2026-09-13_104409_dev65-engram-local.recipe.toml 7.5 KB

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