Repository navigation
[Triton/Gluon] : Make use of parser arg consistent in benchmarks - #6347
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
66de572 to
e8253a2
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Shared argument definitions cause parser conflicts and break several existing metric, backend, and model contracts.
9 open findings
Unconditional shared backend option conflicts with existing callers · New Shared model option breaks source argument exclusivity · New Default backend resolves to None instead of auto · New Invalid model values cause a KeyError instead of parser errors · New Explicit auto backend is rejected after type conversion · New Shared metric choices reject or accept unsupported benchmark metrics · New Usage documentation uses the removed -metric option · New Module usage advertises obsolete -metric spelling · New Usage example still documents removed -metric option · New
What changed in this PR
Standardizes Triton/Gluon benchmark command-line parsing through the shared benchmark parser.
Changes:
- Adds shared backend selection and
allmetric support. - Migrates benchmark scripts to
get_parser. - Reuses the shared dtype mapping in batch-prefill.
| File | Description |
|---|---|
op_tests/op_benchmarks/triton/utils/argparse.py |
Extends common backend and metric arguments. |
op_tests/op_benchmarks/triton/bench_unified_attention.py |
Uses shared backend parsing. |
op_tests/op_benchmarks/triton/bench_topk.py |
Migrates model and metric arguments. |
op_tests/op_benchmarks/triton/bench_sparse_mla.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_sparse_mla_dsv4_train.py |
Migrates parser and metric handling. |
op_tests/op_benchmarks/triton/bench_sparse_attention_dsv4.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_sparse_attention_dsv4_bwd.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_sonicmoe.py |
Migrates parser and metric default. |
op_tests/op_benchmarks/triton/bench_silu_and_mul_backward.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_sage.py |
Migrates SAGE benchmark arguments. |
op_tests/op_benchmarks/triton/bench_rope.py |
Centralizes model parsing. |
op_tests/op_benchmarks/triton/bench_rmsnorm.py |
Centralizes model and metric parsing. |
op_tests/op_benchmarks/triton/bench_quant_mxfp8.py |
Migrates quantization arguments. |
op_tests/op_benchmarks/triton/bench_quant_mxfp4_fp8.py |
Centralizes model and metric parsing. |
op_tests/op_benchmarks/triton/bench_quant_mxfp4_blockscale.py |
Migrates blockscale arguments. |
op_tests/op_benchmarks/triton/bench_quant_fp8_blockwise.py |
Migrates metric parsing. |
op_tests/op_benchmarks/triton/bench_pa_mqa_logits_mxfp4.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_pa_decode.py |
Centralizes model and backend parsing. |
op_tests/op_benchmarks/triton/bench_na3d_flash.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_moe_wgrad.py |
Migrates metric parsing. |
op_tests/op_benchmarks/triton/bench_moe_situ_epilogue.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_moe_gemm_int8_smoothquant.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_moe_gemm_a8w8.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_moe_gemm_a8w8_blockscale.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_moe_gemm_a8w4_proton.py |
Centralizes backend parsing. |
op_tests/op_benchmarks/triton/bench_moe_gemm_a8w4_cudagraph.py |
Centralizes backend parsing. |
op_tests/op_benchmarks/triton/bench_moe_gemm_a4w4_proton.py |
Centralizes backend parsing. |
op_tests/op_benchmarks/triton/bench_moe_gemm_a4w4_cudagraph.py |
Centralizes backend parsing. |
op_tests/op_benchmarks/triton/bench_moe_gemm_a16w4.py |
Migrates parser with Gluon default. |
op_tests/op_benchmarks/triton/bench_mla.py |
Centralizes backend and metric parsing. |
op_tests/op_benchmarks/triton/bench_mla_decode.py |
Centralizes model parsing. |
op_tests/op_benchmarks/triton/bench_mhc.py |
Migrates metric parsing. |
op_tests/op_benchmarks/triton/bench_mhc_fused_post_pre_delayed_rmsnorm.py |
Migrates parser and usage syntax. |
op_tests/op_benchmarks/triton/bench_mhc_dsv4.py |
Migrates parser and usage syntax. |
op_tests/op_benchmarks/triton/bench_layernorm.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_la_paged_decode.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_kda.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_hstu_attn.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_gmm.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_gated_delta_rule_snapshot_dtype.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_gated_delta_rule_block.py |
Centralizes model parsing. |
op_tests/op_benchmarks/triton/bench_fused_sigmoid_mul.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_fused_rmsnorm_add.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_fused_mla_prefill_qkv_fp8.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_fused_kda_decode.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_fused_gdn_prefill_qkvz.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_fused_gdn_decode_qkvz.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_fused_clamp_act_mul.py |
Centralizes backend and metric parsing. |
op_tests/op_benchmarks/triton/bench_fused_add_rmsnorm_pad.py |
Centralizes backend and metric parsing. |
op_tests/op_benchmarks/triton/bench_fp8_mqa_logits.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_flash_kda.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_fav3_sage_mxfp4.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_fast_transpose.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_extend_attention.py |
Centralizes model parsing. |
op_tests/op_benchmarks/triton/bench_dsv4_indexer.py |
Migrates metric parsing. |
op_tests/op_benchmarks/triton/bench_deepgemm_attention.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_cross_entropy.py |
Migrates metric parsing. |
op_tests/op_benchmarks/triton/bench_conv3d.py |
Centralizes source and metric arguments. |
op_tests/op_benchmarks/triton/bench_conv2d.py |
Centralizes model and metric arguments. |
op_tests/op_benchmarks/triton/bench_chunk_kda.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_chunk_delta_attn.py |
Adopts the shared parser. |
op_tests/op_benchmarks/triton/bench_cache_copy.py |
Centralizes metric parsing. |
op_tests/op_benchmarks/triton/bench_batch_prefill.py |
Centralizes parsing and dtype mapping. |
op_tests/op_benchmarks/triton/bench_attn_res.py |
Centralizes metric parsing. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
58c9c07 to
a320331
Compare
There was a problem hiding this comment.
Kudos to the initiative of removing duplicated code, I fully agree with proceeding in this direction. However, I have some concerns.
My main concern is the fact that some benchmarks don't implement all three metrics: time, throughput and bandwidth. Some benchmarks even add other metrics, like arithmetic intensity. This standardization effort will show time, throughput and bandwidth in the help text - this will lead to poor UX in some cases. We need a scape hatch, so each benchmark can specify its own metrics if it deviates from the norm.
Still on metrics topic: IMHO metric all doesn't make sense. How is it implemented? Is the benchmark executed again and again for every available metric? Is time collected and then converted to the other metrics with just one benchmark execution?
The other concern I have is related to model specification. I'm not that sure if we can reach this standardization level. I'd study this part a bit more and proceed just with backend and metric parts.
So far so good w.r.t to Triton / Gluon backend selection. LGTM!
|
Hi @saeid-rostami. Can you please explain us how model selection work in |
a320331 to
ee2a62a
Compare
|
@brunomazzottiamd Yeah, I noticed after copilot pointed that out. I pushed changes |
ee2a62a to
79d75a9
Compare
Thanks! I'll check it again! |
brunomazzottiamd
left a comment
There was a problem hiding this comment.
Publishing 2nd review round. I've found some nitpicks in the benchmark scripts and I have some questions about op_tests/op_benchmarks/triton/bench_tests/test_benchmark_smoke.py.
brunomazzottiamd
left a comment
There was a problem hiding this comment.
Another nitpick...
Hi @brunomazzottiamd , In bench_conv2d.py, supplying all of --N --C --H --W --K --R --S selects a single custom shape. Otherwise, --smoke selects the built-in edge cases, and --model selects a model’s Conv2d shapes using a unique, case-insensitive substring match. Without either option, it defaults to resnet50. In bench_conv3d.py, --shape, --smoke, and --model are intended to be mutually exclusive workload sources. --shape accepts N C D H W K T R S, --smoke selects the built-in edge cases, and --model selects Conv3D shapes using the same unique, case-insensitive substring matching. Without a source, it defaults to wan22-a14b-vae. |
|
@brunomazzottiamd Sorry, I missed some benchmarks and they still don't use the override_parser_action. Will clean this up. |
79d75a9 to
4e97e29
Compare
No problem at all! I can review your benchmarks PR as many times as necessary! FYI: #6287 and #6501 add new benchmarks. Keep these PRs under your radar. @nidal567, can you please double check if the benchmarks you have recently added are covered by this PR? It would be nice if you could share your benchmarks roadmap with Rahul. Thanks! |
brunomazzottiamd
left a comment
There was a problem hiding this comment.
Checked again and resolved some pending discussions.
@rahulbatra85, I'd revert the model related changes in the convolution benchmarks and keep only the metric related changes. These benchmarks get their shapes from another source, i.e. |
@brunomazzottiamd The model_configs arg can be overwritten to supply any file. It's bench_conv2d and bench_3d that don't use convention. Convolution benchmarks need other cleanups like not doing accuracy checks, not using dtypes lookup functions from common util etc. |
2e8df1f to
cf40bdc
Compare
brunomazzottiamd
left a comment
There was a problem hiding this comment.
LGTM!
I tried to mark all resolved discussions as resolved, but I might have missed some. I also didn't check Copilot comments, please take a look at them and reason about them (most of the time they don't make sense IMHO).
We still have 3 nitpicks on the following benchmarks:
-
op_tests/op_benchmarks/triton/bench_fused_rmsnorm_add.py -
op_tests/op_benchmarks/triton/bench_hstu_attn.py -
op_tests/op_benchmarks/triton/bench_layernorm.py
Address at your own judgement.
2e66f48 to
f35a685
Compare
|
@brunomazzottiamd Missed those three. I fixed and pushed again |
brunomazzottiamd
left a comment
There was a problem hiding this comment.
LGTM! Let's merge it!
bench_flash_kda.py conflicted: main builds the parser with get_parser (#6347), next to the imports and the --shape/--k3-tp8 group this branch added. Keep both.



Motivation
Technical Details
Test Plan
Test Result
Submission Checklist