Skip to content

[Triton/Gluon] Unify get_shapes for GEMMs - #8214

Merged
azaidy merged 9 commits into
mainfrom
satya/reduce_tests
Nov 20, 2026
Merged

azaidy merged 9 commits into
mainfrom
satya/reduce_tests

Conversation

@Boss2002n

@Boss2002n Boss2002n commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

All GEMM tests call get_shapes(). Kernel limits come in as arguments, so each
kernel runs the shapes it supports. Shapes that pin one kernel's bug or config
stay in that kernel's test file.

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 8214 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@Boss2002n Boss2002n changed the title satya/reduce_tests Unify get_shapes for GEMMs Nov 18, 2026
@Boss2002n Boss2002n self-assigned this Nov 18, 2026
@Boss2002n
Boss2002n marked this pull request as ready for review November 18, 2026 17:31
@Boss2002n
Boss2002n requested review from a team and a balanced review from Copilot November 18, 2026 17:31
@github-actions github-actions Bot changed the title Unify get_shapes for GEMMs [Triton/Gluon] Unify get_shapes for GEMMs Nov 18, 2026
@aiter-bot

aiter-bot commented Nov 18, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 94bf94326a74 · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a16w16_gated.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a16w4.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a16w8_blockscale.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a16wfp4.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a8w8.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a8w8_blockscale.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/gemm/basic/test_gemm_a8w8_per_token_scale.py
  • FAIL — 22 additional changed op test(s) are not explained
  • FAIL — Changed op tests must explain why each changed op test is necessary and non-redundant

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Several newly shared shapes violate kernel or shuffle divisibility requirements, causing pre-launch test failures, while kernel-specific regression coverage is also lost.

6 open issues
What changed in this PR

This PR centralizes shape selection for AITER’s Triton/Gluon GEMM tests. It replaces repeated shape lists with a shared helper that filters cases by kernel limits.

Changes:

  • Adds common edge-case, decode, and prefill shapes.
  • Supports alignment and size filters, batch dimensions, and two-output GEMMs.
  • Migrates basic, batched, fused, and feed-forward tests to get_shapes().

All paths below are relative to op_tests/triton_tests/gemm/.

File Description
gemm_shapes.py Adds shared shapes and filtering options.
fused/​test_fused_gemm_afp4wfp4_split_cat.py Replaces local shapes with the shared helper.
fused/​test_fused_gemm_afp4wfp4_mul_add.py Selects K-aligned, size-limited shapes.
fused/​test_fused_gemm_afp4wfp4_a16w16.py Uses shared two-output shapes.
fused/​test_fused_gemm_a8w8_blockscale_split_cat.py Selects shapes with a minimum K.
fused/​test_fused_gemm_a8w8_blockscale_mul_add.py Applies minimum-K and size filters.
fused/​test_fused_gemm_a8w8_blockscale_a16w16.py Selects K-aligned two-output shapes.
fused/​test_fused_gemm_a16w16_quant_x.py Migrates quantization and reduction test shapes.
fused/​test_fused_gemm_a16w16_mul_add.py Migrates both matrix and batched cases.
fused/​test_fused_gemm_a16w16_dual_splitk.py Uses shared shapes alongside local odd-shape cases.
feed_forward/​test_ff_a16w16.py Migrates gated and ungated test shapes.
feed_forward/​test_ff_a16w16_fused.py Migrates shapes and updates a helper-name comment.
batched/​test_batched_gemm_bf16.py Replaces local shape and subset helpers.
batched/​test_batched_gemm_afp4wfp4.py Uses shared K-aligned shapes with rotating batch sizes.
batched/​test_batched_gemm_a8w8.py Uses shared shapes and a size-limited layout subset.
batched/​test_batched_gemm_a8w8_a_per_token_group_prequant_w_per_batched_tensor_quant.py Replaces local cases with size-filtered shapes.
batched/​test_batched_gemm_a16wfp4.py Uses aligned, size-limited batched shapes.
batched/​test_batched_gemm_a16w8.py Replaces model-specific lists with shared batched shapes.
basic/​test_gemm_afp8wfp8.py Applies N and K alignment filters.
basic/​test_gemm_afp4wfp4.py Uses shared K-aligned shapes.
basic/​test_gemm_a8wfp4.py Replaces local shapes with K-aligned cases.
basic/​test_gemm_a8w8.py Migrates standard, integer, and split-K cases.
basic/​test_gemm_a8w8_per_token_scale.py Uses the common shape list.
basic/​test_gemm_a8w8_blockscale.py Replaces local shapes with minimum-K filtering.
basic/​test_gemm_a16wfp4.py Uses shared K-aligned shapes.
basic/​test_gemm_a16w8_blockscale.py Replaces local shapes with the common list.
basic/​test_gemm_a16w4.py Applies packed-weight alignment filters.
basic/​test_gemm_a16w16.py Migrates standard, activation, layout, and atomic cases.
basic/​test_gemm_a16w16_gated.py Uses shared shapes with a size limit.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 18, 2026 18:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The test changes introduce a shuffled FP4 case that cannot compile and remove coverage for several tuned GEMM configuration paths.

No open issues 🎉

4 previously missed issues

In code that hasn't changed since last review

Medium severity Restore the M=64 tuned split-K tile case

op_tests/​triton_tests/​gemm/​basic/​test_gemm_a16w16.py:61

The shared set has no M between 33 and 64, so this test loses the router case that selects M_LEQ_64 in configs/gfx950/triton/gemm/gemm_a16w16/GEMM-A16W16-N=256-K=7168.json. Append (64, 256, 7168) locally to keep this tuned split-K tile covered without adding a kernel-specific case to the shared set.

Medium severity Retain B=128 MLA decode cases for config selection

op_tests/​triton_tests/​gemm/​batched/​test_batched_gemm_a16w8.py:81

The new batch list stops testing the B=128 MLA decode configs, including BATCHED_GEMM-A16W8-B=128-N=512-K=128.json; the remaining B=128 tests in this file pass explicit configs and do not test config selection. Keep the MLA shapes as local cases added to get_shapes() so those tuned paths remain covered.

Medium severity Restore specialized GEMM cases for M=1,16,64,128

op_tests/​triton_tests/​gemm/​fused/​test_fused_gemm_a16w16_dual_splitk.py:64

This removes the (M, 16384, 96, 5120) cases for M=1,16,64,128, leaving their specialized-config buckets unchecked. Append the tuned cases to get_shapes(); the remaining M=4 test overrides num_ksplit2 and does not cover those buckets.

Medium severity Skip shuffled cases with K not divisible by 256

op_tests/​triton_tests/​gemm/​fused/​test_fused_gemm_afp4wfp4_a16w16.py:85

The new shuffled (M, N1, K) = (1, 512, 128) case passes this guard, but its BLOCK_SIZE_K=128 gives a zero dimension in the kernel's scale reshape and prevents compilation. Also skip shuffled cases with K % 256 != 0, as the basic FP4 test does.

6 resolved since last review

Review effort: Balanced

@brunomazzottiamd

Copy link
Copy Markdown
Contributor

I like the idea of an unified get_shapes function. However, I'm not sure if changing the test shapes (adding or removing shapes) is ideal.

Every get_shapes call in this PR changes the shapes that tests run. An agent compared the old GEMM shapes with the new ones. All 47 call sites differ. A shape still present on both sides is left out of the comments.

Is it your intention?


test_gemm_a16w16.py:61 test_gemm_a16_w16, :157 test_gemm_a16_w16_layout, :183 test_gemm_a16_w16_atomic, :240 test_gemm_a16w16_persistent_output, test_gemm_a16w16_gated.py:44 test_gemm_a16_w16_gated, test_ff_a16w16.py:16 test_ff_a16w16_ungated, :36 test_ff_a16w16_gated, test_ff_a16w16_fused.py:18 test_ff_a16w16_fused_ungated, :42 test_ff_a16w16_fused_gated

get_shapes() replaces get_x_vals() and changes the shapes (27 → 31). On the gated call, max_size=4096*106496*16384 does not drop any shared shape, so it is this same set. On the FF tests the tuple is (batch, hidden_dim, intermediate_dim).

Added (21): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 512, 128), (32, 1280, 8192), (32, 8192, 1024), (128, 128, 512), (128, 512, 128), (128, 1280, 8192), (128, 8192, 1024), (159, 17389, 597), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024)

Removed (17): (32, 128, 2880), (32, 2880, 4096), (64, 128, 2880), (64, 256, 7168), (64, 2880, 4096), (64, 5120, 2880), (128, 128, 2880), (128, 2880, 4096), (256, 128, 2880), (256, 256, 7168), (256, 2880, 4096), (256, 5120, 2880), (2048, 2048, 2048), (2048, 5120, 2880), (4096, 106496, 16384), (5120, 5120, 5120), (8192, 8192, 8192)

Those removals are the old GPT-OSS output projection (M, 2880, 4096), GPT-OSS router (M, 128, 2880), DSR1 router and QKV at M=64 and M=256, QKV at M=2048, Llama-3 405B FC1 at M=4096, and the square GEMMs at 2048 / 5120 / 8192.


test_gemm_a16w16.py:113 test_gemm_a16_w16_activation, :204 test_gemm_a16_w16_atomic_layout, :221 test_gemm_a16_w16_atomic_accumulate, test_gemm_a8w8.py:174 test_gemm_int8

get_shapes(max_size=8192*8192*8192) replaces get_fewer_x_vals(). The cap does not drop any shared shape (the largest, (256, 106496, 16384), still fits), so this is the full 31-shape catalog. The old list had 6 shapes. (1024, 1024, 1024) is the only one still present.

Added (30): (1, 1, 1), (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (3, 5, 2), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (159, 17389, 597), (256, 106496, 16384), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (4096, 4096, 4096), (8192, 5120, 2880)

Removed (5): (16, 1024, 1024), (128, 8192, 512), (256, 512, 8192), (5120, 5120, 5120), (8192, 8192, 8192)

test_gemm_a16w4.py:103 test_gemm_a16w4

get_shapes(n_mult=8, k_mult=128) replaces get_x_vals() (92 → 23). (17, 200, 384) is the only previous shape still present.

Added (22): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 8192, 1024), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 8192, 1024), (256, 106496, 16384), (1024, 256, 7168), (1024, 1024, 1024), (1024, 1280, 8192), (1024, 8192, 1024), (4096, 4096, 4096)

Removed (91): the hand-written edges (1, 64, 128), (3, 72, 256), (130, 520, 1024), and the whole Llama-3-8B / Qwen2.5-7B grid — M in {1, 2, 4, 8, 16, 32, 64, 128, 256, 1024, 8192} crossed with (N, K) in {(6144, 4096), (4096, 4096), (28672, 4096), (4096, 14336), (4608, 3584), (3584, 3584), (37888, 3584), (3584, 18944)}.

test_gemm_a16w8_blockscale.py:120 test_gemm

get_shapes() + _KERNEL_SHAPES replaces get_x_vals() (23 → 37). The six K=640/896 shapes in _KERNEL_SHAPES stay.

Added (24): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (159, 17389, 597), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (8192, 5120, 2880)

Removed (10): (32, 2880, 4096), (64, 256, 7168), (64, 2880, 4096), (128, 2880, 4096), (256, 256, 7168), (256, 2880, 4096), (2048, 2048, 2048), (4096, 106496, 16384), (5120, 5120, 5120), (8192, 8192, 8192)

test_gemm_a16wfp4.py:131 test_gemm_a16wfp4

get_shapes(k_mult=32) replaces get_x_vals() (13 → 28).

Added (25): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (256, 106496, 16384), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (8192, 5120, 2880)

Removed (10): (128, 2112, 7168), (192, 128, 512), (192, 2112, 7168), (2048, 2048, 2048), (4096, 128, 512), (4096, 2112, 7168), (5120, 5120, 5120), (8000, 128, 512), (8000, 2112, 7168), (8192, 8192, 8192)

test_gemm_a8w8.py:114 test_gemm_fp8

get_shapes() replaces get_x_vals() (13 → 31).

Added (26): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (159, 17389, 597), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (8192, 5120, 2880)

Removed (8): (190, 106496, 16384), (256, 10240, 8192), (2048, 2048, 2048), (4096, 10240, 8192), (4096, 106496, 16384), (5120, 5120, 5120), (8000, 10240, 8192), (8192, 8192, 8192)

test_gemm_a8w8.py:242 test_gemm_splitk

get_shapes(max_size=4096*4096*4096) replaces get_splitk_x_vals() (16 → 29).

Added (21): (1, 1, 1), (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 5120, 2880), (3, 5, 2), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 5120, 2880), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 5120, 2880), (159, 17389, 597), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024)

Removed (8): (64, 1280, 8192), (64, 8192, 1024), (256, 1280, 8192), (256, 8192, 1024), (1024, 1024, 1000), (1024, 1024, 4096), (1024, 4096, 4096), (2048, 2048, 2048)

test_gemm_a8w8_blockscale.py:129 test_gemm

