Skip to content

[Triton/Gluon] : Make use of parser arg consistent in benchmarks - #6347

Merged
rahulbatra85 merged 2 commits into
mainfrom
triton_benchmark_parse_arg
Oct 20, 2026
Merged

rahulbatra85 merged 2 commits into
mainfrom
triton_benchmark_parse_arg

Conversation

@rahulbatra85

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@rahulbatra85
rahulbatra85 requested a review from a team October 10, 2026 00:28
@rahulbatra85
rahulbatra85 marked this pull request as draft October 10, 2026 00:28
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6347 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@github-actions github-actions Bot changed the title [Triton/Gluon]: Make use of parser arg consistent in benchmarks [Triton/Gluon] : Make use of parser arg consistent in benchmarks Oct 10, 2026
@rahulbatra85
rahulbatra85 force-pushed the triton_benchmark_parse_arg branch from 66de572 to e8253a2 Compare October 10, 2026 00:43
@rahulbatra85
rahulbatra85 marked this pull request as ready for review October 10, 2026 00:44
@Boss2002n
Boss2002n requested a balanced review from Copilot October 10, 2026 04:15

Copilot AI left a comment

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.

🟡 Changes recommended

Shared argument definitions cause parser conflicts and break several existing metric, backend, and model contracts.

9 open findings
What changed in this PR

Standardizes Triton/Gluon benchmark command-line parsing through the shared benchmark parser.

Changes:

  • Adds shared backend selection and all metric 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.

@zufayu
zufayu requested review from a team and vgokhale October 12, 2026 01:27
@azaidy azaidy assigned Boss2002n and brunomazzottiamd and unassigned vgokhale Oct 12, 2026
@rahulbatra85
rahulbatra85 force-pushed the triton_benchmark_parse_arg branch 3 times, most recently from 58c9c07 to a320331 Compare October 12, 2026 23:50

@brunomazzottiamd brunomazzottiamd left a comment •

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.

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!

@brunomazzottiamd

Copy link
Copy Markdown
Contributor

Hi @saeid-rostami. Can you please explain us how model selection work in op_tests/op_benchmarks/triton/bench_conv2d.py and op_tests/op_benchmarks/triton/bench_conv3d.py? Please check the proposed changes in the files I mentioned.

@rahulbatra85
rahulbatra85 force-pushed the triton_benchmark_parse_arg branch from a320331 to ee2a62a Compare October 14, 2026 00:07
@rahulbatra85

Copy link
Copy Markdown
Contributor Author

@brunomazzottiamd Yeah, I noticed after copilot pointed that out. I pushed changes

@rahulbatra85
rahulbatra85 force-pushed the triton_benchmark_parse_arg branch from ee2a62a to 79d75a9 Compare October 14, 2026 02:15
@brunomazzottiamd

Copy link
Copy Markdown
Contributor

@brunomazzottiamd Yeah, I noticed after copilot pointed that out. I pushed changes

Thanks! I'll check it again!

@brunomazzottiamd brunomazzottiamd left a comment

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.

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 brunomazzottiamd left a comment

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.

Another nitpick...

@saeid-rostami

Copy link
Copy Markdown
Contributor

Hi @saeid-rostami. Can you please explain us how model selection work in op_tests/op_benchmarks/triton/bench_conv2d.py and op_tests/op_benchmarks/triton/bench_conv3d.py? Please check the proposed changes in the files I mentioned.

Hi @brunomazzottiamd ,
Both benchmarks use pre-extracted shapes from conv_shapes.json.

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.

@rahulbatra85

Copy link
Copy Markdown
Contributor Author

@brunomazzottiamd Sorry, I missed some benchmarks and they still don't use the override_parser_action. Will clean this up.

@brunomazzottiamd

brunomazzottiamd commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

@brunomazzottiamd Sorry, I missed some benchmarks and they still don't use the override_parser_action. Will clean this up.

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 brunomazzottiamd left a comment

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.

Checked again and resolved some pending discussions.

@brunomazzottiamd

Copy link
Copy Markdown
Contributor

Hi @saeid-rostami. Can you please explain us how model selection work in op_tests/op_benchmarks/triton/bench_conv2d.py and op_tests/op_benchmarks/triton/bench_conv3d.py? Please check the proposed changes in the files I mentioned.

Hi @brunomazzottiamd , Both benchmarks use pre-extracted shapes from conv_shapes.json.

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.

@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. conv_shapes.json file.

@rahulbatra85

Copy link
Copy Markdown
Contributor Author

Hi @saeid-rostami. Can you please explain us how model selection work in op_tests/op_benchmarks/triton/bench_conv2d.py and op_tests/op_benchmarks/triton/bench_conv3d.py? Please check the proposed changes in the files I mentioned.

Hi @brunomazzottiamd , Both benchmarks use pre-extracted shapes from conv_shapes.json.
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.

@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. conv_shapes.json file.

@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.

parser.add_argument(
    "--model-configs",
    type=str,
    default="utils/model_configs.json",
    help="Model config json file.",
)

@rahulbatra85
rahulbatra85 force-pushed the triton_benchmark_parse_arg branch 2 times, most recently from 2e8df1f to cf40bdc Compare October 19, 2026 21:18

@brunomazzottiamd brunomazzottiamd left a comment

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.

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.

@rahulbatra85

Copy link
Copy Markdown
Contributor Author

@brunomazzottiamd Missed those three. I fixed and pushed again

@brunomazzottiamd brunomazzottiamd left a comment

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.

LGTM! Let's merge it!

@rahulbatra85
rahulbatra85 merged commit 579e023 into main Oct 20, 2026
@rahulbatra85
rahulbatra85 deleted the triton_benchmark_parse_arg branch October 20, 2026 21:10
Liang-jianhao97 added a commit that referenced this pull request Oct 26, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants