Repository navigation
pin Triton RMSNorm/LayerNorm launch configs instead of autotuning - #792
matthiasdiener wants to merge 2 commits into
Conversation
|
|
||
| # triton drop-in replacement for transformer_engine::pytorch::rmsnorm_bwd | ||
| def te_rmsnorm_bwd_triton(dz, x, rsigma, gamma, sm_margin, zero_centered_gamma, autotune: bool = True): | ||
| del autotune # Kept for API compatibility; the bwd launch configs are fixed by width. |
There was a problem hiding this comment.
Since this is a TE-only API I think we can deprecate this parameter, e.g. set the default to "deprecated" and then warn on usage, and internally force-set it to false.
There was a problem hiding this comment.
Good idea, thanks. Done (in spirit) in 15d8189; te_rmsnorm_fwd_triton still uses autotuning in part (for the FP8 transpose kernel).
|
Re-checked at 15d8189. The new commit only changes how the On CI: both red sGPU jobs (mi30x and mi35x) fail only in the Thanks again, @matthiasdiener, and @Micky774 for the review. |
Description
Fixes #790 (related PRs: #646, #615, #593).
Triton's autotuner picks a launch config per process by timing. For the
RMSNorm and LayerNorm kernels, num_warps (and the RMSNorm dgamma-reduce block
shape) sets the reduction order, so processes running identical
shapes can produce slightly different results.
Launch configs are now fixed by row width:
On gfx950 these are within ~1% geomean of the per-shape best. LayerNorm fwd
is 1.2-2.4x faster at widths <= 2048, which the old config space missed.
The autotune kwargs remain for API compatibility. The FP8 transpose stays
autotuned because its output does not depend on the config.
Also adds a test.
cc @jbelofamd
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: