Repository navigation
docs: add DeepSeek-V4.1 DSpark cookbook recipes - #364
Joey-gvwal wants to merge 2 commits into
Conversation
yeahdongcn
left a comment
There was a problem hiding this comment.
Merge verdict: no blocking findings — ready to merge.
Verified 5adb13bad760: every flag the two new pages add exists in the pinned vLLM (VLLM_COMMIT=5df63a7, v0.32.0), and the cookbook site build passed at this head.
Findings: 0 blocking · 3 nit
| nit | location | problem | fix |
|---|---|---|---|
| nit | docs/cookbook/deepseek/deepseek-v4.1-flash-1017-w4afp8.md:92 |
8195 matches no block or DSpark-step multiple; looks like a typo |
use 8192 in both blocks and the table row |
| nit | docs/cookbook/deepseek/deepseek-v4.1-flash-1017-fp8.md:39 |
checkpoint path names no registry artifact or revision | add the ModelScope id + revision, as the 0731 page does |
| nit | docs/cookbook/deepseek/deepseek-v4.1-flash-1017-w4afp8.md:33 |
omits the Model runner row and V2 env its FP8 sibling sets |
state the runner this profile actually uses |
What changed · what I could not verify
Two new DeepSeek-V4.1 cookbook pages plus two rows in docs/cookbook/README.md; no code, pins, or Dockerfile changes. docs/cookbook/deepseek/ has no README of its own, so the top-level index is the link surface — the PR updates it.
Verified at this head (gh api ...?ref=5adb13bad760 for repo files; upstream repos/vllm-project/vllm/contents/...?ref=5df63a7203cdb9328d824a27b682e77c7b9928be for the pinned vLLM):
"method":"dspark"andenable_adaptive_verificationexist in the pin:vllm/config/speculative.py:69(DSparkModelTypes = Literal["dspark"]) and:551(enable_adaptive_verification: bool = False, "Currently only supported for method="dspark"").draft_sample_methodis also there.--tokenizer-mode deepseek_v41is a documented mode atvllm/config/model.py:181("will use the DeepSeek V4.1 prompt encoder"); theTokenizerModeLiteral is narrower (:89), but the field isTokenizerMode | strand the code sets the same value itself at:751.--reasoning-parser deepseek_v41is registered atvllm/reasoning/__init__.py:35.VLLM_USE_V2_MODEL_RUNNERexists (vllm/envs.py:2151);max_cudagraph_capture_size,cudagraph_capture_sizes,cudagraph_copy_inputsexist (vllm/config/compilation.py);FLASHMLAexists (vllm/v1/attention/backends/registry.py:95).--enable-expert-paralleland the TP8+EP8 claim in the index row agree with the W4AFP8 page's--tensor-parallel-size 8+--enable-expert-parallel.- CI:
Cookbook siterun 45173468064, head5adb13bad760—buildpass (step "Build the site"),deployskipped. No failing or cancelled check. - Earlier rounds:
reviewsis[]andpulls/364/commentsis[], so there is nothing to re-check; this is the first round.
Gate: 9/9 hooks passed @ 5adb13b
Not verified, by absence of hardware or scope: the recorded response 5, and the throughput/TPOT table in the PR description (no perf section appears in the pages, and nothing in the diff reproduces those numbers).
One unconfirmed observation: cudagraph_capture_sizes stops at 64, and gpu_model_runner.py consumes those as token counts (self.cudagraph_batch_sizes = sorted(self.compilation_config.cudagraph_capture_sizes)). At --max-num-seqs 16 with Adaptive-5, a full decode batch is 16 × 6 = 96 tokens, above the largest graph. A run with --max-num-seqs 16 and the eager-fallback counter would confirm whether the C16 numbers in the PR description were captured or eager.
auto-review round 1/3 · verdict: clean
5adb13b to
f4c9a59
Compare
yeahdongcn
left a comment
There was a problem hiding this comment.
Merge verdict: 1 blocking finding — not ready to merge.
Reviewed f4c9a593fc63: the FP8 page's conversion step leaves FP4 experts for a launch command that declares expert_dtype=fp8.
Findings: 1 blocking · 2 nit
Earlier: nit-1 unchanged (8195) · nit-2 partly fixed @f4c9a59 (ModelScope link added, no revision pin) · nit-3 unchanged (no Model runner row on the W4AFP8 page)
| nit | location | problem | fix |
|---|---|---|---|
| nit | docs/cookbook/deepseek/deepseek-v4.1-flash-1017-w4afp8.md:74 |
graphs stop at 6 of 64 sequences; higher decode runs eager | use multiples of num_speculative_tokens + 1, as the 0731 page does |
| nit | docs/cookbook/deepseek/deepseek-v4.1-flash-1017-fp8.md:42 |
no ## Validation table; every sibling deepseek page has one |
add checkpoint @ revision, versions, served request |
What changed · what I could not verify
Two new cookbook pages plus two rows in docs/cookbook/README.md; no code, pins, or workflow changes. Against the previously reviewed head 5adb13bad760 the only change is a new ## Model source section in each page (f4c9a593 is an amended single commit; compare/A...B reports both files as added because the merge base is v0.32.0-dev).
Verified at this head:
- Pin unchanged:
third_party/PINShasVLLM_TAG=v0.32.0,VLLM_COMMIT=5df63a7203cdb9328d824a27b682e77c7b9928be. - DSpark fields exist at that pin:
vllm/config/speculative.py:69DSparkModelTypes = Literal["dspark"],:551enable_adaptive_verification: bool = False,:600draft_sample_method;vllm/envs.py:311/2151VLLM_USE_V2_MODEL_RUNNER. - Both registry links resolve:
GET modelscope.cn/api/v1/models/MooreThreads/DeepSeek-V4.1-Flash-1017-W4AFP8-mt→{"Code":200,...,"Architectures":["DeepseekV41ForCausalLM"]}; same fordeepseek-ai/DeepSeek-V4.1-Flash-1017. Itsinference/tree containsconvert.pyandREADME.md. w4afp8is a registered quant method here:vllm_musa/model_executor/layers/quantization/w4afp8.py:31returns"w4afp8".--limit-mm-per-prompt '{"image":0}'fits the checkpoints: bothconfig.jsonfiles carryimage_token_id, so the model is image-capable and the flag disables images.- Layout: one H1 per page, no heading jumps,
../README.mdresolves, and the two index rows agree with the pages (TP8 + EP8, DSpark Adaptive-5 / Fixed-4). - CI for head
f4c9a593:build pass 16s,deploy skipping(run 45174990398). No failing or cancelled check.
Blocking evidence (FP8 conversion): the cited inference/convert.py declares parser.add_argument("--expert-dtype", type=str, choices=["fp8","fp4"], default=None) (:197) and only calls cast_e2m1fn_to_e4m3fn when expert_dtype == "fp8" (:175-181); otherwise experts are kept as torch.float4_e2m1fn_x2. Upstream's own inference/README.md example passes --expert-dtype fp4. The page then passes --hf-overrides '{"expert_dtype":"fp8"}', and the pinned model reads that key to pick the weight mapper: expert_dtype = getattr(config, "expert_dtype", "fp4") / _make_deepseek_v4_weights_mapper(expert_dtype, ...) (vllm/models/deepseek_v41/nvidia/model.py:1564-1567), with a different scale-param name for fp4 (:1444-1446).
Nit mechanism (capture sizes): with DSpark on, one decode step is num_seqs x (1 + num_speculative_tokens) tokens. CompilationConfig.adjust_cudagraph_sizes_for_spec_decode rounds each size up to a multiple of 6 and drops any that exceed max_cudagraph_capture_size (vllm/config/compilation.py:1530-1558), so [1,2,4,8,16,32,64] becomes [6,12,18,36]; CudagraphDispatcher.dispatch then returns CUDAGraphMode.NONE for any batch above 36 tokens (vllm/v1/cudagraph_dispatcher.py:270-279). The 0731 page avoids this with multiples of 5 up to 320.
Not verified, by absence of hardware: the recorded response 5, the PR body's throughput/TPOT table, and the exact load-time exception for the dtype mismatch above; the mismatch itself is read from the pinned code and the cited script, not from a run.
Gate: 9/9 hooks passed @ f4c9a59
auto-review round 1/3 · verdict: blockers
Co-authored-by: R0CKSTAR <xiaodong.ye@mthreads.com>
|
Waiting for the FP8 model weights to be uploaded to MT public URL. |
yeahdongcn
left a comment
There was a problem hiding this comment.
Merge verdict: 1 blocking finding — not ready to merge.
Reviewed 79804db5c985: the rewritten conversion step still cannot produce a directory vllm serve loads.
Findings: 1 blocking · 0 nit
Earlier: P1-1 fixed @79804db5 · nit-1 unchanged (8195) · nit-2 changed (base model named, still no revision) · nit-3 unchanged (no Model runner row) · nit-4 unchanged (captures stop at 6 of 64) · nit-5 unchanged (no ## Validation)
Delta, evidence, what I could not verify
Delta f4c9a593...79804db5 is one hunk: the FP8 page's ## Model source paragraph (lines 18-21). The W4AFP8 page and both index rows are untouched, and no flag, pin or Dockerfile moved, so the earlier flag verification still stands.
P1 evidence, read from source (nothing run): inference/convert.py:194-197 declares --hf-ckpt-path, --save-path, --model-parallel with required=True; after writing model{i}-mp{mp}.safetensors it copies only tokenizer.json and tokenizer_config.json (:185-190). The base repo (59 files) keeps config.json and chat_template.jinja at its root, and its tokenizer_config.json has no chat_template key (grep -c chat_template → 0). The pinned vLLM fails config resolution without one: vllm/transformers_utils/config.py:839 — "Could not detect config format for no config file found. With config_format 'auto', ensure your model has either config.json (HF format) or params.json (Mistral format)." So the mount path in Prerequisites has no config to serve, and --hf-overrides has no base config to override.
CI: build pass 9s, deploy skipping — "Cookbook site" run 45179613373, head 79804db5c985, conclusion success. No failing or cancelled check reported.
Unchanged checks at this head: third_party/PINS (VLLM_TAG=v0.32.0, VLLM_COMMIT=5df63a72); --async-scheduling (vllm/engine/arg_utils.py:1774) and --limit-mm-per-prompt (:1463) exist at the pin; docs/cookbook/deepseek/ has no README, so the updated top-level index is the only link surface and ../README.md resolves; one H1 per page, no heading jumps.
Not verified: no hardware here, so the recorded response 5 and the PR body's throughput/TPOT table remain unconfirmed.
Gate: 9/9 hooks passed @ 79804db
auto-review round 2/3 · verdict: blockers
| The MoE FP8 weights are not published; build them from the | ||
| [DeepSeek-V4.1-Flash-1017 ModelScope model](https://modelscope.cn/models/deepseek-ai/DeepSeek-V4.1-Flash-1017) | ||
| with `inference/convert.py --expert-dtype fp8`. Any other `--expert-dtype` | ||
| leaves FP4 experts that the commands below load under FP8 weight names. |
There was a problem hiding this comment.
P1 — Give the full convert.py command and copy config.json
convert.py --expert-dtype fp8 alone fails: --hf-ckpt-path, --save-path and --model-parallel are required=True, and the save path receives only tokenizer.json and tokenizer_config.json. The pinned get_config then raises "Could not detect config format for no config file found" on that directory, so the commands below never start. Fix: show the required flags and copy the base checkpoint's config.json and chat_template.jinja into the save path.
| The MoE FP8 weights are not published; build them from the | |
| [DeepSeek-V4.1-Flash-1017 ModelScope model](https://modelscope.cn/models/deepseek-ai/DeepSeek-V4.1-Flash-1017) | |
| with `inference/convert.py --expert-dtype fp8`. Any other `--expert-dtype` | |
| leaves FP4 experts that the commands below load under FP8 weight names. | |
| The MoE FP8 weights are not published; build them from the | |
| [DeepSeek-V4.1-Flash-1017 ModelScope model](https://modelscope.cn/models/deepseek-ai/DeepSeek-V4.1-Flash-1017) | |
| with `inference/convert.py --hf-ckpt-path <base> --save-path | |
| /models/DeepSeek-V4.1-Flash-1017-FP8 --model-parallel 8 --expert-dtype fp8`, | |
| then copy that model's `config.json` and `chat_template.jinja` into the save | |
| path. Any other `--expert-dtype` leaves FP4 experts that the commands below | |
| load under FP8 weight names. |
There was a problem hiding this comment.
I'll update the description here once the FP8 model is uploaded.
Summary
Documents/develop/workspace-bak.Performance
Compared with Fixed-4:
Adaptive scheduling benefits multi-concurrency workloads. It is not recommended
for single-request C1 workloads, where throughput decreases by 4.39% and mean
TPOT increases by 4.87%.