Explorar o código

dsv41 lab r36: build profile (jovian-r36-ds41: vLLM 202a11a98eb + b12x 323107ff + liburing 2.5, rest = r35 pins) + 4x DCP1 recipe (DSpark K7 greedy, Engram disk, their qualified profile, GB10 deviations documented)

Alexander Korolev hai 1 mes
pai
achega
1d6625344d

+ 6 - 0
docker-images/glm53-jovian-r27/locks/apt-packages.txt

@@ -33,3 +33,9 @@ python3-dev=3.12.3-0ubuntu2.1
 python3-pip=24.0+dfsg-1ubuntu1.3
 unzip=6.0-28ubuntu4.1
 wget=1.21.4-1ubuntu4.1
+
+# --- Engram ngram table reads (DS4.1 r36: io_uring disk mode) ---
+# Their runtime.lock pins liburing 2.5 (2.5-1build1). Runtime-only (no
+# -dev): the r36 tree's Engram disk mode does io_uring reads of the model's
+# learned ngram tables.
+liburing2=2.5-1build1

+ 47 - 0
docker-images/glm53-jovian-r27/profiles/jovian-r36-ds41.env

@@ -0,0 +1,47 @@
+# Version profile: DeepSeek-V4.1-Flash r36 (jovian-judgement, qualified 2026-09-12).
+#
+# The lab's FIRST published DS4.1 lock: rtx6kpro models/deepseek-v4.1-flash.md
+# ("Status: qualified" for TP4/DCP1 startup, seeded sampling, text/Vision
+# smoke, bounded throughput; image localinferencelab/vllm:
+# jovian-judgement-community-20260912-r36 @ sha256:23ab683d...). The DS4.1
+# serving profile is native DSpark K7 (weights inside the target checkpoint,
+# greedy draft, standard rejection, adaptive verification), B12X
+# attention/MoE/linear, 131K context, Engram ngram storage RAM/disk.
+#
+# The image is two-layer: the GLM entrypoint (our r35 lane) + the DS4.1
+# entrypoint (serve-ds41-jovian.sh over the bundled serve-ds41-flash.sh).
+# We build the same source composition here for GB10 sm_121a (the published
+# image's native extension is compiled for sm_120 / CUDA 13.3 x86).
+#
+# Pinned by commit + tree hash (gated per repo in the Dockerfile). What moved
+# over the r35 profile (glm53-r35.env):
+#   vLLM  de982a50 -> 202a11a98eb (JJ b40673cd + #740 startup correction;
+#         0.26.1rc0+glm53.r36.vllm202a11a9; adds the DS4.1 DSpark/Engram
+#         serving path, greedy-Markov sampler fusion #738)
+#   B12X  98086604 -> 323107ff (clean master; includes the DS4.1 native
+#         kernels)
+#   LMCache 29bc5a2e — UNCHANGED (same as r35)
+#   FlashKDA 3b225bf2 + in-tree patch — UNCHANGED
+#   DeepGEMM 8b1392b9 (nv_dev) — UNCHANGED (verified in the r36 tree's
+#     tools/install_deepgemm.sh + cmake/external_projects/deepgemm.cmake)
+#   requirements/cuda.txt (r36 tree) — torch 2.13.0, flashinfer 0.6.17:
+#     SAME as our r35 GB10 pins (CUDA 13.2 aarch64 / cu130 base, documented
+#     deviation from their cu133 x86 runtime).
+# NEW: liburing 2.5 (apt, locks/apt-packages.txt) — io_uring reads for the
+# DS4.1 Engram ngram tables in disk mode (their runtime.liburing pin).
+VLLM_PIN=202a11a98eb360b73552586f2b5c5880cbd48c8c
+VLLM_TREE=e20d152fa6972a4a7e624e74d198403fccb7af73
+VLLM_PRETEND_VERSION=0.26.1rc0+glm53.r36.vllm202a11a9
+
+B12X_PIN=323107ff948ca532f1f7c793b4b550c30ba5212b
+B12X_TREE=18cb59ec640a5cb8d624bebfc81b919fee88340b
+B12X_PRETEND_VERSION=0.1.dev0+glm53b12x.r36.323107ff
+
+LMCACHE_PIN=29bc5a2efde737c436b04499eb62cd1776cebeec
+LMCACHE_TREE=5a88a1ea9d2627c76288d056e7193f7454669b64
+LMCACHE_VERSION=0.5.5.dev0+glm53checkpoints.29bc5a2e
+
+# Same r35 behavior: empty on purpose — the r36 tree gates FlashKDA on the
+# packed-checkpoint API and applies its own in-tree patch (same pin 3b225bf2
+# as r35; our r27 unpatched checkout would fail the gate).
+FLASH_KDA_SRC_DIR=

+ 126 - 0
recipes/dsv41-flash-jovian-r36-4x/recipe.toml

@@ -0,0 +1,126 @@
+# DeepSeek-V4.1-Flash — local-inference-lab r36 (jovian-judgement), 4x DCP1.
+#
+# THE lab's first published DS4.1 lock (qualified 2026-09-12): their image
+# localinferencelab/vllm:jovian-judgement-community-20260912-r36 serves GLM
+# (r35 lane) + DS4.1 (this recipe) in one two-layer image. We build the same
+# source composition for GB10 sm_121a from our own build dir
+# (docker-images/glm53-jovian-r27, profile jovian-r36-ds41 — the r36 delta
+# over our r35 pins is only vLLM 202a11a98eb + b12x 323107ff + liburing 2.5;
+# LMCache/FlashKDA/DeepGEMM/FI/torch are the SAME pins as the r35 build).
+#
+# Lab DS4.1 serving profile (models/deepseek-v4.1-flash.md, compose +
+# serve-ds41-jovian.sh/serve-ds41-flash.sh in the repo): TP4/DCP1, native
+# DSpark K7 (draft weights INSIDE the target checkpoint — no separate draft
+# download), greedy draft + standard rejection + adaptive verification,
+# B12X attention/MoE/linear, 131K context, 4 seqs / 4096 batched, block 256,
+# FULL_AND_PIECEWISE graphs capped at 128, InstantTensor, Engram ngram tables
+# in disk mode (io_uring; their 188.83 GiB RAM mode cannot fit a GB10 node —
+# 121.63 GiB unified pool).
+#
+# GB10 deviations from the RTX-qualified profile (documented):
+#   - GMU 0.88 (theirs 0.95 on 96 GB RTX hosts; 0.95 fails GB10's startup
+#     free-mem gate — the #48140 class, see the glm53 r35 recipe notes).
+#   - CUTE_DSL_ARCH=sm_121a / arch 12.1a (theirs sm_120a; the published
+#     image's native extension is sm_120 SASS — ours is built for GB10).
+#   - NO VLLM_ENABLE_PCIE_ALLREDUCE (theirs is single-host PCIe; on our
+#     4-node switch fabric the launcher's NCCL/RoCE env is the transport).
+#   - Engram disk mode on the shared NAS: our current dsv41 prod already
+#     runs this checkpoint with Engram-on-disk over the same NFS, so the
+#     storage path is proven; their liburing io_uring fast path is the new
+#     bit (falls through to normal reads if the kernel/NFS combo refuses).
+#   - VLLM_USE_V2_MODEL_RUNNER/AOT/MEGA_AOT env from their serve script
+#     (their image bakes them; ours must carry them explicitly).
+#
+# A/B target: the current dsv41 prod (eugr image, DSpark K5 probabilistic,
+# 167/176, 1,642 pp / 47.0 tg / 1,738 ms TTFT @d0 c1, 512K, dev65). Same
+# bench (tool-eval-bench dev65, seed 42, hardmode, c1/c2) — the clean delta
+# isolates the engine stack (K7+adaptive+V2-runner+AOT+b12x-moe vs K5).
+
+engine = "vllm"
+name = "DeepSeek-V4.1-Flash (jovian r36 img, 4x DCP1, DSpark K7 greedy + Engram disk)"
+docker_image = "jovian-r36-ds41:local"
+docker_image_dir = "glm53-jovian-r27"
+build_profile = "jovian-r36-ds41"
+model = "deepseek-ai/DeepSeek-V4.1-Flash"
+parent_model = "deepseek-ai/DeepSeek-V4.1-Flash"
+required_nodes = 4
+tensor_parallel_size = 4
+pipeline_parallel_size = 1
+distributed_backend = "mp"
+shm_size = "32gb"
+# Our r27 build dir images ship with ENTRYPOINT [] — set it explicitly.
+entrypoint = ["vllm", "serve"]
+
+args = [
+    "--served-model-name", "dsv41",
+    "--trust-remote-code",
+    "--distributed-executor-backend", "mp",
+    # GB10 startup-gate value (see header); KV pool is engine-computed from
+    # the remainder (no pin — their profile pins nothing either).
+    "--gpu-memory-utilization", "0.88",
+    # Their qualified DS4.1 profile (RTX quartet, TP4/DCP1, 131K):
+    "--decode-context-parallel-size", "1",
+    "--max-model-len", "131072",
+    "--max-num-seqs", "4",
+    "--max-num-batched-tokens", "4096",
+    "--prefill-compute-share", "0.4",
+    "--block-size", "256",
+    "--enable-chunked-prefill",
+    "--enable-prefix-caching",
+    "--kv-cache-dtype", "fp8",
+    "--attention-backend", "B12X",
+    "--linear-backend", "b12x",
+    "--moe-backend", "b12x",
+    "--compilation-config", """
+'{"cudagraph_mode":"FULL_AND_PIECEWISE"}'""",
+    "--max_cudagraph_capture_size", "128",
+    # Native DSpark K7 — the draft weights live inside the target checkpoint
+    # (no separate draft repo). Greedy draft, standard rejection, adaptive
+    # verification (the lab's r36 qualified trio vs our prod's K5
+    # probabilistic/block).
+    "--speculative-config", """
+'{"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}'""",
+    # Engram: the model's 196B learned ngram lookup storage. disk mode =
+    # io_uring reads of the table rows from the checkpoint dir (bounded
+    # staging; NOT pinned RAM). cpu_offload stays false (no generic CPU
+    # model offload).
+    "--engram-config", """
+'{"cpu_offload":false,"table_memory":"disk"}'""",
+    "--load-format", "instanttensor",
+    "--safetensors-load-strategy", "lazy",
+    "--generation-config", "vllm",
+    "--override-generation-config", """
+'{"temperature":1.0,"top_p":0.95}'""",
+    "--limit-mm-per-prompt", """
+'{"image":2}'""",
+    "--reasoning-parser", "deepseek_v41",
+    "--tool-call-parser", "deepseek_v41",
+    "--enable-auto-tool-choice",
+    "--jit-monitor-mode", "error",
+]
+
+[env]
+# Their serve-ds41-jovian.sh runtime env (multi-node-adapted; the launcher
+# injects NCCL_SOCKET_IFNAME/IB_HCA/GID + VLLM_HOST_IP per node).
+NCCL_NCHANNELS = "16"
+NCCL_MIN_NCHANNELS = "16"
+NCCL_MAX_NCHANNELS = "16"
+NCCL_BUFFSIZE = "2097152"
+OMP_NUM_THREADS = "8"
+CUDA_DEVICE_MAX_CONNECTIONS = "32"
+# GB10 arch (theirs sm_120a on RTX PRO 6000):
+CUTE_DSL_ARCH = "sm_121a"
+TORCH_CUDA_ARCH_LIST = "12.1a"
+# Their V2 model-runner + AOT compile pipeline (baked in their image env):
+VLLM_USE_V2_MODEL_RUNNER = "1"
+VLLM_USE_AOT_COMPILE = "1"
+VLLM_USE_STANDALONE_COMPILE = "1"
+VLLM_USE_MEGA_AOT_ARTIFACT = "1"
+VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
+VLLM_USE_FLASHINFER_SAMPLER = "1"
+VLLM_WORKER_MULTIPROC_METHOD = "spawn"
+VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS = "900"
+HF_HUB_OFFLINE = "1"
+# Deliberately NOT set: VLLM_ENABLE_PCIE_ALLREDUCE (single-host PCIe in
+# their profile; cross-node on the switch fabric uses the launcher's NCCL),
+# VLLM_HOST_IP (launcher per-node), NCCL_SOCKET_IFNAME (launcher per cluster).