get_shapes(min_k=128) + _KERNEL_SHAPES replaces get_x_vals() (120 → 34). Kept via _KERNEL_SHAPES: (512, 512, K) for K in {128, 192, 256, 320}, and (16, 4096, 11008).

Added (22): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (159, 17389, 597), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (8192, 5120, 2880)

Removed (108): the previous M-sweeps, other than shapes that also sit in the shared catalog. That is M in {1, 32, 64, 128, 256, 1024} crossed with those (N, K): (8192, 1024), (4096, 8192), (4096, 4096), (4096, 2048), (1536, 4096), (32768, 1024), (8192, 1536), (7168, 4096), (1536, 7168), (7168, 768), (2048, 7168), (16384, 1536), (65536, 1536), (7168, 16384), (6144, 7168), (7168, 3072); M in {128, 192, 4096, 8000} crossed with (9216, 7168), (7168, 4608), (8192, 512); squares (1024/2048/4096/5120/8192)^3; and (4096, 106496, 16384).

test_gemm_a8w8_per_token_scale.py:76 test_gemm

get_shapes() replaces get_x_vals() (17 → 31).

Added (25): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 8192, 1024), (159, 17389, 597), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (8192, 5120, 2880)

Removed (11): (128, 2880, 4096), (192, 2880, 4096), (192, 5120, 2880), (2048, 2048, 2048), (4096, 2880, 4096), (4096, 5120, 2880), (4096, 106496, 16384), (5120, 5120, 5120), (8000, 2880, 4096), (8000, 5120, 2880), (8192, 8192, 8192)

test_gemm_a8wfp4.py:319 test_gemm_a8wfp4

get_shapes(k_mult=32) replaces get_x_vals() (23 → 28).

Added (22): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 512, 128), (32, 1280, 8192), (32, 8192, 1024), (128, 128, 512), (128, 512, 128), (128, 1280, 8192), (128, 8192, 1024), (256, 106496, 16384), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (8192, 5120, 2880)

Removed (17): (32, 128, 2880), (32, 2880, 4096), (64, 128, 2880), (64, 256, 7168), (64, 2880, 4096), (64, 5120, 2880), (128, 128, 2880), (128, 2880, 4096), (128, 57344, 8192), (256, 128, 2880), (256, 256, 7168), (256, 2880, 4096), (256, 5120, 2880), (2048, 2048, 2048), (2048, 57344, 8192), (5120, 5120, 5120), (8192, 8192, 8192)

(128, 57344, 8192) and (2048, 57344, 8192) are the reduced Llama-3 405B FC1 shapes.


test_gemm_afp4wfp4.py:182 test_gemm_afp4_wfp4, :328 test_gemm_mxfp4_preshuffled_gfx1250

get_shapes(k_mult=32) + _KERNEL_SHAPES replaces get_x_vals() (35 → 30). (1, 256, 512) and (16, 256, 256) stay via _KERNEL_SHAPES.

Added (24): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (8192, 5120, 2880)

Removed (29): (32, 96, 5120), (128, 96, 5120), (128, 2112, 7168), (128, 7168, 4608), (128, 8192, 512), (128, 9216, 7168), (150, 106496, 16384), (192, 96, 5120), (192, 2112, 7168), (192, 7168, 4608), (192, 8192, 512), (192, 9216, 7168), (256, 96, 5120), (2048, 2048, 2048), (2048, 7168, 16384), (2304, 24576, 1536), (4096, 2112, 7168), (4096, 7168, 4608), (4096, 8192, 512), (4096, 9216, 7168), (4096, 106496, 16384), (5120, 5120, 5120), (8000, 96, 5120), (8000, 2112, 7168), (8000, 7168, 4608), (8000, 8192, 512), (8000, 9216, 7168), (8000, 106496, 16384), (8192, 8192, 8192)

test_gemm_afp8wfp8.py:147 test_gemm_afp8wfp8, :204 test_gemm_afp8wfp8_preshuffle, :342 test_gemm_afp8wfp8_preshuffle_gluon_matches_triton

get_shapes(n_mult=128, k_mult=128) replaces the local get_shapes() (40 → 22). No previous shape survives.

Added (22): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 8192, 1024), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 8192, 1024), (256, 106496, 16384), (1024, 256, 7168), (1024, 1024, 1024), (1024, 1280, 8192), (1024, 8192, 1024), (4096, 4096, 4096)

Removed (40): M in {16, 32, 64, 512} crossed with (N, K) in {(2048, 7168), (65536, 1536), (16384, 1536), (8192, 1536), (7168, 16384), (7168, 4096), (6144, 7168), (7168, 3072), (1536, 7168), (7168, 768)}.

test_batched_gemm_a16w8.py:81 test_batched_gemm_a16w8

Tuple is (B, M, N, K). B is taken round-robin from [1, 2, 4, 8, 16].

get_shapes(max_size=1024*1024*1024, batch=[1, 2, 4, 8, 16]) replaces MLA_SHAPES + GENERIC_SHAPES (16 → 21). No previous shape survives.

Added (21): (1, 1, 1, 1), (1, 32, 256, 7168), (1, 32, 512, 128), (1, 32, 8192, 1024), (1, 1024, 1024, 1024), (2, 3, 5, 2), (2, 128, 256, 7168), (2, 128, 512, 128), (2, 128, 8192, 1024), (4, 1, 128, 512), (4, 1, 1280, 8192), (4, 1, 5120, 2880), (4, 17, 200, 384), (8, 31, 7168, 4608), (8, 32, 128, 512), (8, 32, 1280, 8192), (8, 32, 5120, 2880), (16, 1, 256, 7168), (16, 1, 512, 128), (16, 1, 8192, 1024), (16, 128, 128, 512)

Removed (16): the DSR1 MLA absorbed BMMs, B=128, M in {1, 7, 64, 256, 1536, 3000}, (N, K) in {(512, 128), (128, 512)}; plus (16, 1, 128, 64), (16, 100, 384, 320), (4, 257, 72, 1024), (8, 1024, 1024, 1024).

test_batched_gemm_a16wfp4.py:139 test_batched_gemm_a16wfp4

The old helper built a long list and then replaced it. What actually ran was B=1..16, M=2^0..2^8, (N, K) in {(512, 128), (128, 512)}, plus three kernel shapes. Those three stay in _KERNEL_SHAPES: (16, 32, 512, 192), (2, 7, 512, 1120), (3, 16, 128, 1120).

get_shapes(k_mult=32, max_size=256*512*128, batch=[1, 2, 4, 8, 16]) + _KERNEL_SHAPES replaces that grid (291 → 14). Six grid tuples still fall out of the new call: (1, 1, 512, 128), (2, 32, 512, 128), (4, 128, 512, 128), (8, 1, 128, 512), (16, 32, 128, 512), (1, 128, 128, 512). The other 282 are dropped.

Added (5): (1, 17, 200, 384), (2, 1, 256, 7168), (4, 1, 1280, 8192), (8, 1, 8192, 1024), (16, 1, 5120, 2880)

test_batched_gemm_a8w8.py:87 test_batched_gemm_a8w8

B is still the separate loop for b in [16]. The tuple here is (M, N, K).

get_shapes() replaces get_x_vals() (38 → 31).

Added (20): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 5120, 2880), (3, 5, 2), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 5120, 2880), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 5120, 2880), (159, 17389, 597), (256, 106496, 16384), (1024, 256, 7168), (1024, 5120, 2880), (8192, 5120, 2880)

Removed (27): (64, 1280, 8192), (64, 8192, 1024), (192, 1280, 8192), (192, 8192, 1024), (256, 1280, 8192), (256, 8192, 1024), (320, 1280, 8192), (320, 8192, 1024), (512, 1280, 8192), (512, 8192, 1024), (2048, 1280, 8192), (2048, 2048, 2048), (2048, 8192, 1024), (3072, 3072, 3072), (4096, 1280, 8192), (4096, 8192, 1024), (4864, 4096, 8192), (4864, 8192, 4160), (5120, 5120, 5120), (6144, 6144, 6144), (7168, 7168, 7168), (8192, 1280, 8192), (8192, 8192, 1024), (8192, 8192, 8192), (9728, 8192, 65000), (16384, 1280, 8192), (16384, 8192, 1024)

test_batched_gemm_a8w8.py:109 test_batched_gemm_a8w8_layout

B is still for b in [16]. minimal_x_vals() was the 20 smallest of the old list.

get_shapes(max_size=2048*2048*2048) replaces minimal_x_vals() (20 → 26).

Added (17): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 5120, 2880), (3, 5, 2), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 5120, 2880), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 5120, 2880), (159, 17389, 597), (1024, 256, 7168)

Removed (11): (64, 1280, 8192), (64, 8192, 1024), (192, 1280, 8192), (192, 8192, 1024), (256, 1280, 8192), (256, 8192, 1024), (320, 1280, 8192), (320, 8192, 1024), (512, 1280, 8192), (512, 8192, 1024), (2048, 2048, 2048)

test_batched_gemm_a8w8_a_per_token_group_prequant_w_per_batched_tensor_quant.py:146

B is still for b in [16]. Tuple is (M, N, K).

get_shapes(max_size=8192*8192*8192) replaces get_x_vals() (49 → 31). The cap does not drop any shared shape.

Added (19): (1, 1, 1), (1, 256, 7168), (1, 5120, 2880), (3, 5, 2), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 5120, 2880), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 5120, 2880), (159, 17389, 597), (256, 106496, 16384), (1024, 256, 7168), (1024, 5120, 2880), (8192, 5120, 2880)

Removed (37): (0, 128, 512), (0, 512, 128), (1, 128, 1), (4, 128, 512), (4, 512, 128), (9, 128, 512), (9, 512, 128), (16, 128, 512), (16, 512, 128), (25, 128, 512), (25, 512, 128), (36, 128, 512), (36, 512, 128), (64, 1280, 8192), (64, 8192, 1024), (192, 1280, 8192), (192, 8192, 1024), (256, 1280, 8192), (256, 8192, 1024), (320, 1280, 8192), (320, 8192, 1024), (512, 1280, 8192), (512, 8192, 1024), (2048, 1280, 8192), (2048, 2048, 2048), (2048, 8192, 1024), (3072, 3072, 3072), (4096, 1280, 8192), (4096, 8192, 1024), (5120, 5120, 5120), (6144, 6144, 6144), (7168, 7168, 7168), (8192, 1280, 8192), (8192, 8192, 1024), (8192, 8192, 8192), (16384, 1280, 8192), (16384, 8192, 1024)

The (0, …) and M = v² rows come from v**2 for v in range(7).


test_batched_gemm_afp4wfp4.py:128 test_batched_gemm_afp4_wfp4

Tuple is (B, M, N, K). Both parts of the old helper ran: the long (M, N, K) list with B round-robin from [1, 2, 3, 5, 7, 8] (B forced to 1 when K > 16384), plus B=1..16 × M=2^0..2^8 × {(512, 128), (128, 512)}.

get_shapes(k_mult=32, batch=[1, 2, 3, 5, 7, 8]) replaces get_x_vals() (333 → 28). 7 previous tuples still appear; 326 are dropped.

Added (21): (1, 17, 200, 384), (1, 32, 1280, 8192), (1, 32, 5120, 2880), (1, 1024, 5120, 2880), (2, 31, 7168, 4608), (2, 128, 5120, 2880), (2, 1024, 1024, 1024), (3, 1, 256, 7168), (3, 1, 8192, 1024), (3, 256, 106496, 16384), (3, 4096, 4096, 4096), (5, 32, 256, 7168), (5, 32, 8192, 1024), (5, 1024, 256, 7168), (5, 8192, 5120, 2880), (7, 128, 256, 7168), (7, 128, 8192, 1024), (7, 1024, 1280, 8192), (8, 1, 1280, 8192), (8, 1, 5120, 2880), (8, 1024, 8192, 1024)

test_batched_gemm_bf16.py:98 test_batched_gemm_bf16, :128 test_batched_gemm_bf16_layout

B is still for b in [4, 8, 16]. At line 128 this replaces minimal_x_vals(), which returned the same 10 shapes because the old list only had 10.

get_shapes(max_size=16384*1024*4096) replaces that list (10 → 29).

Added (27): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (3, 5, 2), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (159, 17389, 597), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (4096, 4096, 4096)

Removed (8): (1, 1024, 4096), (32, 1024, 4096), (64, 1024, 4096), (128, 1024, 4096), (256, 1024, 4096), (2048, 2048, 2048), (3072, 3072, 3072), (16384, 1024, 4096)

test_fused_gemm_a16w16_dual_splitk.py:64 test_gemm

Tuple is (M, N1, N2, K). N2 is round-robin from [32, 96], so each catalog shape runs with one N2. The old list crossed both (N1, N2) pairs.

get_shapes(k_mult=128, n2=[32, 96]) replaces get_x_vals() (22 → 23). No previous shape survives.

Added (23): (1, 128, 32, 512), (1, 256, 32, 7168), (1, 512, 96, 128), (1, 1280, 96, 8192), (1, 8192, 32, 1024), (17, 200, 32, 384), (31, 7168, 96, 4608), (32, 128, 96, 512), (32, 256, 96, 7168), (32, 512, 32, 128), (32, 1280, 32, 8192), (32, 8192, 96, 1024), (128, 128, 32, 512), (128, 256, 32, 7168), (128, 512, 96, 128), (128, 1280, 96, 8192), (128, 8192, 32, 1024), (256, 106496, 96, 16384), (1024, 256, 32, 7168), (1024, 1024, 96, 1024), (1024, 1280, 96, 8192), (1024, 8192, 32, 1024), (4096, 4096, 32, 4096)

Removed (22): (1, 1, 1, 128), and M in {1, 8, 64, 128} × {(N1, N2) = (256, 32), (4096, 96)} × K in {1024, 5120}, plus the tuned (M, 16384, 96, 5120) for M in {1, 4, 16, 64, 128}.

test_fused_gemm_a16w16_dual_splitk.py:77 test_gemm_ksplit_skip_reduce

_ODD_SHAPES stays: (33, 1000, 40, 1000), (5, 256, 24, 512), (16, 64, 96, 4096).

get_shapes(k_mult=128, max_size=128*16384*5120, n2=[32, 96]) + _ODD_SHAPES replaces get_x_vals() + _ODD_SHAPES (25 → 24). The cap drops (256, 106496, 16384) and (4096, 4096, 4096) relative to the call on line 64. _ODD_SHAPES is unchanged. No previous get_x_vals shape survives.

Added (21): (1, 128, 32, 512), (1, 256, 32, 7168), (1, 512, 96, 128), (1, 1280, 96, 8192), (1, 8192, 32, 1024), (17, 200, 32, 384), (31, 7168, 96, 4608), (32, 128, 96, 512), (32, 256, 96, 7168), (32, 512, 32, 128), (32, 1280, 32, 8192), (32, 8192, 96, 1024), (128, 128, 32, 512), (128, 256, 32, 7168), (128, 512, 96, 128), (128, 1280, 96, 8192), (128, 8192, 32, 1024), (1024, 256, 96, 7168), (1024, 1024, 32, 1024), (1024, 1280, 32, 8192), (1024, 8192, 96, 1024)

Removed (22): same 22 as the call on line 64.

test_fused_gemm_a16w16_mul_add.py:50 test_fused_gemm_a16w16_mul_add_2d

get_shapes() replaces get_2d_vals() (6 → 31). (1, 1, 1), (3, 5, 2), and (1024, 1024, 1024) stay.

Added (28): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (159, 17389, 597), (256, 106496, 16384), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (4096, 4096, 4096), (8192, 5120, 2880)

Removed (3): (16, 1024, 1024), (128, 8192, 512), (4096, 1152, 1152)

test_fused_gemm_a16w16_mul_add.py:80 test_fused_gemm_a16w16_mul_add_gated_residual

Tuple is (B, S, N, K). B is round-robin from [1, 2], and S is the catalog M.

get_shapes(batch=[1, 2]) replaces get_3d_vals() (4 → 31). No previous shape survives.

Removed (4): (2, 77, 640, 320), (2, 333, 2432, 2432)  # SD3.5-Large, (2, 1024, 1152, 1152)  # PixArt-XL, (1, 4096, 1536, 1536)  # Wan2.1-1.3B

Added (31): (1, 1, 1, 1), (1, 1, 128, 512), (1, 1, 1280, 8192), (1, 1, 5120, 2880), (1, 17, 200, 384), (1, 32, 256, 7168), (1, 32, 512, 128), (1, 32, 8192, 1024), (1, 128, 128, 512), (1, 128, 1280, 8192), (1, 128, 5120, 2880), (1, 159, 17389, 597), (1, 1024, 256, 7168), (1, 1024, 1024, 1024), (1, 1024, 8192, 1024), (1, 8192, 5120, 2880), (2, 1, 256, 7168), (2, 1, 512, 128), (2, 1, 8192, 1024), (2, 3, 5, 2), (2, 31, 7168, 4608), (2, 32, 128, 512), (2, 32, 1280, 8192), (2, 32, 5120, 2880), (2, 128, 256, 7168), (2, 128, 512, 128), (2, 128, 8192, 1024), (2, 256, 106496, 16384), (2, 1024, 1280, 8192), (2, 1024, 5120, 2880), (2, 4096, 4096, 4096)

test_fused_gemm_a16w16_quant_x.py:65 test_fused_gemm_a16w16_quant_x

This call only feeds the (M, N, K) inside the TN / bf16 rows. The extra (M, 2048, 2048, dtype, layout) rows below it are unchanged.

get_shapes(k_mult=32) replaces get_x_vals() (10 → 28).

Added (25): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (256, 106496, 16384), (1024, 256, 7168), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (4096, 4096, 4096), (8192, 5120, 2880)

Removed (7): (32, 384, 7168), (64, 256, 7168), (64, 384, 7168), (128, 384, 7168), (256, 256, 7168), (256, 384, 7168), (2048, 2048, 2048)

(M, 384, 7168) is the DSv4 router gate. N=384 is absent from the shared catalog, so that case is gone at every M.


test_fused_gemm_a16w16_quant_x.py:101 test_fused_gemm_a16w16_quant_x_activation, :130 test_fused_gemm_a16w16_quant_x_skip_reduce

get_shapes(k_mult=32, max_size=256*512*8192) replaces get_fewer_x_vals() (4 → 19). (1024, 1024, 1024) stays.

Added (18): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 8192, 1024)

Removed (3): (16, 1024, 1024), (128, 8192, 512), (256, 512, 8192)

test_fused_gemm_a8w8_blockscale_a16w16.py:74 test_gemm

Tuple is (M, N1, N2, K). N2 is round-robin from [256, 512]. The old list crossed every N1 with every N2.

get_shapes(k_mult=128, n2=[256, 512]) replaces get_x_vals() (73 → 23).

Added (20): (1, 128, 256, 512), (1, 512, 512, 128), (1, 1280, 512, 8192), (1, 8192, 256, 1024), (17, 200, 256, 384), (31, 7168, 512, 4608), (32, 128, 512, 512), (32, 512, 256, 128), (32, 1280, 256, 8192), (32, 8192, 512, 1024), (128, 128, 256, 512), (128, 512, 512, 128), (128, 1280, 512, 8192), (128, 8192, 256, 1024), (256, 106496, 512, 16384), (1024, 256, 256, 7168), (1024, 1024, 512, 1024), (1024, 1280, 512, 8192), (1024, 8192, 256, 1024), (4096, 4096, 256, 4096)

Removed (70 of 73): (1, 1, 1, 128), and M in {1, 8, 32, 64, 128, 8192} × N1 in {256, 512} × N2 in {256, 512} × K in {1024, 7168, 8192}, except 3 tuples from that grid that still match the round-robin result.

test_fused_gemm_a8w8_blockscale_mul_add.py:27 test_fused_gemm_a8w8_blockscale_mul_add

get_shapes(min_k=128, max_size=1024*7168*256) replaces get_x_vals() (5 → 22). No previous shape survives. The old list was only (M, 7168, 256) and skipped M=1 because of a Triton compile error; this call adds M=1 shapes.

Added (22): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 8192, 1024), (159, 17389, 597), (1024, 256, 7168), (1024, 1024, 1024)

Removed (5): (2, 7168, 256), (4, 7168, 256), (8, 7168, 256), (16, 7168, 256), (1024, 7168, 256)

test_fused_gemm_a8w8_blockscale_split_cat.py:119 test_fused_gemm_a8w8_blockscale_split_cat

get_shapes(min_k=128) replaces the local get_shapes() (1 → 29). The old function built a long list and then replaced it with [(4096, 256, 512)], so only that shape ran. It is dropped.

Added (29): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 5120, 2880), (128, 8192, 1024), (159, 17389, 597), (256, 106496, 16384), (1024, 256, 7168), (1024, 1024, 1024), (1024, 1280, 8192), (1024, 5120, 2880), (1024, 8192, 1024), (4096, 4096, 4096), (8192, 5120, 2880)

Removed (1): (4096, 256, 512)

test_fused_gemm_afp4wfp4_a16w16.py:75 test_gemm

Tuple is (M, N1, N2, K). N2 is round-robin from [256, 512].

get_shapes(k_mult=32, n2=[256, 512]) replaces get_x_vals() (72 → 28).

Added (25): (1, 128, 512, 512), (1, 512, 256, 128), (1, 1280, 512, 8192), (1, 5120, 512, 2880), (1, 8192, 256, 1024), (17, 200, 256, 384), (31, 7168, 512, 4608), (32, 128, 256, 512), (32, 512, 512, 128), (32, 1280, 256, 8192), (32, 5120, 256, 2880), (32, 8192, 512, 1024), (128, 128, 512, 512), (128, 512, 256, 128), (128, 1280, 512, 8192), (128, 5120, 512, 2880), (128, 8192, 256, 1024), (256, 106496, 256, 16384), (1024, 256, 512, 7168), (1024, 1024, 512, 1024), (1024, 1280, 256, 8192), (1024, 5120, 256, 2880), (1024, 8192, 512, 1024), (4096, 4096, 256, 4096), (8192, 5120, 512, 2880)

Removed (69 of 72): M in {1, 8, 32, 64, 128, 8192} × N1 in {256, 512} × N2 in {256, 512} × K in {1024, 7168, 8192}, except 3 tuples from that grid that still match the round-robin result.

test_fused_gemm_afp4wfp4_mul_add.py:26 test_fused_gemm_afp4wfp4_mul_add

get_shapes(k_mult=32, max_size=1024*7168*256) replaces get_x_vals() (8 → 21). No previous shape survives. The old list was only (M, 7168, 256).

Added (21): (1, 128, 512), (1, 256, 7168), (1, 512, 128), (1, 1280, 8192), (1, 5120, 2880), (1, 8192, 1024), (17, 200, 384), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (32, 512, 128), (32, 1280, 8192), (32, 5120, 2880), (32, 8192, 1024), (128, 128, 512), (128, 256, 7168), (128, 512, 128), (128, 1280, 8192), (128, 8192, 1024), (1024, 256, 7168), (1024, 1024, 1024)

Removed (8): (1, 7168, 256), (2, 7168, 256), (4, 7168, 256), (8, 7168, 256), (16, 7168, 256), (31, 7168, 256), (32, 7168, 256), (1024, 7168, 256)

test_fused_gemm_afp4wfp4_split_cat.py:147 test_fused_gemm_afp4wfp4_split_cat

get_shapes(k_mult=256) replaces the local get_shapes() (26 → 19). K must be a multiple of 256, so K=512 / 597 / 2049 / 7168 drop even when the rest of the shape was covered.

Added (12): (1, 128, 512), (1, 256, 7168), (31, 7168, 4608), (32, 128, 512), (32, 256, 7168), (128, 128, 512), (128, 256, 7168), (256, 106496, 16384), (1024, 256, 7168), (1024, 1280, 8192), (1024, 8192, 1024), (4096, 4096, 4096)

Removed (19): (16, 576, 7168), (16, 4096, 512), (32, 4096, 512), (64, 1280, 8192), (64, 4096, 512), (64, 8192, 1024), (128, 4096, 512), (159, 17389, 597), (192, 1280, 8192), (192, 8192, 1024), (256, 4096, 512), (320, 1280, 8192), (320, 8192, 1024), (1024, 4096, 512), (2048, 2048, 2048), (2048, 2048, 2049), (3072, 3072, 3072), (8192, 1280, 8192), (8192, 8192, 1024)

@brunomazzottiamd brunomazzottiamd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have lots of failures in gfx942 GEMM tests. Can you please take a look at them and check if they are related to the changes in test shapes?

@zufayu
zufayu requested review from a team and vgokhale November 19, 2026 01:09
Copilot AI balanced review requested due to automatic review settings November 19, 2026 03:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The changes disable or remove tuned-configuration regression coverage and unjustifiably relax the BF16 error limit for unfused tests.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Restore B=128 MLA shapes for config-selection coverage

op_tests/​triton_tests/​gemm/​batched/​test_batched_gemm_a16w8.py:82

The new batch list excludes B=128, so this test no longer loads the two shipped B=128 MLA configs; the remaining B=128 cases pass explicit configs. Retain the former B=128 MLA shapes beside get_shapes() to keep coverage of batch-specific config selection.

Medium severity Restore the omitted gfx950 tuned-table shapes

op_tests/​triton_tests/​gemm/​fused/​test_fused_gemm_a16w16_dual_splitk.py:64

[P2] This drops the gfx950 tuned-table checks at (M, 16384, 96, 5120) for M=1,16,64,128, while the remaining M=4 test overrides num_ksplit2. Append the tuned shapes here so the normal config path remains covered.

Review effort: Balanced

@brunomazzottiamd brunomazzottiamd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Boss2002n. I'm sharing more comments on this PR:

  • CI passed on gfx942. Thanks for addressing this point.
  • Could you please ask someone more familiar with shuffling to review the PR? I'm don't understand shuffling very well, I see some test skips due to shuffling...

