Add --profile to the W4A16 perf test for external profiler captures - #1068
Merged
Conversation
Signed-off-by: Matthias Gehre <matthias.gehre@amd.com>
Capturing a single kernel dispatch with rocprofv3 ATT was impractical.
Two things got in the way: the session-scoped GPU warm-up fixture sweeps
a different shape across all 13 batch sizes, and do_bench issues hundreds
of launches per measurement. A capture then contains thousands of
dispatches, the ATT buffer overflows ("Wave incomplete"), and the decoded
traces are dominated by warm-up kernels of an unrelated shape rather than
the kernel under study.
--profile makes the run capture-shaped:
- skips the GPU warm-up pass entirely
- one warmup + one measured launch (do_bench derives its counts as
max(1, int(budget_ms / estimate_ms)), so a zero budget clamps to 1)
- implies --eager, since graph-captured kernels are invisible to
per-dispatch profilers
Runtime for a single shape drops ~7s -> ~3.1s and a capture contains one
dispatch of the target kernel.
Changes:
- Out-of-band results are reported but not asserted under --profile. A
single un-warmed launch sits ~20% below the golden band by construction,
so failing would report a regression that is not one, and a non-zero
exit under a profiler reads as a broken run.
- Timings from a --profile run are NOT comparable to the golden baselines
(0.55 vs 0.70 TFLOP/s on the shape used here). It is a capture mode, not
a measurement mode; the help text and docstrings say so.
- Includes the --eager commit it builds on, which was not upstreamed
separately.
Used to capture gemma-4-31B gate_up (1x43008x5376) on gfx1151: single
dispatch, correct instantiation, no buffer truncation.
Signed-off-by: Matthias Gehre <matthias.gehre@amd.com>
eble-amd
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Capturing a single kernel dispatch with
rocprofv3 --attwas impractical against this test.Two things got in the way:
_warm_up_gpufixture sweepssorted(SHAPES)[0]across all 13 batch sizesdo_benchissues hundreds of launches per measurementA capture therefore contained thousands of dispatches, overflowed the ATT buffer
(
Wave incomplete: The trace was cutoff before all waves ended), and decoded to tracesdominated by warm-up kernels of an unrelated shape. Concretely, a first attempt at capturing
gemma-4-31B gate_upproduced two decoded dispatches of ag=128warm-up shape plus a118 MB
__amd_rocclr_copyBuffer— and none of the kernel actually under study.Change
--profilemakes the run capture-shaped:do_benchderives its iteration counts asmax(1, int(budget_ms / estimate_ms)), so a zero budget clamps both to 1--eager, since graph-captured kernels are invisible to per-dispatch profilersSingle-shape runtime drops ~7 s -> ~3.1 s, and a capture contains one dispatch of the target
kernel.