-
Notifications
You must be signed in to change notification settings - Fork 155
chore: tag dsv4 b300 benchmark scripts with inference engine #1146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Per https://vllm.ai/blog/deepseek-v4 the DeepSeek-V4-Pro recipe lists | ||
| # 8xB200 and 8xB300 with identical flags, so this script mirrors | ||
| # dsv4_fp4_b200.sh. | ||
|
Check warning on line 5 in benchmarks/single_node/dsv4_fp4_b300_vllm.sh
|
||
|
|
||
| source "$(dirname "$0")/../benchmark_lib.sh" | ||
|
|
||
| check_env_vars \ | ||
| MODEL \ | ||
| TP \ | ||
| CONC \ | ||
| ISL \ | ||
| OSL \ | ||
| MAX_MODEL_LEN \ | ||
| RANDOM_RANGE_RATIO \ | ||
| RESULT_FILENAME | ||
|
|
||
| if [[ -n "$SLURM_JOB_ID" ]]; then | ||
| echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME" | ||
| fi | ||
|
|
||
| nvidia-smi | ||
|
|
||
| SERVER_LOG=/workspace/server.log | ||
| PORT=${PORT:-8888} | ||
|
|
||
| # DeepSeek-V4-Pro weights are large and engine startup on B300 can exceed | ||
| # the default 600s. Give it an hour to load. | ||
| export VLLM_ENGINE_READY_TIMEOUT_S=3600 | ||
|
|
||
| if [ "${EVAL_ONLY}" = "true" ]; then | ||
| setup_eval_context | ||
| MAX_MODEL_LEN="$EVAL_MAX_MODEL_LEN" | ||
| fi | ||
|
|
||
| # Monkey-patch: bypass persistent_topk unconditionally. It raises "k out of | ||
| # range" during CUDA graph capture when the dummy batch has rows with | ||
| # seq_lens[i] < k (=2048 for DSV4). An attn_metadata.max_seq_len-based gate is | ||
| # not strict enough because dummy batches can have max >= k while individual | ||
| # rows have seq_lens[i] = 1. Fall back to top_k_per_row_decode everywhere so | ||
| # 1k/1k capture completes; 8k/1k already worked without the patch but we trade | ||
| # a small decode-time perf cost there to keep the script single-branch. | ||
| INDEXER_PY=/usr/local/lib/python3.12/dist-packages/vllm/model_executor/layers/sparse_attn_indexer.py | ||
| echo "[monkey-patch] patching $INDEXER_PY" | ||
| sed -i 's/if current_platform.is_cuda() and topk_tokens in (512, 1024, 2048)[^:]*:/if False: # monkey-patched: bypass persistent_topk (k out of range)/' "$INDEXER_PY" | ||
| if ! grep -Fq 'if False: # monkey-patched: bypass persistent_topk' "$INDEXER_PY"; then | ||
| echo "[monkey-patch] FAILED: expected marker not found in $INDEXER_PY" >&2 | ||
| echo "[monkey-patch] current line around persistent_topk dispatch:" >&2 | ||
| grep -n 'topk_tokens in\|persistent_topk' "$INDEXER_PY" >&2 || true | ||
| exit 1 | ||
| fi | ||
| echo "[monkey-patch] applied: $(grep -n 'if False: # monkey-patched' $INDEXER_PY)" | ||
|
|
||
| # Start GPU monitoring (power, temperature, clocks every second) | ||
| start_gpu_monitor | ||
|
|
||
| # Per the recipe, run with EP + DP=8 (no --tensor-parallel-size flag). TP | ||
| # from the search space is used only for GPU allocation by the runner and | ||
| # as the DP size. | ||
| set -x | ||
| vllm serve $MODEL --host 0.0.0.0 --port $PORT \ | ||
| --trust-remote-code \ | ||
| --kv-cache-dtype fp8 \ | ||
| --block-size 256 \ | ||
| --no-enable-prefix-caching \ | ||
| --enable-expert-parallel \ | ||
| --data-parallel-size $TP \ | ||
| --max-model-len $MAX_MODEL_LEN \ | ||
| --compilation-config '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}' \ | ||
| --tokenizer-mode deepseek_v4 \ | ||
| --tool-call-parser deepseek_v4 \ | ||
| --enable-auto-tool-choice \ | ||
| --reasoning-parser deepseek_v4 > $SERVER_LOG 2>&1 & | ||
|
|
||
| SERVER_PID=$! | ||
|
|
||
| # Wait for server to be ready | ||
| wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID" | ||
|
|
||
| pip install -q datasets pandas | ||
|
|
||
| run_benchmark_serving \ | ||
| --model "$MODEL" \ | ||
| --port "$PORT" \ | ||
| --backend vllm \ | ||
| --input-len "$ISL" \ | ||
| --output-len "$OSL" \ | ||
| --random-range-ratio "$RANDOM_RANGE_RATIO" \ | ||
| --num-prompts "$((CONC * 10))" \ | ||
| --max-concurrency "$CONC" \ | ||
| --result-filename "$RESULT_FILENAME" \ | ||
| --result-dir /workspace/ \ | ||
| --trust-remote-code | ||
|
|
||
| # After throughput, run evaluation only if RUN_EVAL is true | ||
| if [ "${RUN_EVAL}" = "true" ]; then | ||
| run_eval --framework lm-eval --port "$PORT" | ||
| append_lm_eval_summary | ||
| fi | ||
|
|
||
| # Stop GPU monitoring | ||
| stop_gpu_monitor | ||
| set +x | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The header comment claims this script "mirrors dsv4_fp4_b200.sh" since the vLLM blog lists 8xB200 and 8xB300 with identical flags, but
dsv4_fp4_b200.shis an SGLang script (usessglang servewith SGLang-specific flags like--moe-runner-backend,--moe-a2a-backend deepep, CONC-based recipe dispatch). This new script usesvllm servewith an entirely different flag set and a vLLM-specific monkey-patch — they share no engine or flags. Consider dropping themirrors dsv4_fp4_b200.shreference (or pointing it at an actual vLLM companion) so future readers don't go looking for parity that doesn't exist.Extended reasoning...
What's wrong
Lines 3-5 of
benchmarks/single_node/dsv4_fp4_b300_vllm.shread:The "so this script mirrors dsv4_fp4_b200.sh" conclusion only follows if
dsv4_fp4_b200.shis itself a vLLM script — but it isn't.benchmarks/single_node/dsv4_fp4_b200.shinvokesPYTHONNOUSERSITE=1 sglang serveand uses SGLang-only flags (--moe-runner-backend flashinfer_mxfp4,--moe-a2a-backend deepep,--enable-dp-attention,--deepep-config, etc.) plus a CONC-based 3-recipe dispatch (low-latency / balanced / max-throughput).The new script doesn't mirror it
dsv4_fp4_b300_vllm.shinvokesvllm servewith a totally disjoint flag set (--kv-cache-dtype fp8,--block-size 256,--enable-expert-parallel,--data-parallel-size,--compilation-config '{...}',--tokenizer-mode deepseek_v4,--reasoning-parser deepseek_v4, etc.), monkey-patches vLLM'ssparse_attn_indexer.py, has noRECIPE_FLAGSarray, and no CONC-based dispatch. The two scripts share nothing beyond trivialbenchmark_lib.shboilerplate.Why the existing wording is misleading
The vLLM blog parity claim ("B200 and B300 with identical flags") is a vLLM-to-vLLM statement and would justify mirroring a hypothetical
dsv4_fp4_b200_vllm.sh— but no such file exists in the repo. The PR description even notes that this script was "restored from the abandonedorigin/claude/add-dsv4-fp4-b300-vllmbranch," which is a plausible explanation for the stale reference: it may originally have pointed at a never-merged vLLM b200 sibling.Step-by-step proof
benchmarks/single_node/dsv4_fp4_b200.shand grep for the server invocation → line ~86 readsPYTHONNOUSERSITE=1 sglang serve \. So b200 is SGLang.benchmarks/single_node/dsv4_fp4_b300_vllm.shand grep for the server invocation → it readsvllm serve $MODEL .... So b300_vllm is vLLM.--moe-runner-backend,--moe-a2a-backend deepep,--mem-fraction-static,--disable-radix-cache, etc.; b300_vllm uses--kv-cache-dtype fp8,--block-size,--enable-expert-parallel,--data-parallel-size,--compilation-config, etc. → zero overlap.ls benchmarks/single_node/dsv4_fp4_b200_vllm.sh→ no such file. So no actual vLLM b200 sibling to mirror.Impact / fix
This is documentation only — no runtime behavior is affected. But the comment is the first thing a reader sees, and the PR is specifically about disambiguating engines (
_sglangvs_vllmsuffixes). Leaving a comment that points the vLLM script at the SGLang script undercuts that disambiguation. Suggested fix: either drop theso this script mirrors dsv4_fp4_b200.shclause and keep just the recipe-source link, or replace it with something accurate like "flags follow the vLLM DeepSeek-V4-Pro recipe; B200 and B300 use identical flags per the blog."