Repository navigation
Conversation
The benchmark timed the op with the default round_intermediate=False against an eager baseline that rounds the product first, so the two providers did not compute the same result. Pass round_intermediate=True and check that the output equals eager before timing. Signed-off-by: Sylvan Liu <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the benchmark-only change aligning provider rounding and adding a pre-timing output comparison.
No open issues 🎉
What changed in this PR
This benchmark-only change makes the fused and eager providers use matching rounding behavior, so their timings compare the same computation. It separates the benchmark correction from #8681 and leaves the op and kernel unchanged.
Changes:
- Pass
round_intermediate=Trueto the fused provider. - Check fused output against eager output before timing and raise on a mismatch.
| File | Description |
|---|---|
op_tests/op_benchmarks/triton/bench_fused_indexed_gated_residual.py |
Aligns fused rounding with eager and adds a pre-timing equality check. |
Review effort: Balanced
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
|
The This PR only changes |
Summary
op_tests/op_benchmarks/triton/bench_fused_indexed_gated_residual.pynow timesfused_indexed_gated_residualwithround_intermediate=True. Before timing, it checks that the fused output equals the eager baseline. Split out of #8681 at review's request.Motivation
The benchmark called the op with the default
round_intermediate=False, while its eager baseline (residual + gate[indices] * x) rounds the product to bf16 before the add. So the two providers did not compute the same result, and the comparison was not like-for-like.Changes
round_intermediate=True.No kernel or op change.
Performance (if applicable)
Kernel unchanged. The benchmark now times the eager-rounded path, on gfx1201 (Radeon AI PRO R9700), N = 5376:
Testing
Documentation
Benchmark-only change.
AI assistance: this change was developed with the help of an AI coding assistant (GitHub Copilot). All timings above were run on the listed hardware.
PR Self-Review
Reviewed revision
e05a7f0
Behavior and intent
Only the benchmark changes. Its fused provider now computes the same rounding as its eager provider, and it verifies bit-equality before timing. If the two ever diverge, it raises instead of reporting a misleading speedup. The op and the tests are unchanged.
Validation and unverified scope
python3 op_tests/op_benchmarks/triton/bench_fused_indexed_gated_residual.py -M 16384and-M 4096 --scattered. The equality check passes, and the timings are in the table above.PR-specific question
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?
The only changed file is the benchmark; no op test changes. Before this PR it timed
round_intermediate=Falseagainst an eager baseline that rounds the product, so the reported speedup compared two different computations. The new equality check raises in that configuration. No existing test or benchmark checks that the two benchmark providers agree. The op's own rounding behavior is covered bytest_fused_indexed_gated_residual.py, which this PR does not touch.Changed op tests
op_tests/op_benchmarks/triton/bench_fused_indexed_gated_residual.py: the fused provider usesround_intermediate=True, and its output is checked equal to eager before timing, so the two providers compute identical results. It is a benchmark, not a test.