ソースを参照

feat(deepseek-v4-flash): fix current parameters

Alexander Korolev 1 ヶ月 前
親
コミット
7742fbf290

+ 1 - 46
docker-images/deepseek-v4-flash-eugr/Dockerfile

@@ -17,52 +17,7 @@
 # running container already has the hybrid loader, and the recipe carries
 # no [mods] block.
 #
-# Build safety: the patcher refuses to patch an incompatible module (it
-# anchors on vLLM's exact get_model signature and self-compiles the result).
-# If a future eugr image bumps vLLM and that signature changes, `docker
-# build` fails here instead of silently shipping an unpatched image.
-#
 # Build: cd docker-images/deepseek-v4-flash-eugr && bash build.sh
 # (the sm121 launcher builds on demand and stamps sm121.checksum)
 
-FROM eugr/spark-vllm-b12x
-
-# Vendor the mod's patcher (vendored from eugr/spark-vllm-docker b12x branch,
-# mods/instanttensor-hybrid-draft-loader/patch_model_loader.py) so the build is
-# self-contained and the file is folded into the sm121 build checksum.
-COPY patches/patch_model_loader.py /tmp/patch_model_loader.py
-
-# Resolve the model_loader module path from Python itself (do not hardcode the
-# dist-packages prefix), then check -> apply -> check, matching the mod's run.sh.
-RUN set -eux; \
-    TARGET="$(python3 -c 'import vllm, os; print(os.path.join(vllm.__path__[0], "model_executor/model_loader/__init__.py"))')"; \
-    python3 /tmp/patch_model_loader.py --check "$TARGET"; \
-    python3 /tmp/patch_model_loader.py "$TARGET"; \
-    python3 /tmp/patch_model_loader.py --check "$TARGET"; \
-    find "$(dirname "$TARGET")" -name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null || true; \
-    rm -f /tmp/patch_model_loader.py
-
-# Minimal reasoning_effort (low/high/max) support for the vendored deepseek_v4
-# tokenizer. Applies only the required edits on top of whatever eugr ships
-# (keeps all of eugr's own logic; does NOT replace the files with the 0731
-# variant). See patches/patch_deepseek_v4_effort.py.
-COPY patches/patch_deepseek_v4_effort.py /tmp/patch_deepseek_v4_effort.py
-RUN set -eux; \
-    python3 /tmp/patch_deepseek_v4_effort.py --check; \
-    python3 /tmp/patch_deepseek_v4_effort.py; \
-    python3 /tmp/patch_deepseek_v4_effort.py --check; \
-    find "$(python3 -c 'import vllm, os; print(os.path.join(vllm.__path__[0], "tokenizers"))')" -name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null || true; \
-    rm -f /tmp/patch_deepseek_v4_effort.py
-
-# Optional: read the newer `reasoning_content` message key instead of the
-# deprecated `reasoning` key. DEFAULT-OFF — the first-test variant stays the
-# pure reasoning_effort change above. Turn on at runtime with
-# VLLM_DSV4_REASONING_CONTENT=1 (recipe [env] / -e); or comment this block to
-# remove entirely. See patches/patch_deepseek_v4_reasoning_content.py.
-COPY patches/patch_deepseek_v4_reasoning_content.py /tmp/patch_dsv4_rc.py
-RUN set -eux; \
-    python3 /tmp/patch_dsv4_rc.py --check; \
-    python3 /tmp/patch_dsv4_rc.py; \
-    python3 /tmp/patch_dsv4_rc.py --check; \
-    find "$(python3 -c 'import vllm, os; print(os.path.join(vllm.__path__[0], "tokenizers"))')" -name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null || true; \
-    rm -f /tmp/patch_dsv4_rc.py
+FROM eugr/spark-vllm-b12x:nightly-20260823

+ 7 - 7
recipes/deepseek-v4-flash/recipe.toml

@@ -41,11 +41,11 @@ args = [
     "--kv-cache-dtype", "fp8",
     "--block-size", "256",
     "--load-format", "auto",
-    "--max-model-len", "1048576",
+    "--max-model-len", "524288",
     "--max-num-seqs", "16",
-    "--max-num-batched-tokens", "16384",
-    "--max-cudagraph-capture-size", "512",
-    "--gpu-memory-utilization", "0.84",
+    "--max-num-batched-tokens", "4096",
+    "--max-cudagraph-capture-size", "128",
+    "--gpu-memory-utilization", "0.78",
     "--served-model-name", "deepseek-v4-flash",
     # Engine backends
     "--attention-backend", "FLASHINFER_MLA_SPARSE_DSV4",
@@ -63,9 +63,9 @@ args = [
     # DSpark speculative decoding — k=5 is DeepSeek-V4-Flash's native
     # dspark_block_size (0731 == preview). Do NOT raise to k=7 (0731 model-card
     # rec): this image hard-rejects k > block_size at boot. draft_sample_method
-    # is accepted by the speculative-config parser (no-op on the DSpark path).
+    # matches the image CMD (probabilistic).
     "--speculative-config", """
-'{"method":"dspark","num_speculative_tokens":5,"draft_sample_method":"greedy"}'""",
+'{"method":"dspark","num_speculative_tokens":5,"draft_sample_method":"probabilistic"}'""",
     # Tokenizer / reasoning
     "--tokenizer-mode", "deepseek_v4",
     "--tool-call-parser", "deepseek_v4",
@@ -78,7 +78,7 @@ args = [
     "--override-generation-config", """
 '{"temperature":0.8,"top_p":0.25,"repetition_penalty":1.0}'""",
     "--generation-config", "vllm",
-    "--default-chat-template-kwargs.enable_thinking=true",
+    "--default-chat-template-kwargs.thinking=true",
     "--default-chat-template-kwargs.reasoning_effort=max",
     # Disable custom all-reduce (not needed on GB10 single-NIC)
     "--disable-custom-all-reduce",