-
Notifications
You must be signed in to change notification settings - Fork 156
Add MI355X config: qwen3.5-bf16-sglang-mtp #1077
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
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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,82 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| source "$(dirname "$0")/../benchmark_lib.sh" | ||
|
|
||
| check_env_vars \ | ||
| MODEL \ | ||
| TP \ | ||
| CONC \ | ||
| ISL \ | ||
| OSL \ | ||
| RANDOM_RANGE_RATIO \ | ||
| RESULT_FILENAME \ | ||
| EP_SIZE | ||
|
|
||
| if [[ -n "$SLURM_JOB_ID" ]]; then | ||
| echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME" | ||
| fi | ||
|
|
||
| hf download "$MODEL" | ||
|
|
||
| SERVER_LOG=/workspace/server.log | ||
| PORT=${PORT:-8888} | ||
| CONTEXT_LENGTH=$((ISL + OSL + 20)) | ||
| MAX_PREFILL_TOKENS=32768 | ||
|
|
||
| EVAL_CONTEXT_ARGS="" | ||
| if [ "${EVAL_ONLY}" = "true" ]; then | ||
| setup_eval_context | ||
| EVAL_CONTEXT_ARGS="--context-length $EVAL_MAX_MODEL_LEN" | ||
| else EVAL_CONTEXT_ARGS="--context-length $CONTEXT_LENGTH" | ||
| fi | ||
| # Start GPU monitoring (power, temperature, clocks every second) | ||
| start_gpu_monitor | ||
|
|
||
| python3 -m sglang.launch_server \ | ||
| --attention-backend triton \ | ||
| --model-path $MODEL \ | ||
| --host=0.0.0.0 \ | ||
| --port $PORT \ | ||
| --tensor-parallel-size $TP \ | ||
| --ep-size $EP_SIZE \ | ||
| --trust-remote-code \ | ||
| --tokenizer-worker-num 6 \ | ||
| --enable-aiter-allreduce-fusion \ | ||
| --cuda-graph-max-bs $CONC \ | ||
| --disable-radix-cache \ | ||
| --max-prefill-tokens $MAX_PREFILL_TOKENS \ | ||
| --scheduler-recv-interval 30 \ | ||
| --mem-fraction-static 0.8 \ | ||
| --speculative-algorithm EAGLE \ | ||
| --speculative-num-steps 3 \ | ||
| --speculative-eagle-topk 1 \ | ||
| --speculative-num-draft-tokens 4 \ | ||
| $EVAL_CONTEXT_ARGS > $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" | ||
|
|
||
| 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/ \ | ||
| --use-chat-template | ||
|
|
||
| # 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 new
qwen3.5_bf16_mi355x_mtp.shscript is missing--use-chat-templatefrom itsrun_benchmark_servingcall (lines 62–70), while every other MTP benchmark script in the repository includes this flag. Without it, EAGLE speculative decoding acceptance rates are artificially inflated because random prompts are not formatted as chat messages, making benchmark results not comparable to other Qwen3.5 MTP configs. Add--use-chat-templateto therun_benchmark_servinginvocation to match the pattern established byqwen3.5_fp8_b200_mtp.sh,qwen3.5_fp8_h200_mtp.sh,qwen3.5_fp8_b300_mtp.sh, and all DSR1 MTP scripts.Extended reasoning...
What the bug is and how it manifests
The
benchmarks/single_node/qwen3.5_bf16_mi355x_mtp.shscript launches SGLang with EAGLE speculative decoding (--speculative-algorithm EAGLE --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4) but then callsrun_benchmark_servingwithout the--use-chat-templateflag. This means the benchmark tool generates raw random token prompts rather than prompts that have been formatted using the model's chat template.The specific code path that triggers it
In
qwen3.5_bf16_mi355x_mtp.sh(lines 62–70),run_benchmark_servingis called with--model,--port,--backend vllm,--input-len,--output-len,--random-range-ratio,--num-prompts,--max-concurrency,--result-filename, and--result-dir— but--use-chat-templateis absent. Every other MTP benchmark script in the repo passes this flag:qwen3.5_fp8_b200_mtp.sh(line 91),qwen3.5_fp8_h200_mtp.sh(line 82),qwen3.5_fp8_b300_mtp.sh(line 77), and all DSR1 MTP scripts (dsr1_fp8_b200_mtp.sh,dsr1_fp4_mi355x_atom_mtp.sh,dsr1_fp8_mi355x_atom_mtp.sh,dsr1_fp8_h200_trt_mtp.sh,dsr1_fp4_b200_trt_mtp.sh,dsr1_fp8_b300_mtp.sh). The non-MTP counterpartqwen3.5_bf16_mi355x.shalso lacks the flag, confirming this was inadvertently copied from the non-MTP script without adding the MTP-required flag.Why existing code doesn't prevent it
There is no automated check enforcing
--use-chat-templatein MTP scripts. The script passes bash syntax validation (bash -n) without the flag. The error is a logical omission, not a syntax one.What the impact would be
With EAGLE speculative decoding, the draft model proposes tokens conditioned on the training distribution, which includes the chat template's special tokens and formatting. When random raw-token prompts (without chat template structure) are used as inputs, the verifier accepts draft tokens at abnormally high rates because the output distribution is skewed. This inflates the reported MTP acceptance rate and throughput, producing numbers that overstate real-world performance gains from speculative decoding and are directly incomparable to the other Qwen3.5 MTP configs. This exact mechanism was explicitly documented as a bug fix in
perf-changelog.yamlfor PR #647 (dsr1-fp8-mi355x-sglang-disagg): 'Add --use-chat-template argument to benchmark_serving script. Without this arg, MTP acceptance rates are artificially high for DeepSeek with MTP'.How to fix it
Add
--use-chat-template \\to therun_benchmark_servingcall inqwen3.5_bf16_mi355x_mtp.sh, matching the pattern used in all other MTP benchmark scripts.Step-by-step proof
run_benchmark_servingis called at lines 58–70 without--use-chat-template.<|im_start|>assistant\n...). When the prompt lacks these patterns, the draft model's proposals happen to coincide with what the verifier would generate at an inflated rate — not because speculative decoding is working well, but because the input distribution is anomalous.qwen3.5_fp8_b200_mtp.sh,qwen3.5_fp8_h200_mtp.sh, andqwen3.5_fp8_b300_mtp.sh, which all include--use-chat-template.