Copilot AI balanced review requested due to automatic review settings November 19, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new guard skips the dedicated (8, 8192, 8192) launch regression on gfx950, leaving the specialized configuration untested instead of fixing it or preserving coverage with a strict expected failure.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@Boss2002n
Boss2002n requested review from brunomazzottiamd and removed request for brunomazzottiamd November 20, 2026 19:57
@azaidy
azaidy merged commit 008d53c into main Nov 20, 2026
1 check passed
@azaidy
azaidy deleted the satya/reduce_tests branch November 20, 2026 20:00
menglcai-amd added a commit that referenced this pull request Nov 22, 2026
Resolve the conflict in op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py:
main (#8214) replaced get_fewer_x_vals() with get_shapes(), and this branch
added test_gemm_a16_w16_atomic_uneven_split directly above that decorator.
Keep the new test and take the get_shapes() decorator from main.
yuyzhang512 added a commit to yuyzhang512/aiter that referenced this pull request Nov 22, 2026
ROCm#8214 (unified get_shapes for GEMMs) multiplied the GEMM test case counts
(e.g. test_fused_gemm_a8w8_blockscale_mul_add.py 642 -> 4866 cases,
test_gemm_a8w8.py 1845 -> 8141), while split-test-times/triton.tsv still
holds the pre-ROCm#8214 times. The shards are unbalanced: MI300X shard 5 took
56.7 min of tests and hit the 60-minute job limit, and MI35X shard 7 took
54.3 min against its 60-minute test step limit.

Raise the MI300X job limit and the MI35X "Triton Tests" step limit from
60 to 90 minutes.

Co-Authored-By: Claude <[email protected]>
mengfei-jiang pushed a commit that referenced this pull request Nov 23, 2026
…with gfx950 fixes and config retune (#8266)

* ci: install triton 3.9.0 (f1bf9132) from the release_1031 channel

Move the Triton used by CI and by `pip install aiter` (setup.py runs
install_triton.sh) from triton 3.8.0 (release_0914, 7cb7b059) to triton
3.9.0 (release_1031, f1bf9132).

- Python 3.11+ only: release_1031 has cp311-cp314 wheels. On Python 3.10
  install_triton.sh prints a reminder and exits 0, keeping the existing
  triton; setup.py prints the same reminder instead of "Replacing existing
  triton", and the README notes the requirement.
- The ROCm version comes from rocm-core (dpkg or rpm) or, on pip ROCm SDK
  images, the pip `rocm` package; a failed rpm query is ignored.
- Candidate indices: the derived rocm-X.Y.0, then the newest one of the
  same ROCm major (rocm-7.2.0 for 7.x such as 7.12, rocm-10.2.0 for 10.x),
  then the default. An index is used only if it lists a wheel with this
  interpreter's full tag (cpXY[t]-cpXY[t]-linux_<arch>), probed with
  python3 urllib (no curl): HTTP 403/404 tries the next candidate, a network
  error is retried and then stops.
- A local wheelhouse is used only if it holds a matching wheel. Nothing is
  uninstalled until a usable source is found, so a failure leaves the
  existing triton in place.

download_triton_wheel.sh reuses the same lookup via
`install_triton.sh --resolve` instead of a copy of it.

Co-Authored-By: Claude <[email protected]>

* [Triton] Fix mxfp4 quant compile on triton 3.9

Triton 3.9 rejects `scalar[None, :]` ("too many indices for tensor of
rank 0"). _dynamic_mxfp4_quant_kernel_asm_layout indexes the scalar pid_n
that way in its block-scale stores. Use `pid_n + tl.arange(0, 1)`: a
rank-1, size-1 range that broadcasts identically and compiles on triton
3.8 and 3.9.

Co-Authored-By: Claude <[email protected]>

* [Triton][gfx950] Retune FF fused small-M tiles to fit LDS on triton 3.9

The M_LEQ_4 / M_LEQ_8 buckets of 7 FF-A16W16-fused-N=*-K=* configs, and the
M_LEQ_64 bucket of 4 of them (N=11264/K=2048, N=16384/K=1280,2048,8192),
used BM=32, BN=128, BK=256, ns=2, which needs 168864 B of LDS on triton 3.9
(limit 163840) and fails to compile. The ungated kernel already overflowed
on triton 3.8.

- M_LEQ_4, M_LEQ_8 (all 7 files): BM=16, BN=128, BK=256, ns=2, nw=4.
- M_LEQ_64 (those 4 files): BK=128, ns=3 (BM=32, BN=128, nw=8 unchanged).
  The other 3 files' M_LEQ_64 (BM=64, BN=256, BK=64, ns=3) is unchanged.

Picked from tile sweeps on triton 3.9 (gfx950). BN stays 128: the ungated
kernel adds its output with bf16 atomic adds, one per N-tile, and BN=64
doubled the misses against the torch reference. The new tiles fit LDS on
triton 3.8 and 3.9. On MI350X, gated shapes are +3.0% TFLOPS over triton
3.8 with the old configs (median; +13.2% at M 16-64), and the ungated
shapes, which failed before, now run. With triton 3.8 alone the new
configs are +3.4% over the old ones.

The gfx950 launch tests now also cover the retuned buckets: gated M=4/64
(N=16384, K=8192) and ungated M=8/64 (N=16384, K=1280), checked against the
torch reference. get_x_vals() does not reach these buckets.

Co-Authored-By: Claude <[email protected]>

* ci: deselect triton 3.9 known-issue attention cases

- test_mha_dao_ai_capture[mha-cpu] and [mha-cuda] (MI35X and MI300X):
  GPU memory fault in bwd_kernel_fused_causal (MHA backward with dropout),
  an LLVM InlineSpiller miscompile. The gqa variants pass. Fix pending in
  llvm/llvm-project#226689, verified on gfx950 by
  rebuilding the triton 3.9 codegen LLVM with it.
- 8 varlen head-dim 33/53 test_mha_dao_ai_backward_head_size cases
  (MI300X): wrong gradients or a fault on gfx942; not root-caused.

Restore them once triton ships a fix.

Co-Authored-By: Claude <[email protected]>

* [Triton][gfx942] unified_attention: 3D config for head sizes >= 256 fits LDS on triton 3.9

Heads above 256 pad to a 512-wide tile. With the default attn_3d config
(num_warps=2, num_stages=2) the 3D kernel needs 128 KiB of LDS on triton 3.9,
over gfx942's 64 KiB, so test_triton_unified_attn_prefill_head_sizes
[q_dtype0-kv_dtype0-None-320-seq_lens0] fails on MI300X (OutOfResources).
Use the D_GEQ_512 settings (num_warps=4, num_stages=1) from head 256 up.

Co-Authored-By: Claude <[email protected]>

* ci: deselect three triton 3.9 known failures in the flash-attention tests

With triton 3.9 (f1bf9132) these cases fault or hang in
bwd_kernel_fused_causal, the same LLVM miscompile as test_mha_dao_ai_capture:

- test_flash_attn_output[0.0-0.17-2048-2048-128-True-False-False-False-mha-dtype0-True]
- test_flash_attn_output[0.0-0.17-2048-2048-128-True-False-False-False-mha-dtype0-False]
- test_flash_attn_varlen_output[0.0-0.17-1024-1024-32-True-False-True-False-mha-dtype0-False]

They pass on triton 3.8 and pass once the triton 3.9 codegen LLVM has
llvm/llvm-project#226689 (still open). On MI350X,
all 396 dropout cases of both tests were run one per process; only these
three fail, every time. One of them hangs, which --timeout=120 does not
stop, so CI would hit the step limit.

Deselect them where test.sh runs these tests (v2-pr and v2-full).

Co-Authored-By: Claude <[email protected]>

* ci: install triton from the release-1031 index

Switch the AMD Triton index path from release_1031 to release-1031. The
new index serves triton 3.9.0 git24d5394c (release_1031 had f1bf9132) with
the same layout: cp311-cp314 wheels and triton-kernels 1.0.0 for ROCm 7.0,
7.1, 7.2, 10.1 and 10.2, and HTTP 403 for ROCm versions without an index.

Co-Authored-By: Claude <[email protected]>

* [CI] Raise triton test timeouts to 90 minutes

#8214 (unified get_shapes for GEMMs) multiplied the GEMM test case counts
(e.g. test_fused_gemm_a8w8_blockscale_mul_add.py 642 -> 4866 cases,
test_gemm_a8w8.py 1845 -> 8141), while split-test-times/triton.tsv still
holds the pre-#8214 times. The shards are unbalanced: MI300X shard 5 took
56.7 min of tests and hit the 60-minute job limit, and MI35X shard 7 took
54.3 min against its 60-minute test step limit.

Raise the MI300X job limit and the MI35X "Triton Tests" step limit from
60 to 90 minutes.

Co-Authored-By: Claude <[email protected]>

* [Triton] dao_ai bwd: smaller RDNA tiles to avoid an LLVM crash on gfx1100

Triton 3.9's LLVM aborts while compiling bwd_kernel_fused_causal for
gfx1100 at head dim 112 with varlen (InlineSpiller::reMaterializeFor
"corrupted sub-interval" assertion). This killed the RDNA3 MHA bench at
kimik25-tp4 d=112 bwd_varlen.

Halve BLOCK_M1 and BLOCK_N2 (32 -> 16) in the RDNA bwd configs, autotune on
and off. Only the arch.is_rdna branches change; gfx942/gfx950 configs are
untouched. Cross-compiled for gfx1100, all 160 bench bwd/bwd_varlen cases
now compile. Runtime behaviour on RDNA3 is checked by the RDNA3 CI job.

Co-Authored-By: Claude <[email protected]>

* ci: deselect a triton 3.9 RDNA3 failure in the FA output test

test_flash_attn_output[0.0-0.17-2048-2048-96-False-False-False-False-mha-dtype0-True]
fails on the RDNA3 (gfx1100) runner with triton 3.9. Deselect it in the
v2-pr-rdna3 run only; other archs still run it.

Co-Authored-By: Claude <[email protected]>

* ci: skip the triton 3.9 RDNA3 flash-attention output failures by pattern

On RDNA3 (gfx1100) 30 test_flash_attn_output -k 2048-2048 cases fail with
triton 3.9, some by crashing the pytest process. All are mha (no mqa or gqa),
in two groups:

- dropout 0.0, causal, head dim 32/59/64: all alibi x kvpacked combinations (12)
- dropout 0.17, head dim 96/111/128: 18 of 24 causal x alibi x kvpacked combinations

Skip both groups with one -k pattern instead of ids, which also covers the
96-False-False-False-False case deselected before. The pattern skips 36 of the
528 cases: the 30 failures, the 2 96-False-False-False-False cases, and 4
dropout cases that passed in this run (96 causal+alibi, 128 non-causal without
alibi), which look like dropout luck rather than a different rule. 492 cases
still run.

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
zufayu pushed a commit that referenced this pull request Nov 25, 2026
…e list (#8534)

#8214 moved test_gemm_afp4wfp4.py onto the shared get_shapes list. Four
exact test_gemm_afp4_wfp4 IDs no longer exist, so the P1 manifest fails at
collection, and test_gemm_mxfp4_preshuffled_gfx1250 no longer collects 70
nodes. Select the 44 preshuffled nodes that run on gfx1250 by ID, leaving
out the 42 that skip by design and the (256, 106496, 16384) shape (#8533),
and replace the four removed shapes with four from the shared list. P1 is
229 nodes, all passing on gfx1250.

Co-authored-by: Claude <[email protected]>
Ragua1 added a commit to Ragua1/aiter that referenced this pull request Nov 30, 2026
Conflicts resolved in op_tests only: kept upstream's shared get_shapes() and the test removals of ROCm#8036/ROCm#8214 next to this branch's changes.

Signed-off-by: Martin Domanský <[email protected]>
Ragua1 added a commit to Ragua1/aiter that referenced this pull request Nov 30, 2026
Conflicts resolved in op_tests only: kept upstream's shared get_shapes() and the test removals of ROCm#8036/ROCm#8214 next to this branch's changes.

Signed-off-by: Martin Domanský <[email protected]>
Ragua1 added a commit to Ragua1/aiter that referenced this pull request Nov 30, 2026
Conflicts resolved in op_tests only: kept upstream's shared get_shapes() (ROCm#8214) next to this branch's changes. The new 16 < M < 32 skip for preshuffled weights in test_fused_gemm_afp4wfp4_a16w16 no longer applies on software-emulated FP4 archs: they run only with their own table, which gives M < 32 a BLOCK_SIZE_M of 16.

Signed-off-by: Martin Domanský <[email protected]>
Ragua1 added a commit to Ragua1/aiter that referenced this pull request Nov 30, 2026
Conflicts resolved in op_tests only: kept upstream's shared get_shapes() and the test removals of ROCm#8036/ROCm#8214 next to this branch's changes.

Signed-off-by: Martin Domanský <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants