Преглед на файлове

vision 2x: aiden image via HIS env-script entrypoint — mods derive NODE_RANK/MASTER_ADDR from VLLM_HOST_IP + sed off the $@ tail (env-driven contract, launcher-tail dropped)

Alexander Korolev преди 1 месец
родител
ревизия
dc13bd0afe
променени са 1 файла, в които са добавени 62 реда и са изтрити 92 реда
  1. 62 92
      recipes/dsv4-vision-aiden-2x/recipe.toml

+ 62 - 92
recipes/dsv4-vision-aiden-2x/recipe.toml

@@ -1,97 +1,80 @@
-# DeepSeek-V4-Flash-Vision-Exp on 2× GB10 — aidendle94 sparkrun vision image.
+# DeepSeek-V4-Flash-Vision-Exp on 2× GB10 — AIDEN'S IMAGE (production-3.72-vision).
 #
-# aiden's vision guide (https://aidenle.com/recipes/deepseek-v4-flash-vision-4x-dgx-spark/)
-# translated to 2× Spark / DCP1 (his "DSpark, DCP1" profile: 73.8-75.2 tok/s at
-# TP4/DCP1; on 2x expect roughly half). His production lane ships DCP2 + DSpark
-# (66-71 tok/s, 3.5M KV); DCP flags omitted here — DSpark runs fine under DCP1.
+# aiden's vision guide translated to our 2-node ds4 launcher, RUN THROUGH HIS
+# OWN env-script entrypoint (/usr/local/bin/deepseek-v4-flash-2x-spark-
+# entrypoint → /tmp copy of /opt/vllm-src/serve-ds4-flash-spark.sh). The script
+# generates the full vllm serve command from the env below; do NOT add args —
+# the mod drops our launcher tail ($@) so his env stays the single source.
 #
-# Image: dsv4-flash-vision:local (our plugin overlay on aiden's
-# production-3.76.1 base — see dsv4-flash-vision/ UPSTREAM.md). Aiden's
-# production-3.72-vision tag is the published 4x stack; running it under our
-# launcher needs his env-script contract (NODE_RANK/MASTER_ADDR/NCCL_IB_*
-# required by /usr/local/bin/deepseek-v4-flash-2x-spark-entrypoint →
-# /opt/vllm-src/serve-ds4-flash-spark.sh) — a dedicated integration pass,
-# tracked as follow-up. The overlay image carries the equivalent flags:
-# draft greedy + FULL_AND_PIECEWISE graphs + capture cap via the envs below.
+# Image: aidendle94/sparkrun-vllm-ds4-gb10:production-3.72-vision. Their TWO
+# vllm wheels: dist-packages (plain, no vision) and /opt/vllm-src/.venv
+# (multimodal-wrapped DeepseekV4 + DSpark/DCP fixes) — only his script picks
+# the right one. Production profile at TP4/DCP2: 66-71 tok/s @ acceptance
+# 3.5-3.8; this 2x run is his "DSpark, DCP1" profile (73.8-75.2 @ TP4).
 #
-# Weights: deepseek-ai/DeepSeek-V4-Flash-Vision-Exp (cached; ~84 GiB/node at
-# TP2 via ~/dsv4vision-hf NVMe copies). Draft heads ship in the checkpoint
-# (mtp.*) — no extra download.
+# Required envs his script demands: NODE_RANK (mod derives from VLLM_HOST_IP
+# vs rank-0's IB IP), MASTER_ADDR (mod; ds4 = 192.168.200.17), VLLM_HOST_IP +
+# NCCL_IB_HCA/GID/SOCKET/GLOO/UCX/TP (launcher [nccl.ds4] + auto-GID).
 #
-# DSpark: k=6, greedy draft, acceptance 3.5-3.8 tokens/step. Acceptance is the
-# DCP correctness signal; equal DSpark-DCP1 numbers here = draft sees full ctx.
-# max-cudagraph-capture-size = seqs × (spec tokens + 1) = 8 × 7 = 56.
+# Boot markers: "DSpark draft model loaded: 97 params" → "Model loading took
+# ~82 GiB" → "GPU KV cache size" ≈ 600K (12 GiB pin at this GMU) → "Application
+# startup complete". Smoke: 47*83 → 3901 (thinking off) + image_url color ask.
 #
-# VISION_MHC=1 follows aiden's production profile; our plugin lane keeps
-# VLLM_USE_B12X_MHC=0 (checkpoint rms_norm_eps 1e-20 vs fused Gram kernel's
-# 1e-6 — upstream README). If this boot asserts on the mHC kernel, flip to 0.
-#
-# Boot markers: vision plugin registered → "Model loading took ~84 GiB" →
-# "GPU KV cache size" ≈ 1.25M → "Application startup complete".
+# Known quirk: first image request ~6 s cold, ~1-2 s warm (partition kernel).
 
 engine = "vllm"
-name = "DeepSeek V4 Flash Vision-Exp (aiden image, 2x Spark, DSpark-6)"
-docker_image = "dsv4-flash-vision:local"
+name = "DeepSeek V4 Flash Vision-Exp (aiden image + env-script, 2x Spark, DSpark-6)"
+docker_image = "aidendle94/sparkrun-vllm-ds4-gb10:production-3.72-vision"
 model = "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp"
 required_nodes = 2
 tensor_parallel_size = 2
 pipeline_parallel_size = 1
 distributed_backend = "mp"
 shm_size = "32gb"
-# his image has TWO vllm wheels: dist-packages (plain, NO vision) and the
-# compiled stack at /opt/vllm-src/.venv (multimodal-wrapped DeepseekV4). The
-# image's own entrypoint script also injects a big env block (B12X_*,
-# PCIE_ALLREDUCE, MEGA_AOT, JIT paths) — the flag-relevant subset is in [env]
-# below. Point the launcher tail straight at their venv python.
-entrypoint = ["/opt/vllm-src/.venv/bin/python", "-m", "vllm.entrypoints.cli.main", "serve"]
+# his script copies /opt/vllm-src/serve-ds4-flash-spark.sh to /tmp and execs
+# it; the mod block below seds the "$@" tail off the SOURCE before that copy
+# (our launcher's appended model/args would otherwise duplicate his generated
+# ones), and derives NODE_RANK/MASTER_ADDR.
+entrypoint = ["/usr/local/bin/deepseek-v4-flash-2x-spark-entrypoint"]
+
+# (no args: the env-script builds everything; the launcher tail is dropped by
+# the mod below — if the sed ever fails, vllm errors on duplicate positional
+# and the boot aborts loudly instead of misconfiguring.)
 
-args = [
-    "--served-model-name", "deepseek-v4-vision",
-    "--trust-remote-code",
-    "--distributed-executor-backend", "mp",
-    "--attention-backend", "B12X_MLA_SPARSE",
-    "--moe-backend", "b12x",
-    "--linear-backend", "b12x",
-    "--kv-cache-dtype", "fp8",
-    "--block-size", "256",
-    "--gpu-memory-utilization", "0.80",
-    "--kv-cache-memory", "12884901888",
-    "--max-model-len", "393216",
-    "--max-num-seqs", "8",
-    "--max-num-batched-tokens", "8192",
-# capture cap comes from the sizes list (max 8) — the 56 value would need 56 in the list
-    "--compilation-config", """
-'{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"],"cudagraph_capture_sizes":[1,2,3,4,5,6,7,8]}'""",
-    "--async-scheduling",
-    "--no-scheduler-reserve-full-isl",
-    "--enable-chunked-prefill",
-    "--enable-prefix-caching",
-    "--tokenizer-mode", "deepseek_v4",
-    "--tool-call-parser", "deepseek_v4",
-    "--enable-auto-tool-choice",
-    "--reasoning-parser", "deepseek_v4",
-    "--reasoning-config", """
-'{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}'""",
-    "--default-chat-template-kwargs", """
-'{"thinking":false,"reasoning_effort":"low"}'""",
-    "--speculative-config", """
-'{"method":"dspark","num_speculative_tokens":6,"draft_sample_method":"greedy","attention_backend":"B12X_MLA_SPARSE"}'""",
-    "--disable-chunked-mm-input",
-    "--limit-mm-per-prompt", """
-'{"image":4}'""",
+[mods]
+commands = [
+    # rank-0 IB ip on ds4 (config.toml [cluster.ds4] rank 0 = dgx3 192.168.200.17)
+    "export MASTER_ADDR=\"192.168.200.17\"",
+    "if [ \"${VLLM_HOST_IP:-}\" = \"192.168.200.17\" ]; then export NODE_RANK=0; else export NODE_RANK=1; fi",
+    "export MASTER_PORT=\"29511\"",
+    "export PORT=\"30000\"",
+    "export NODE_RANK=\"${NODE_RANK:-0}\"",
+    # drop the forwarded "$@" his launcher appends to its generated vllm call
+    # (our tail would duplicate his model positional); fail loudly if absent
+    "sed -i '$s/ \\\"\\$@\\\"$//' /opt/vllm-src/serve-ds4-flash-spark.sh || exit 1",
+    "grep -q 'vllm.entrypoints.cli.main serve' /opt/vllm-src/serve-ds4-flash-spark.sh",
 ]
 
 [env]
-# aidee runner envs (his guide, minus DCP2-only and fabric knobs)
-CUTE_DSL_ARCH = "sm_121a"
-TRITON_PTXAS_PATH = "/usr/local/cuda/bin/ptxas"
-DG_JIT_USE_NVRTC = "0"
-USE_CUDNN = "1"
-VLLM_USE_MEGA_AOT_ARTIFACT = "1"
-VLLM_ENABLE_PCIE_ALLREDUCE = "1"
-VLLM_PCIE_ALLREDUCE_BACKEND = "b12x"
-VLLM_USE_B12X_DENSE_SPLITK_TURBO = "1"
-VLLM_USE_B12X_W4A16_TC_DECODE = "1"
+# his script's inputs (same names verbatim; all other B12X_*/AOT/JIT knobs
+# the script exports itself)
+SPARK_HF_HOME = "/opt/local-hf"
+HF_HUB_OFFLINE = "1"
+TRANSFORMERS_OFFLINE = "1"
+NNODES = "2"
+TP_SIZE = "2"
+DCP_SIZE = "1"
+MODEL_ID = "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp"
+DSPARK_MODEL_ID = "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp"
+DSPARK_MODEL_REVISION = "e46e16bf6035c6f317eb2ac7458eb0362926d402"
+SERVED_MODEL_NAME = "deepseek-v4-vision"
+GPU_MEMORY_UTILIZATION = "0.80"
+KV_CACHE_MEMORY_BYTES = "12884901888"
+MAX_MODEL_LEN = "393216"
+MAX_NUM_SEQS = "8"
+MAX_NUM_BATCHED_TOKENS = "8192"
+MAX_CUDAGRAPH_CAPTURE_SIZE = "56"
+ENABLE_PREFIX_CACHING = "1"
 VLLM_ENABLE_DSPARK = "1"
 VLLM_ENABLE_MTP = "0"
 NUM_SPECULATIVE_TOKENS = "6"
@@ -99,22 +82,9 @@ DSPARK_DRAFT_SAMPLE_METHOD = "greedy"
 DSPARK_SPS_CURVE = "auto"
 VLLM_CUDAGRAPH_MODE = "FULL_AND_PIECEWISE"
 VISION_MHC = "1"
-MAX_CUDAGRAPH_CAPTURE_SIZE = "56"
-# proven 2x-lane knobs carried over
-VLLM_USE_AOT_COMPILE = "1"
-VLLM_USE_BREAKABLE_CUDAGRAPH = "0"
-VLLM_USE_FLASHINFER_SAMPLER = "1"
-VLLM_USE_B12X_WO_PROJECTION = "1"
-VLLM_USE_B12X_FP8_GEMM = "1"
-VLLM_USE_B12X_MOE = "1"
-VLLM_USE_B12X_SPARSE_INDEXER = "1"
-B12X_MLA_SM120_UNIFIED = "1"
-B12X_MOE_FORCE_A8 = "1"
-HF_HUB_OFFLINE = "1"
-TRANSFORMERS_OFFLINE = "1"
-VLLM_NO_USAGE_STATS = "1"
+# KDA/CKV gather is a DCP-side lane; DCP1 needs none of the VLLM_DSV4_CKV_*
 
-# Weights from per-node NVMe copies; extra_mounts stay AFTER args.
+# Weights from per-node NVMe copies (fast path). extra_mounts stay AFTER args.
 [[extra_mounts]]
 host = "~/dsv4vision-hf"
 container = "/opt/local-hf"