Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/configs/amd-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ qwen3.5-bf16-mi355x-sglang:
search-space:
- { tp: 8, ep: 1, conc-start: 4, conc-end: 256 }

qwen3.5-bf16-mi355x-sglang-mtp:
image: lmsysorg/sglang-rocm:v0.5.10rc0-rocm720-mi35x-20260415
model: Qwen/Qwen3.5-397B-A17B
model-prefix: qwen3.5
runner: mi355x
precision: bf16
framework: sglang
multinode: false
seq-len-configs:
- isl: 1024
osl: 1024
search-space:
- { tp: 8, ep: 1, conc-start: 4, conc-end: 256, spec-decoding: mtp }
- isl: 8192
osl: 1024
search-space:
- { tp: 8, ep: 1, conc-start: 4, conc-end: 256, spec-decoding: mtp }

qwen3.5-bf16-mi300x-sglang:
image: lmsysorg/sglang:v0.5.10-rocm720-mi30x
model: Qwen/Qwen3.5-397B-A17B
Expand Down
82 changes: 82 additions & 0 deletions benchmarks/single_node/qwen3.5_bf16_mi355x_mtp.sh
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" \
Comment on lines +62 to +70
Copy link
Copy Markdown
Contributor

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.sh script is missing --use-chat-template from its run_benchmark_serving call (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-template to the run_benchmark_serving invocation to match the pattern established by qwen3.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.sh script launches SGLang with EAGLE speculative decoding (--speculative-algorithm EAGLE --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4) but then calls run_benchmark_serving without the --use-chat-template flag. 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_serving is 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-template is 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 counterpart qwen3.5_bf16_mi355x.sh also 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-template in 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.yaml for 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 the run_benchmark_serving call in qwen3.5_bf16_mi355x_mtp.sh, matching the pattern used in all other MTP benchmark scripts.

Step-by-step proof

  1. The script starts an SGLang server with EAGLE speculative decoding (lines 40–56).
  2. run_benchmark_serving is called at lines 58–70 without --use-chat-template.
  3. Without the flag, the benchmark tool generates prompts sampled from random token IDs, not from the chat-formatted distribution the model was trained on.
  4. The EAGLE draft model has learned to predict tokens that follow chat-template patterns (e.g., <|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.
  5. The result: reported draft token acceptance rates and throughput figures are higher than they would be with real user inputs, making the benchmark non-representative and not comparable to qwen3.5_fp8_b200_mtp.sh, qwen3.5_fp8_h200_mtp.sh, and qwen3.5_fp8_b300_mtp.sh, which all include --use-chat-template.

--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
10 changes: 10 additions & 0 deletions perf-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1536,3 +1536,13 @@
- "Mirrors the glm5-fp8-b300-sglang non-MTP recipe and adds EAGLE speculative decoding (num-steps=3, eagle-topk=1, num-draft-tokens=4) behind SGLANG_ENABLE_SPEC_V2=1"
- "Configs: 1k1k and 8k1k, TP=8/EP=1 conc 4-256 with spec-decoding=mtp"
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/XXXX

- config-keys:
- qwen3.5-bf16-mi355x-sglang-mtp
description:
- "Add Qwen3.5-397B-A17B BF16 MI355X SGLang MTP benchmark"
- "Image: lmsysorg/sglang-rocm:v0.5.10rc0-rocm720-mi35x-20260415"
- "Model: Qwen/Qwen3.5-397B-A17B"
- "Mirrors the qwen3.5-bf16-mi355x-sglang non-MTP recipe and adds EAGLE speculative decoding (num-steps=3, eagle-topk=1, num-draft-tokens=4)"
- "Configs: 1k1k and 8k1k, TP=8/EP=1 conc 4-256 with spec-decoding=mtp"
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/XXXX
Loading