Repository navigation
[OPUS][Config] gfx1250 96cu bf16 GEMM: GPT-OSS TP2 LM head, M 33..256 - #8862
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
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 |
9390e8d to
f13e70d
Compare
f13e70d to
0e4c85f
Compare
Add OPUS rows for the gpt-oss TP2 LM head (N=100544, K=2880, bf16, no bias)
on the 96-CU gfx1250 partition, for M = 64, 80, ..., 256 and 168. The shape
had no row, so it ran the default triton (gluon) kernel.
Rows are from csrc/gemm_a16w16/gemm_a16w16_tune.py --libtype opus. Timed
cache-cold through tgemm.mm against the gluon path, two runs. The gluon side
uses the entries of the gluon config PR (128x128x64 for M 65..128, 256x256x64
for M 129..256); main is slower than that above M=64:
M gluon OPUS ratio
64 113 us 100 us 1.12x
65..128 118-130 us 103-115 us 1.09-1.14x
129..192 196-202 us 147-153 us 1.32-1.34x
200..256 203-208 us 181-184 us 1.12x
The QKV (2560x2880) and O (2880x2048) shapes were tuned too; OPUS is 29% to
42% slower than gluon there, so they get no row.
Signed-off-by: Xiaohu Guo <[email protected]>
0e4c85f to
8d4ebc9
Compare
Add the 14 no-bias inputs for N=100544, K=2880 (M = 64 to 256 in steps of 16, and M=168) to gptoss_bf16_untuned_gemm.csv. They are the inputs of the gfx1250 96cu OPUS rows in gptoss_bf16_tuned_gemm.csv, so a retune from the untuned file covers them. Signed-off-by: Xiaohu Guo <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The M=64 row also switches backend dispatch for M=33–63, outside the claimed scope and reported validation range, so those batches need their prior dispatch preserved or benchmarked and validated.
2 open issues
Review effort: Balanced
Conflict in gemm_a16w16_gfx950_utils.py vs ROCm#8460: main adds an s_nop 1 after the inline-asm global_store_dwordx4 in store_global_f32_vec and in SplitKProtocol.zero_c. This branch removes both (no zero-init of C, no atomic split-K store); its workspace and C stores go through BufferCopy128b and write_cshuffle_vec_to_global, which LLVM emits and pads itself. No inline-asm store is left in the A16W16 kernel, so the branch side is kept. gptoss_bf16_tuned_gemm.csv merges cleanly: the branch's gfx950 rows plus main's 14 gfx1250 rows from ROCm#8862, no duplicate keys. Co-authored-by: Claude <[email protected]> Signed-off-by: Andreas Karatzas <[email protected]>


Summary
Adds 14 OPUS rows to
aiter/configs/model_configs/gptoss_bf16_tuned_gemm.csvfor the GPT-OSS TP2 LM head (N=100544, K=2880, bf16, no bias) on the 96-CU gfx1250 partition: M = 64, 80, 96, 112, 128, 144, 160, 168, 176, 192, 208, 224, 240, 256. The lookup pads M, so the rows serve every M from 33 to 256: M = 33 to 63 use the M=64 row. The same 14 shapes are added togptoss_bf16_untuned_gemm.csv.Motivation
gpt-oss-120b with TP 2 on two 96-CU partitions runs the LM head as a 100544 x 2880 GEMM once per decode step. The shape has no gfx1250/96 row, so
tuned_gemmuses the default triton (gluon) path. For decode batches of 33 to 256, OPUS is 10% to 34% faster than the best gluon config.Changes
gptoss_bf16_tuned_gemm.csv: 14 rows withlibtype=opus, as written bycsrc/gemm_a16w16/gemm_a16w16_tune.py --libtype opus. No code change.gptoss_bf16_untuned_gemm.csv: the 14 no-bias input shapes of these rows, so a retune from the untuned file covers them.Performance (if applicable)
Hardware: MI450X, one 96-CU DPX/NPS2 partition (gfx1250). Both sides run through
aiter.tuned_gemm.tgemm.mm. Timing is cache-cold: one CUDA graph walks a pool of distinct weight copies, timed with CUDA events, mean without slow outliers. Two runs per side, back to back; the table gives the mean of the two, and the runs agree within 2.2%."Before" is the gluon path with the entries of the gluon config PR for the same shape (branch
gfx1250-96cu-gptoss-decode-configs: 128x128x64 for M 65 to 128, 256x256x64 for M 129 to 256). "After" is the OPUS row. On plainmainthe gluon path is slower above M=64 (194 us at M=96 and 479 us at M=168 in the gluon tuning harness), so againstmainthe gain is larger than the table shows.Batches between two rows take the padded row and were timed too: M=65 1.15x, M=129 1.34x, M=150 1.34x, M=200 1.12x.
M = 33 to 63 use the M=64 row through the padding. Same harness, two runs per side back to back, the runs agree within 0.2%. M=32 and below do not reach an OPUS row and stay on gluon (88.1 us at M=32 on both sides).
Relative max error against fp32
torch.matmul: 2.7e-03 to 3.1e-03 on every row, M = 33 to 63 included.Tuning command:
Testing
On the MI450X 96-CU partition:
python3 -m unittest op_tests.tuning_tests.test_config_shape_collision: 34 tests OK.pytest op_tests/tuning_tests/test_csv_validation.py op_tests/tuning_tests/test_a16w16_tuned_config_lookup.py: 55 passed, 2 failed. The two failures areTestFlydslRingTunerCandidates(unsupported FlyDSL kernel configuration). They fail the same way without the rows of this PR and do not read these files.AITER_CONFIG_GEMM_BF16not set): every M from 33 to 256 in the tables selects an OPUS row and passes the error bound.Documentation
The change adds config rows only.
Dependencies
Breaking Changes
None.
PR Self-Review
Reviewed revision
2de75f4
Behavior and intent
On a 96-CU gfx1250 partition, a bf16 GEMM with N=100544, K=2880 and no bias now uses an OPUS kernel when M is 33 to 256 (M = 33 to 63 through the M=64 row). Before, the shape had no row and used the default gluon path, which is 10% to 34% slower for these batches. M = 1 to 32 and M above 256 do not change. Other shapes, other M values and other devices do not change: the rows are keyed on gfx1250 and cu_num 96.
Validation and unverified scope
Commands, hardware and results are in Performance and Testing. No unit test is added: the rows are data, and the existing CSV validation, lookup and collision tests cover them.
Not verified:
op_tests/tuning_tests/test_run_config.pyfor the merged table.PR-specific question
0e4c85f
Changed op tests
None.