Selaa lähdekoodia

vision aiden lanes: flag route with --entrypoint sh override (baked-in env-script doubles the tail); 4x gets same fix + shared NAS HF mount

Alexander Korolev 1 kuukausi sitten
vanhempi
sitoutus
01c4ccad57
2 muutettua tiedostoa jossa 77 lisäystä ja 72 poistoa
  1. 65 68
      recipes/dsv4-vision-aiden-2x/recipe.toml
  2. 12 4
      recipes/dsv4-vision-aiden-4x/recipe.toml

+ 65 - 68
recipes/dsv4-vision-aiden-2x/recipe.toml

@@ -1,29 +1,25 @@
-# DeepSeek-V4-Flash-Vision-Exp on 2× GB10 — AIDEN'S IMAGE (production-3.72-vision).
+# DeepSeek-V4-Flash-Vision-Exp on 2× GB10 — aiden image, flag route.
 #
-# 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.
+# aidendle94/sparkrun-vllm-ds4-gb10:production-3.72-vision, TP2 over ds4.
+# His production 2x DSpark-6 profile translated to our launcher shape: his
+# own serve line (moe/linear b12x, B12X_MLA_SPARSE attention, fp8 KV, block
+# 256, DSpark-6 greedy, graphs FULL_AND_PIECEWISE) as plain flags — the
+# image's BAKED-IN entrypoint is his env-script (which doubles our tail args
+# if left in place), so the recipe sets entrypoint = ["vllm","serve"] and one
+# mods line, which makes the launcher wrap everything in `--entrypoint sh -c`
+# and exec our tail directly with the image's system vllm — which IS his
+# multimodal wheel (the dist-packages vllm here carries the DeepseekV4 vision
+# wrap; the earlier "not multimodal" 400s came from OUR overlay image, not
+# this one).
 #
-# 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).
-#
-# 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).
-#
-# 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.
-#
-# Known quirk: first image request ~6 s cold, ~1-2 s warm (partition kernel).
+# Weights from the SHARED NAS HF cache (all 4 nodes mount nas.lan:/sna as
+# /mnt/nas; the repo's refs/main resolves offline). 2x reference: his 4x
+# DCP1 DSpark profile is 73.8-75.2 tok/s; 2x should sit below that.
+# Boot markers: "Model loading took ~82 GiB" → "GPU KV cache size" →
+# "Application startup complete". Smoke: 47*83 → 3901 + image_url ask.
 
 engine = "vllm"
-name = "DeepSeek V4 Flash Vision-Exp (aiden image + env-script, 2x Spark, DSpark-6)"
+name = "DeepSeek V4 Flash Vision-Exp (aiden image, 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
@@ -31,53 +27,54 @@ tensor_parallel_size = 2
 pipeline_parallel_size = 1
 distributed_backend = "mp"
 shm_size = "32gb"
-# 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.)
+# required for the launcher's `--entrypoint sh -c` override path (mods),
+# which also replaces the image's baked env-script entrypoint.
+entrypoint = ["vllm", "serve"]
 
 [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",
+    # (mods exist so the launcher takes the --entrypoint sh override path;
+    # the pre-serve work — page-cache flush — is done host-side by before_serve)
+    "true",
+]
+
+args = [
+    "--served-model-name", "deepseek-v4-vision",
+    "--trust-remote-code",
+    "--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-bytes", "12884901888",
+    "--max-model-len", "393216",
+    "--max-num-seqs", "8",
+    "--max-num-batched-tokens", "8192",
+    "--max-cudagraph-capture-size", "56",
+    "--compilation-config", """
+'{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}'""",
+    "--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":true}'""",
+    "--speculative-config", """
+'{"method":"dspark","num_speculative_tokens":6,"draft_sample_method":"greedy"}'""",
+    "--disable-chunked-mm-input",
+    "--limit-mm-per-prompt", """
+'{"image":4}'""",
 ]
 
 [env]
-# 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"
-# his script appends --revision "<empty>" unconditionally, which breaks
-# offline snapshot resolution (revision "" matches nothing). Point MODEL_PATH
-# at the cached snapshot path directly — vllm uses the existing path and the
-# empty revision is ignored.
-MODEL_PATH = "/opt/local-hf/hub/models--deepseek-ai--DeepSeek-V4-Flash-Vision-Exp/snapshots/e46e16bf6035c6f317eb2ac7458eb0362926d402"
-MODEL_ID = "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp"
-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"
+CUTE_DSL_ARCH = "sm_121a"
 VLLM_ENABLE_DSPARK = "1"
 VLLM_ENABLE_MTP = "0"
 NUM_SPECULATIVE_TOKENS = "6"
@@ -85,12 +82,12 @@ DSPARK_DRAFT_SAMPLE_METHOD = "greedy"
 DSPARK_SPS_CURVE = "auto"
 VLLM_CUDAGRAPH_MODE = "FULL_AND_PIECEWISE"
 VISION_MHC = "1"
-# KDA/CKV gather is a DCP-side lane; DCP1 needs none of the VLLM_DSV4_CKV_*
+MAX_CUDAGRAPH_CAPTURE_SIZE = "56"
+# (DCP prefill gather envs are DCP2-only; DCP1 here needs none)
+HF_HUB_OFFLINE = "1"
+TRANSFORMERS_OFFLINE = "1"
+VLLM_NO_USAGE_STATS = "1"
 
-# Weights from the SHARED NAS HF cache (all 4 nodes mount nas.lan:/sna as
-# /mnt/nas; dgx4 got a /mnt/nas -> /mnt symlink). The Vision-Exp snapshot AND
-# the DSpark draft repo live there — the local NVMe copy lacked the draft
-# (LocalEntryNotFound). One shared source of truth beats a per-node copy.
 [[extra_mounts]]
 host = "/mnt/nas/ai/huggingface"
 container = "/opt/local-hf"

+ 12 - 4
recipes/dsv4-vision-aiden-4x/recipe.toml

@@ -34,9 +34,17 @@ tensor_parallel_size = 4
 pipeline_parallel_size = 1
 distributed_backend = "mp"
 shm_size = "32gb"
-# image ships ENTRYPOINT ["vllm","serve"]; our launcher passes the recipe
-# entrypoint as CMD words after the image, which would double it. Empty clears.
-entrypoint = []
+# the image's BAKED-IN entrypoint is aiden's env-script (doubles our tail
+# args if left in place). The entrypoint below + one mods line makes the
+# launcher wrap in `--entrypoint sh -c` and exec `vllm serve <model> <args>`
+# directly with the image's system vllm (his multimodal wheel).
+entrypoint = ["vllm", "serve"]
+
+[mods]
+commands = [
+    # (mods exist so the launcher takes the --entrypoint sh override path)
+    "true",
+]
 
 args = [
     "--served-model-name", "deepseek-v4-vision",
@@ -94,6 +102,6 @@ TRANSFORMERS_OFFLINE = "1"
 VLLM_NO_USAGE_STATS = "1"
 
 [[extra_mounts]]
-host = "~/dsv4vision-hf"
+host = "/mnt/nas/ai/huggingface"
 container = "/opt/local-hf"
 env = "HF_HOME"