Repository navigation
[Triton/Gluon] fix gluon import and benchmark + tune fused_clamp_act_mul for gfx950 - #5800
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
brunomazzottiamd
left a comment
There was a problem hiding this comment.
Proposed change makes sense. I'm only worried about code complexity and AI-driven code duplication. Please evaluate my requests with your own judgement.
azaidy
left a comment
There was a problem hiding this comment.
- Why tune for only 1 or 2 Ms? Why not more?
- Can you state the benchmark command you used for the sweep just for reference so that we know if default args were used or more?
ffb9d2a to
696ea1a
Compare
|
Unrelated test failures on
I think it's asserting |
Should be fixed by #5958. |
696ea1a to
d38d553
Compare
d38d553 to
c9e2ac1
Compare
azaidy
left a comment
There was a problem hiding this comment.
Last nit. Either address it here on in a follow up if CI has passed.
ce1c3af
c9e2ac1 to
ce1c3af
Compare
ce1c3af to
fca6bb3
Compare
azaidy
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the contribution and addressing the multiple rounds of review.
Motivation
On
gfx950,fused_clamp_act_mulregression on Triton 3.8 at large-M prefill shapes up to 7.2%The kernel was not tuned at M, as it was only tuned previously on row width (N). Essentially,
M=1andM=16384at the same N received the same launch config. The triton path launchesgrid=(M,), meaning one program per row, andBLOCK_SIZE_Nis the whole row. In this case,num_warpsis the only knob to be tuned, and past a few thousand rows, the grid alone fills the GPU. The shipped width-keyed value is tuned for small M and is too high for prefill. Decode (M <= 128) is unaffected and measures identically on both compilers.Also, the benchmark for this kernel was not usable on main. It fails to import
_is_gluon_available()and it crashesrocprofv3runs for shapes due torepbeing hardcoded. Both issues are fixed here.Technical Details
The kernel now checks the N-specialized
FUSED_CLAMP_ACT_MUL-N={N}.jsonfor the largestM_GEQ_<x> <= Mbefore falling back to the existingDEFAULT.json, which is unchanged.Tuned values (gfx950, from a
num_warpssweep of 1/2/4/8/16 per shape):Benchmark fixes
is_gluon_available()restored, as the benchmark didn't import properly. The guard now asserts properly.--repmade configurable, because the default 100 crashesrocprofv3. Make it an argument so that one can define the number of reps desired.Test Plan
rocprofv3 --kernel-traceruns with kernel time (10/80/10 trimmed mean)Test Result
23 shapes: 0 regressions, 5 improvements, 18 neutral. The 5 improvements are exactly the 5 measured shapes whose
num_warpschanges; every shape whose routing is unchanged is neutral.Decode unchanged. All 13 shapes at M <= 128 are neutral
Correctness:
330 passed, 454 skipped, 200 warnings in 16.15sStyle:
blackandruff==0.16.0clean.Benchmark: imports and runs; its default sweep profiles under
rocprofv3without crashing, and--rep 100still reproduces the SIGSEGV on--shape 1 512and--shape 16384 512.Submission Checklist