Repository navigation
Conversation
…n gfx950 num_programs_fwd capped the forward grid at one program per CU on every arch but gfx950, so gpt-oss's prefill norms (N 2880, block 4096, 96-CU DPX partition) ran 96 programs for thousands of rows. 4 per CU (gfx950's factor; 8 and 16 are no better): rows fused add + RMSNorm (us) RMSNorm (us) 1024 8.5 -> 5.3 7.0 -> 4.0 4096 31.6 -> 15.8 22.1 -> 9.8 7500 61.6 -> 31.6 43.6 -> 17.3 16384 132.0 -> 69.1 106.6 -> 38.6 Rows below 96 are unchanged (grid = rows). Outputs bitwise equal (per-row math).
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
… comment. The sibling normalization ops treat gfx1250 and gfx1250-strict as one target. The measurements now live in the PR description.
WAITING ON AUTHORPR 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 |
There was a problem hiding this comment.
🔵 Needs a closer look
The gfx1250 scheduling change needs GPU correctness and base-versus-head performance validation across all affected forward paths and block sizes up to 8192, but the review environment cannot run these checks and supplied timings cover only fused-add N=2880.
No open issues 🎉
What changed in this PR
Extends RMSNorm’s forward-grid optimization to gfx1250 and gfx1250-strict, matching the existing gfx950 behavior to improve utilization for large row counts.
Changes:
- Allows up to four forward programs per CU for blocks up to 8192 on gfx1250 variants.
- Leaves backward execution, workspace sizing, and other architectures unchanged.
| File | Description |
|---|---|
aiter/ops/triton/normalization/rmsnorm.py |
Adds gfx1250 variants to the forward-grid oversubscription condition and updates its comment. |
Review effort: Balanced
There was a problem hiding this comment.
Must fix before merge
- The grid size is a tuning value in Python (
rmsnorm.py:58-65): the PR turns onfwd_program_oversub = 4and the 8192 block cap for gfx1250, but tuning values belong in the JSON configs. The gfx1250 Gluon RMSNorm in the same file already readsPROGRAMS_PER_CUfrom its config. Fix: read both values fromconfigs/gfx1250/triton/normalization/rmsnorm/DEFAULT.json(and a gfx1250-strict file) withget_normalization_config.
Nice to fix
- Measure one N above 4096 (for example 7168) and one quant wrapper. Only N 2880 was measured, and the Gluon table for the same arch uses 2 per CU above 4096 (
rmsnorm.py:58-65). - Remove the
Co-Authored-By: Claudeline from commit17292da5before merge.
or I am also okay to merge if we get the CI passing too
…ch config Move PROGRAMS_PER_CU and OVERSUB_MAX_BLOCK_SIZE for gfx1250 and gfx1250-strict out of num_programs_fwd into configs/<arch>/triton/normalization/rmsnorm. gfx950 keeps its existing constants, so its grid is unchanged.
|
Thanks for the review. The blocker is fixed in
Still open:
|
4ec298c to
25f9e43
Compare
|
@Boss2002n following up on the review:
Still open from your review: measuring N=7168 and one quant wrapper on gfx1250. That needs a GPU run, and it is not done yet. The grid-constant fix from the blocker is in |
The generic Triton RMSNorm forward helper caps gfx1250 at one program per CU. This change reads
PROGRAMS_PER_CU=4andOVERSUB_MAX_BLOCK_SIZE=8192from the gfx1250 and gfx1250-strict Triton configs. Eligible forward paths usemin(M, 4 * CU_count)for blocks up to 8192 and retainmin(M, CU_count)for larger blocks. gfx950 and other architectures retain their grids.Upstream #7841 already handles eligible eager, aligned gfx1250 plain RMSNorm through a separate Gluon kernel/config: four programs/CU for blocks up to 4096, two above. This PR affects the remaining generic plain compile/layout fallback, gfx1250-strict, legacy fused-add, and smoothquant/dynamicquant with and without add. The separate
normalization/fused_rmsnorm_add.pyoperation and large-M/small-N row-tiling path use their own grids.On 96 CUs, affected paths cap at 384 programs for blocks<=8192; M<=96 keeps its grid, and M=97..383 uses M programs. Each kernel traverses rows with the program-count stride. Arithmetic, backward helpers and workspace allocation are unchanged; blocked backward cases may allocate M workspace rows.
This PR is independent of the unified-attention stack and merges main
ecfa616d80a17b4030feccb18da47df59dbca720.The base1130_v3 stack (MI450 gpt-oss measurements, December 1, 2026) carried an earlier version,
784ffa5e2, with hardcoded 4/8192. The shipped config preserves its grids; a CPU comparison found zero differences across 2,100 metadata cases. The stack's v1/v3 A/B contains the change in both arms and does not measure this PR alone. Upstream #7841 changes the current default plain wrapper's kernel relative to that older unit.Earlier reports gave N2880/M7500 legacy fused-add on 96 CUs at 61.6 -> 31.6 us, serving +0.7% at 8k and +1.6% at 70k, and 8k TTFT about -2.5%. The original isolated measurement setup and wrapper provenance are unverified. Performance has not been re-measured on this head.
PR Self-Review
Reviewed revision
6b2368491c377086835c45d95bc527190c42bc63Behavior and intent
Allow the remaining generic gfx1250/strict forward consumers to use up to four programs/CU for blocks<=8192, preserving the older unit's grid through per-architecture config. The separate upstream default Gluon path does not receive this scheduling change.
Validation and unverified scope
CPU command, with torch 2.12+ROCm 10.1 and Triton 3.8:
Seven tests pass using real config loading and CPU launch recorders. Substituting main's actual helper causes 39 assertion failures. Black, Ruff and whitespace checks pass. These checks validate dispatch/grid behavior without GPU execution.
GPU setup: MI455X (gfx1250) 96-CU partition, image
rocm/sgl-dev:v1.0.0-rocm101-mi45x-20261202, torch 2.12.0+rocm10.1.0, Triton 3.9.0. Main was compared with runtime revision2cc019fc2092c56eb49ddeea4403025bcd085595; the reviewed head adds only the CPU test and has identical runtime/config files.Public-wrapper parity passes 116/116 cases per arm: N2880/7168/8192/8193, M1000/7500/16000 and row boundaries, BF16/FP16, legacy fused-add/dynamicquant and fallback layouts. Actual eligible legacy grids change from 96 to 384, while small-M/large-block and upstream default controls retain their behavior.
The initial full run passes 492 tests on head and 491 on main, with one main failure at
test_rmsnorm_fused_add_dynamicquant[8192-65536-fp32-bf16]. Three alternating fresh-process repeats per arm all fail that node: 2,760–777,431 of 536,870,912 int8 elements differ, with maximum absolute differences 175–242 (allowed 1). All six launches use block32768 and grid96. This unchanged large-block path has a variable failure on both arms; the initial head pass does not establish a fix. Its nondeterminism mechanism remains unverified. Numerical parity for the affected block<=8192 matrix is supported; current performance remains unverified.PR-specific question
The new keys are consumed only by
num_programs_fwdfor gfx1250/strict, through generic plain, legacy add and the four quant wrappers innormalization/rmsnorm.py. CPU tests pin M around 96/384, N around 8192, CU scaling, strict and other-architecture controls, upstream Gluon versus fallback, and backward/workspace behavior. The new config is separate from the Gluon table and the independent fused-add operation.Changed op tests
test_rmsnorm_config.pychecks real config resolution and public-wrapper dispatch with CPU launch recorders, including all five legacy add/quant consumers and the upstream default control. Numerical op tests can exercise upstream's default kernel without touching the changed helper; this test verifies the intended consumers and unrelated selections explicitly.