[Benchmark] Add DFlash vs baseline accuracy/perf sweep scripts - #13
[Benchmark] Add DFlash vs baseline accuracy/perf sweep scripts#13TianHao65 wants to merge 11 commits into
Conversation
Add five standalone benchmark drivers under benchmark/dflash/ that launch
servers across (attention_backend, tp_size) configs and run a workload for
each (concurrency, num_questions) setting, reporting DFlash throughput and
acceptance length against a baseline run.
- bench_dflash_gsm8k_sweep.py GSM8K
- bench_dflash_math500_sweep.py MATH500, scored by \boxed{...} string
equivalence (conservative lower bound)
- bench_dflash_humaneval_sweep.py HumanEval pass@1, sandboxed subprocess
- bench_dflash_mbpp_sweep.py MBPP pass@1, sandboxed subprocess
- bench_dflash_mtbench_sweep.py MT-Bench, performance only (no judge)
For the code benchmarks, test execution runs after the timed generation
region so it never contaminates throughput or accept-length numbers.
Launch environment matches launch_qwen3.5-397B-fp8_tp8_prefix_cache_DFlash.sh
and is applied via setdefault before importing torch/sglang, so explicit
caller exports still win.
These are benchmark scripts, not CI tests -- they are long-running by design.
|
No CI required since this PR is only for benchmarks. I have manually canceled the run. |
There was a problem hiding this comment.
Pull request overview
This PR adds standalone benchmark drivers under benchmark/dflash/ to sweep DFLASH vs baseline across multiple (attention_backend, tp_size) server configs and (concurrency, num_questions) workloads, reporting throughput and speculative acceptance-length; the code-eval benchmarks also compute pass@1 in a post-timing phase.
Changes:
- Added GSM8K and MATH500 sweep scripts that measure throughput/accept-length and compute basic string-based accuracy.
- Added HumanEval and MBPP sweep scripts that measure throughput/accept-length and compute pass@1 via sandboxed subprocess execution after timing.
- Added an MT-Bench sweep script that measures performance only (no judge), using first-turn prompts as single-turn requests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| benchmark/dflash/bench_dflash_gsm8k_sweep.py | GSM8K DFLASH vs baseline sweep with throughput + accept-length + numeric-answer accuracy. |
| benchmark/dflash/bench_dflash_math500_sweep.py | MATH500 DFLASH vs baseline sweep with throughput + accept-length + boxed-answer string equivalence accuracy. |
| benchmark/dflash/bench_dflash_humaneval_sweep.py | HumanEval DFLASH vs baseline sweep with throughput + accept-length + pass@1 via subprocess test execution (post-timing). |
| benchmark/dflash/bench_dflash_mbpp_sweep.py | MBPP DFLASH vs baseline sweep with throughput + accept-length + pass@1 via subprocess assertion execution (post-timing). |
| benchmark/dflash/bench_dflash_mtbench_sweep.py | MT-Bench DFLASH vs baseline sweep focused on performance only (no judge). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sammysun0711
left a comment
There was a problem hiding this comment.
@TianHao65, please help to check coplot review comments.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| "SGLANG_ROCM_USE_AITER_LINEAR_SHUFFLE": "1", | ||
| "SGLANG_ROCM_USE_AITER_LINEAR_FP8HIPB": "1", | ||
| "USE_AITER_COMM": "1", | ||
| "AITER_MOE_SMALL_BATCH": "1", |
There was a problem hiding this comment.
We do not need this environment variable on latest qwen3_5_v0.5.15_dflash branch, please remove it for simplicity.
| "AITER_MOE_PADDING_SIZE": "192", | ||
| "HIP_GDN_SORT_IDX_BS": "32768", |
There was a problem hiding this comment.
We do not need this environment variable on latest qwen3_5_v0.5.15_dflash branch, please remove it for simplicity.
| device_sm = get_device_sm() | ||
| attention_backends = _filter_attention_backends( | ||
| attention_backends, device_sm=device_sm | ||
| ) |
There was a problem hiding this comment.
Why should we run nvidia flash attention backend?
| def _filter_attention_backends(backends: list[str], *, device_sm: int) -> list[str]: | ||
| if not (80 <= device_sm <= 90): | ||
| backends = [b for b in backends if b != "fa3"] | ||
| if device_sm < 100: | ||
| backends = [b for b in backends if b not in ("fa4", "trtllm_mha")] | ||
| return backends or ["flashinfer"] |
There was a problem hiding this comment.
What is output from this function call on rocm platform?
| "AITER_MOE_PADDING_SIZE": "192", | ||
| "HIP_GDN_SORT_IDX_BS": "32768", |
There was a problem hiding this comment.
To be cleanup. please all coments in benchmark/dflash/bench_dflash_gsm8k_sweep.py
| "SGLANG_ROCM_USE_AITER_LINEAR_SHUFFLE": "1", | ||
| "SGLANG_ROCM_USE_AITER_LINEAR_FP8HIPB": "1", | ||
| "USE_AITER_COMM": "1", | ||
| "AITER_MOE_SMALL_BATCH": "1", |
There was a problem hiding this comment.
To be cleanup. please all coments in benchmark/dflash/bench_dflash_gsm8k_sweep.py
| "--max-running-requests", | ||
| str(args.max_running_requests), | ||
| "--attention-backend", | ||
| backend, |
There was a problem hiding this comment.
Should add --linear-attn-backend aiter.
Add five standalone benchmark drivers under benchmark/dflash/ that launch servers across (attention_backend, tp_size) configs and run a workload for each (concurrency, num_questions) setting, reporting DFlash throughput and acceptance length against a baseline run.
equivalence (conservative lower bound)
For the code benchmarks, test execution runs after the timed generation region so it never contaminates throughput or accept-length numbers.
Launch environment matches launch_qwen3.5-397B-fp8_tp8_prefix_cache_DFlash.sh and is applied via setdefault before importing torch/sglang, so explicit caller exports still win.
These are benchmark scripts, not CI tests -- they are long-running by design.
Motivation
Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci