Repository navigation
[Triton/Gluon] : Change RotatingBuffersBench API and update any existing benchmarks - #7121
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
🟡 Changes recommended
The sizing loop retains its last tensor sample during pool allocation, increasing peak GPU memory and potentially causing an otherwise fitting pool to run out of memory.
1 open issue
What changed in this PR
This PR extends the Triton/Gluon benchmark helper to size rotating buffer pools from nested tensor inputs and exclude selected fields from sizing.
Changes:
- Adds
exclude_from_sizingto omit named fields from the memory estimate. - Recursively counts tensors in dictionaries, lists, and tuples while preserving storage deduplication.
| File | Description |
|---|---|
op_tests/op_benchmarks/triton/utils/benchmark_utils.py |
Adds field exclusions and recursive tensor counting for rotating pool sizing. |
Review effort: Balanced
31f3ded to
ecf63c2
Compare
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
ecf63c2 to
cb4a98e
Compare
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
ruff
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_gemm_commons.py
Lines 1 to 16 in cb4a98e
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_kda_decode.py
Lines 17 to 38 in cb4a98e
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_rmsnorm_add.py
Lines 1 to 22 in cb4a98e
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_sigmoid_mul.py
Lines 8 to 30 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w16.py
Lines 1 to 27 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w16_gated.py
Lines 1 to 26 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w16_gating.py
Lines 1 to 26 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w4.py
Lines 1 to 27 in cb4a98e
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a8w8.py
Lines 1 to 29 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a8w8_blockscale.py
Lines 1 to 34 in cb4a98e
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a8wfp4.py
Lines 1 to 30 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_afp4wfp4.py
Lines 1 to 31 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_afp8wfp8.py
Lines 11 to 40 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gmm.py
Lines 9 to 64 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_layernorm.py
Lines 1 to 27 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_mla.py
Lines 6 to 24 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_mla_decode_rope.py
Lines 1 to 29 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_rmsnorm.py
Lines 1 to 25 in cb4a98e
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_rope.py
Lines 1 to 40 in cb4a98e
cdc8ca0 to
5332c56
Compare
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
ruff
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_gemm_commons.py
Lines 1 to 16 in 5332c56
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_kda_decode.py
Lines 17 to 38 in 5332c56
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_qk_concat.py
Lines 6 to 30 in 5332c56
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_rmsnorm_add.py
Lines 1 to 22 in 5332c56
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_fused_sigmoid_mul.py
Lines 8 to 30 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w16.py
Lines 1 to 27 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w16_gated.py
Lines 1 to 26 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w16_gating.py
Lines 1 to 26 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a16w4.py
Lines 1 to 27 in 5332c56
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a8w8.py
Lines 1 to 29 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a8w8_blockscale.py
Lines 1 to 34 in 5332c56
Import block is un-sorted or un-formatted
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_a8wfp4.py
Lines 1 to 30 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_afp4wfp4.py
Lines 1 to 31 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gemm_afp8wfp8.py
Lines 11 to 40 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_gmm.py
Lines 9 to 64 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_layernorm.py
Lines 1 to 27 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_mla.py
Lines 6 to 24 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_mla_decode_rope.py
Lines 1 to 29 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_rmsnorm.py
Lines 1 to 25 in 5332c56
Import block is un-sorted or un-formatted
aiter/op_tests/op_benchmarks/triton/bench_rope.py
Lines 1 to 40 in 5332c56
b29eac5 to
c98f944
Compare
c98f944 to
fc148b7
Compare
There was a problem hiding this comment.
The new RotatingBufferBench class is a good cleanup.
Must fix before merge
Two benchmarks no longer run (benchmark_utils.py:378-380): bench_all_reduce.py and bench_all_reduce_rmsnorm_quant.py still import the deleted helpers and fail with ImportError. Fix: move them to RotatingBufferBench.
The default pool is one input set (rotating_buffer_bench.py:82-83): min_pool_len and max_pool_len default to 1, so benchmarks built without the CLI options stop rotating. Fix: default to 4 and 1000.
Settings leak between shapes (rotating_buffer_bench.py:175-184): per-call values stay on the object, so a later shape can get 64 entries (32 GiB) and pass the memory cap. Fix: keep them local.
Nice to fix
Restore del kwargs, v after sizing (rotating_buffer_bench.py:225-232).
Reject unknown keys in from_dict() (rotating_buffer_bench.py:117-126).
Update the --graph-* help, which names the deleted do_bench_aiter_triton (argparse.py:99-122).
Use logger instead of print, shorten the long docstrings, write gfx950 instead of MI355X, and keep main's names (_out_val_keys).
Merge order
Merge this PR first (nine PRs carry its API commit), after a rebase for the conflict with #6727.
-Split out new rotating buffer pool generation and do_bench_aiter_Triton into separate file and a class -Add exclude list arg and allow list/dict/tuple of tensors in generate_rotating_buffers_pool
3c14021 to
719dfbb
Compare
719dfbb to
88f4014
Compare

Motivation
--Currently, only tensors are accepted for building rotating buffers pool. Allow list/dict/tuple of tensors in generate_rotating_buffers_pool
--Separate out RotatingBuffer and do_bench_aiter_triton into it's own file
--pool target_mb is not set based on the arch/device
PR Self-Review
What behavior does this PR change, and why is the existing behavior insufficient?
-separate rotating buffers and do_bench_aiter_triton into it's own file
-new API using class called RotatingBufferBench
-use defaults for target_mb based on arch.
-determine max_gpu_mb based on free device memory available when creating the pool
What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
-Just tried the change with benchmark that needs it.
What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
--This adds functionality for Triton benchmarks. There are no test for benchmarks.
For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.
-This adds functionality for Triton benchmarks. There are no test for benchmarks.