Skip to content

[Triton/Gluon] gfx950 a16w16: compute-bound Gluon kernel scheduled by Triton's MFMA scheduler - #5897

Open
zhanglx13 wants to merge 6 commits into
mainfrom
llirSched_integration
Open

zhanglx13 wants to merge 6 commits into
mainfrom
llirSched_integration

Conversation

@zhanglx13

@zhanglx13 zhanglx13 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds a compute-bound BF16/FP16 GEMM kernel for gfx950, written in Gluon. On gfx950, gemm_a16w16(..., backend="gluon") runs it. The MFMA scheduler of Triton schedules the kernel. The PR has only the kernel, its wrapper path, its config, its tests and the benchmark.

Motivation

On large GEMM shapes, this kernel is faster than the current gfx950 a16w16 paths. At 4096×106496×16384, the kernel gives 1596 TFLOPS, the Triton backend gives 1213 TFLOPS and hipBLASLt gives 1417 TFLOPS.

Later PRs add the other parts:

  1. Tuned configs for N and K, made with sweep_configs.py.
  2. A gluon libtype in tuned_gemm and a Gluon candidate in the a16w16 tuner.
  3. Tuned tuned_gemm rows for the shapes where the kernel wins.

Changes

  • _gluon_kernels/gfx950/gemm/basic/gemm_a16w16.py: the kernel. It is the a16w16 v9 kernel of ROCm/gfx950-gluon-tutorials. Each tile has four quadrant accumulators in AGPRs and a 2-deep LDS pipeline. BLOCK_M can be 64, 128 or 256, and BLOCK_N can be 128 or 256. BLOCK_K is 64. The wrapper does not allow BLOCK_N = 64, because no tuned shape selected it.
  • Ragged shapes: each of M, N and K has a compile-time flag (EVEN_M, EVEN_N, EVEN_K). On a ragged M or N, the kernel clamps the loads of the last tile to the matrix edge and masks its stores. On a ragged K, the kernel consumes the tail of K first, without the pipeline. The hot loop does not change.
  • The kernel uses remap_xcd and pid_grid from _triton_kernels/common/pid_preprocessing.py.
  • gemm/basic/gemm_a16w16.py: on gfx950, backend="gluon" loads the config with get_gemm_config("GEMM-A16W16", M, N, K, backend="gluon") and launches the kernel with schedule_hint="mfma-schedule". The kernel_type of the config entry selects the kernel, as on gfx1250. AITER_MFMA_SCHED=0 turns off the scheduler, for A/B runs.
  • configs/gfx950/gluon/gemm/gemm_a16w16/DEFAULT.json: one tile for each M bucket. The keys are the values that the wrapper gives to the kernel. A wave cost model selected the tiles: it uses the throughput of each tile at one workgroup per CU and the number of workgroup waves. The tiles give the lowest mean cost on the 854 compute-bound gfx950 shapes in the AITER tuned tables (M×N ≥ 128 × 256²). On these shapes the model puts the bucket tiles within 0–5% of the best tile for each shape.
  • Limits: TN layout. N and K are multiples of 8. K is at least 256. There is no activation and no split-K. The offsets in a tile are 32-bit, so a 256-row tile of x, w or y must span at most 2 GiB: the row strides must be below approximately 4.2M FP16/BF16 elements. The wrapper raises ValueError for larger strides. The wrapper makes a strided bias contiguous, because the kernel reads bias with a stride of 1.
  • The default gfx950 path does not change. A call without backend="gluon" uses the Triton backend, as before.

Triton: the kernel needs the MFMA scheduler of triton-lang/triton#12209 (3b0c7f081). The Triton of AITER has it: triton==3.9.0 from pypi.amd.com/triton/release-1031 is ROCm/triton release_for_aiter_1031 (24d5394c).

Performance (if applicable)

MI355X (gfx950), BF16, TN, with bias. op_tests/op_benchmarks/triton/bench_gemm_a16w16.py --shape M N K --metric throughput, TFLOPS, median of 3 runs on one GPU. Before is the Triton backend (--backend triton). After is this kernel (--backend gluon). The Before and After runs were on the same day.

Hardware Workload/configuration Before After Change
MI355X 4096×4096×8192 1212 1546 +27.6%
MI355X 8192×8192×8192 1282 1590 +24.0%
MI355X 4096×8192×4096 1133 1498 +32.2%
MI355X 4096×106496×16384 1213 1596 +31.5%

More columns. "Unscheduled" is this kernel with AITER_MFMA_SCHED=0. "hipBLASLt" is F.linear(x, w, bias) in the same benchmark. The Triton and hipBLASLt columns come from an earlier run on the same GPU on the same day.

M×N×K Triton backend Unscheduled This kernel hipBLASLt
4096×4096×8192 1212 1315 1546 1461
8192×8192×8192 1282 1337 1590 1560
4096×8192×4096 1133 1264 1498 1467
4096×106496×16384 1213 1350 1596 1417

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X: not applicable, the kernel is for gfx950 only.
  • Tested on MI300X: not applicable, the kernel is for gfx950 only.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None.

PR Self-Review

Reviewed revision

604381a

Behavior and intent

On gfx950, gemm_a16w16(..., backend="gluon") now runs this kernel. Before this PR, gfx950 had no Gluon a16w16 kernel. All other calls do not change.

Validation and unverified scope

Commands, on one MI355X with ROCm 10.2.0a20261001, torch 2.12 and triton==3.9.0+amd.rocm10.2.0.git24d5394c:

pytest op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py            # 1455 passed, 2555 skipped
pytest op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py -k gluon   # 154 passed
python op_tests/op_benchmarks/triton/bench_gemm_a16w16.py --shape M N K --backend gluon --metric throughput

What remains unverified:

  • The tests run the tiles of DEFAULT.json only: 64×256, 128×256 and 256×256. No config selects the other three tiles (64×128, 128×128 and 256×128) yet. The tuned configs of a later PR select all three, and its tests run them.
  • I did not test with the ROCm 7.2.4 image of CI.

PR-specific question

Question: which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?

The only config change is the new file configs/gfx950/gluon/gemm/gemm_a16w16/DEFAULT.json. Its keys are M_LEQ_64, M_LEQ_128, M_LEQ_256, M_LEQ_512 and any. The PR adds no GEMM-A16W16-N=..-K=..json file.

One call reads the file: get_gemm_config("GEMM-A16W16", M, N, K, backend="gluon") in _gemm_a16w16_gluon_gfx950. gemm_a16w16 runs this path only when backend="gluon", persistent=False and the arch is gfx950. So the workloads are all the M, N and K of these calls, and the M bucket selects the tile.

Evidence that the other shapes keep their selection:

  • Before this PR, gemm_a16w16(..., backend="gluon") on gfx950 failed with AssertionError: Gluon backend requires one of ('gfx1250', 'gfx1250-strict'). No working call read a gfx950 Gluon a16w16 config before.
  • The folder configs/gfx950/gluon/gemm/gemm_a16w16/ is new. resolve_config_dir builds the path from the arch, the backend, the op and the family. It does not search other backends or arches. The other GEMM-A16W16 callers (the Triton path of gemm_a16w16, fused_gemm_a16w16_mul_add and fused_gemm_a16w16_quant_x) use backend="triton", so they read configs/gfx950/triton/ as before.
  • git diff --name-status b85783ed6 604381aaa lists 4 files: the kernel and this DEFAULT.json (added), the wrapper and the test file (modified). No existing config file changes.
  • On gfx950, the Triton-backend cases of test_gemm_a16w16.py pass. They are in the 1455 passed cases above.

Changed op tests

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

  • test_gemm_a16_w16_gluon_compute_bound: large shapes and one shape for each M bucket, FP16 and BF16, with and without bias and an output buffer.
  • test_gemm_a16_w16_gluon_compute_bound_ragged: ragged M, N and K. The output starts as NaN, so an element that the kernel does not write makes the test fail.
  • test_gemm_a16_w16_gluon_compute_bound_is_scheduled: the compiled kernel has the sched.barriers of the MFMA scheduler. The numerical tests cannot find a Triton that ignores schedule_hint. The test runs on gfx950 only: on gfx1250 the wrapper runs a WMMA kernel without the MFMA scheduler.
  • test_gemm_a16_w16_gluon_tile_span_2gib: an x whose 256-row tile spans just under 2 GiB gives the right result, and one just over 2 GiB raises ValueError. Without the check, a tile over 2 GiB gave wrong rows and no error.
  • test_gemm_a16_w16_gluon_strided_bias: a bias view with a stride of 2 gives the right result. Without the bias.contiguous() in the wrapper, 86% of the outputs were wrong.
  • _skip_unsupported_gluon: on gfx950 it skips the cases that the kernel does not support. The existing Gluon cases of test_gemm_a16_w16 now run on gfx950.
  • The reference is F.linear in fp32, as in test_fused_gemm_a16w16_mul_add.

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
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; main branch always runs both MI35X and MI300X
multigpu 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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 5897 --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.

@zhanglx13 zhanglx13 changed the title [Triton/Gluon] gfx950 a16w16: compute-bound Gluon kernel scheduled by llirSched [WIP] [Triton/Gluon] gfx950 a16w16: compute-bound Gluon kernel scheduled by llirSched Sep 28, 2026
@zhanglx13
zhanglx13 force-pushed the llirSched_integration branch from 2a1c208 to 34e5443 Compare October 4, 2026 02:41
@zhanglx13 zhanglx13 changed the title [WIP] [Triton/Gluon] gfx950 a16w16: compute-bound Gluon kernel scheduled by llirSched [WIP] [Triton/Gluon] gfx950 a16w16: compute-bound Gluon kernel scheduled by Triton's MFMA scheduler Oct 11, 2026
@zhanglx13
zhanglx13 force-pushed the llirSched_integration branch 4 times, most recently from 81ebbb3 to 9de8255 Compare October 15, 2026 05:42
@zhanglx13
zhanglx13 force-pushed the llirSched_integration branch 2 times, most recently from e03ea17 to 4d63ca6 Compare November 27, 2026 02:29
@zhanglx13 zhanglx13 changed the title [WIP] [Triton/Gluon] gfx950 a16w16: compute-bound Gluon kernel scheduled by Triton's MFMA scheduler [Triton/Gluon] gfx950 a16w16: compute-bound Gluon kernel scheduled by Triton's MFMA scheduler Nov 28, 2026
@zhanglx13
zhanglx13 marked this pull request as ready for review December 2, 2026 02:09
@zhanglx13
zhanglx13 requested review from a team and a balanced review from Copilot December 2, 2026 02:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T02:17:11.663145Z 4d63ca6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@aiter-bot

aiter-bot commented Dec 2, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 604381aaa342 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

On gfx950, `gemm_a16w16(..., backend="gluon")` now runs this kernel. Before this PR, gfx950 had no Gluon a16w16 kernel. All other calls do not change.

Validation and unverified scope

Commands, on one MI355X with ROCm 10.2.0a20261001, torch 2.12 and `triton==3.9.0+amd.rocm10.2.0.git24d5394c`:

```
pytest op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py            # 1455 passed, 2555 skipped
pytest op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py -k gluon   # 154 passed
python op_tests/op_benchmarks/triton/bench_gemm_a16w16.py --shape M N K --backend gluon --metric throughput
```

What remains unverified:

- The tests run the tiles of `DEFAULT.json` only: 64×256, 128×256 and 256×256. No config selects the other three tiles (64×128, 128×128 and 256×128) yet. The tuned configs of a later PR select all three, and its tests run them.
- I did not test with the ROCm 7.2.4 image of CI.

PR-specific question

Question: which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?

The only config change is the new file `configs/gfx950/gluon/gemm/gemm_a16w16/DEFAULT.json`. Its keys are `M_LEQ_64`, `M_LEQ_128`, `M_LEQ_256`, `M_LEQ_512` and `any`. The PR adds no `GEMM-A16W16-N=..-K=..json` file.

One call reads the file: `get_gemm_config("GEMM-A16W16", M, N, K, backend="gluon")` in `_gemm_a16w16_gluon_gfx950`. `gemm_a16w16` runs this path only when `backend="gluon"`, `persistent=False` and the arch is gfx950. So the workloads are all the M, N and K of these calls, and the M bucket selects the tile.

Evidence that the other shapes keep their selection:

- Before this PR, `gemm_a16w16(..., backend="gluon")` on gfx950 failed with `AssertionError: Gluon backend requires one of ('gfx1250', 'gfx1250-strict')`. No working call read a gfx950 Gluon a16w16 config before.
- The folder `configs/gfx950/gluon/gemm/gemm_a16w16/` is new. `resolve_config_dir` builds the path from the arch, the backend, the op and the family. It does not search other backends or arches. The other `GEMM-A16W16` callers (the Triton path of `gemm_a16w16`, `fused_gemm_a16w16_mul_add` and `fused_gemm_a16w16_quant_x`) use `backend="triton"`, so they read `configs/gfx950/triton/` as before.
- `git diff --name-status b85783ed6 604381aaa` lists 4 files: the kernel and this `DEFAULT.json` (added), the wrapper and the test file (modified). No existing config file changes.
- On gfx950, the Triton-backend cases of `test_gemm_a16w16.py` pass. They are in the 1455 passed cases above.

Changed op tests

`op_tests/triton_tests/gemm/basic/test_gemm_a16w16.py`:

- `test_gemm_a16_w16_gluon_compute_bound`: large shapes and one shape for each M bucket, FP16 and BF16, with and without bias and an output buffer.
- `test_gemm_a16_w16_gluon_compute_bound_ragged`: ragged M, N and K. The output starts as NaN, so an element that the kernel does not write makes the test fail.
- `test_gemm_a16_w16_gluon_compute_bound_is_scheduled`: the compiled kernel has the `sched.barrier`s of the MFMA scheduler. The numerical tests cannot find a Triton that ignores `schedule_hint`. The test runs on gfx950 only: on gfx1250 the wrapper runs a WMMA kernel without the MFMA scheduler.
- `test_gemm_a16_w16_gluon_tile_span_2gib`: an x whose 256-row tile spans just under 2 GiB gives the right result, and one just over 2 GiB raises `ValueError`. Without the check, a tile over 2 GiB gave wrong rows and no error.
- `test_gemm_a16_w16_gluon_strided_bias`: a bias view with a stride of 2 gives the right result. Without the `bias.contiguous()` in the wrapper, 86% of the outputs were wrong.
- `_skip_unsupported_gluon`: on gfx950 it skips the cases that the kernel does not support. The existing Gluon cases of `test_gemm_a16_w16` now run on gfx950.
- The reference is `F.linear` in fp32, as in `test_fused_gemm_a16w16_mul_add`.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

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

The barrier checks also run on gfx1250, where they target a WMMA kernel instead of the gfx950 MFMA scheduler, so they need a gfx950-only gate.

1 open issue
What changed in this PR

Adds an opt-in gfx950 Gluon kernel for AITER’s BF16/FP16 GEMM, while preserving the default Triton path.

Changes:

  • Adds an MFMA-scheduled kernel with bias and ragged-shape support.
  • Adds gfx950 dispatch, input checks, and default tile configurations.
  • Extends numerical tests and adds scheduler checks.
File Description
op_tests/​triton_tests/​gemm/​basic/​test_gemm_a16w16.py Adds numerical, ragged-shape, and scheduler tests.
aiter/​ops/​triton/​gemm/​basic/​gemm_a16w16.py Adds gfx950 Gluon dispatch and input validation.
aiter/​ops/​triton/​configs/​gfx950/​gluon/​gemm/​gemm_a16w16/​DEFAULT.json Defines default tiles by M bucket.
aiter/​ops/​triton/​_gluon_kernels/​gfx950/​gemm/​basic/​gemm_a16w16.py Implements the pipelined compute-bound GEMM kernel.

Review effort: Balanced

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d63ca6207

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI balanced review requested due to automatic review settings December 2, 2026 02:36

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

Accepted BF16 inputs can exceed the 32-bit buffer offset range, causing loads to wrap to the wrong row unless tile spans are checked or pointers are rebased.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 02:55
@vgokhale
vgokhale self-requested a review December 2, 2026 02:57

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

Non-contiguous bias views are read with unit-stride offsets, causing incorrect values to be added unless the bias is made contiguous or its stride is passed to the kernel.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Respect noncontiguous bias stride

aiter/​ops/​triton/​gemm/​basic/​gemm_a16w16.py:274

A bias view such as base[::2] has shape (N,), but this launch passes it to a kernel that reads bias with unit-stride offsets, so it adds the wrong values. Make bias contiguous before the launch, or pass its stride to the kernel.

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 03:29
@zhanglx13

Copy link
Copy Markdown
Contributor Author

Copilot review of 62f7646, "Respect noncontiguous bias stride": confirmed and fixed in 991e2ee.

Without the fix, a bias view with a stride of 2 (torch.randn(2 * N)[::2], M=256, N=512, K=512) gave wrong values in 86% of the outputs. The gfx950 wrapper now calls bias.contiguous() before the launch. It does not copy a bias that is already contiguous. test_gemm_a16_w16_gluon_strided_bias checks this case.

Note: the Triton kernel of gemm_a16w16 on main also reads bias with a stride of 1 (bias_ptr + offs_bn in _triton_kernels/gemm/basic/gemm_a16w16.py), and its wrapper does not make bias contiguous. That path is not in this PR.

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

Human assessment is needed to weigh an unpublished maintainability concern about duplicated layout-partitioning and zero-padding logic across three kernels.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 2, 2026 03:50

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

Human assessment is needed to weigh the maintenance risk of duplicated layout logic shared conceptually by the GEMM and attention kernels.

No open issues 🎉

Review effort: Balanced

… Triton's MFMA scheduler

Add a compute-bound BF16/FP16 GEMM kernel for gfx950 in Gluon. On gfx950,
gemm_a16w16(..., backend="gluon") runs it. The MFMA scheduler of Triton
schedules the kernel (schedule_hint="mfma-schedule"). AITER_MFMA_SCHED=0 turns
off the scheduler, for A/B runs.

- Kernel: the a16w16 v9 kernel of ROCm/gfx950-gluon-tutorials. Each tile has
  four quadrant accumulators in AGPRs and a 2-deep LDS pipeline. BLOCK_M and
  BLOCK_N can be 64, 128 or 256, and BLOCK_K is 64. The kernel uses remap_xcd
  and pid_grid from _triton_kernels/common/pid_preprocessing.py.
- Ragged M, N and K: compile-time flags. The kernel clamps the loads of a ragged
  last tile and masks its stores. It consumes the tail of a ragged K first.
- Wrapper: loads the config with get_gemm_config(..., backend="gluon"). The
  kernel_type of the config entry selects the kernel, as on gfx1250.
- configs/gfx950/gluon/gemm/gemm_a16w16/DEFAULT.json: one tile for each M
  bucket, selected with a wave cost model for compute-bound shapes.
- Limits: TN layout, N and K multiples of 8, K at least 256. There is no
  activation and no split-K.
- Tests: compute-bound shapes and one shape for each M bucket, ragged shapes,
  and a check that the compiled kernel has the scheduler's sched.barriers.

The kernel needs the MFMA scheduler of triton-lang/triton#12209. The Triton of
AITER (3.9.0, ROCm/triton release_for_aiter_1031) has it.
…rnel docstring

- test_gemm_a16_w16_gluon_compute_bound_is_scheduled runs on gfx950 only. On
  gfx1250 the wrapper runs a WMMA kernel without the MFMA scheduler, so the
  sched.barrier checks do not apply there.
- The module docstring of the gfx950 kernel has two sentences (rule 18 of
  aiter/ops/triton/README.md).

Claude-Session: https://claude.ai/code/session_01EF9fZXTfW657tAAifBV5bw
The kernel adds 32-bit buffer offsets in a tile to a 64-bit tile pointer. A
256-row tile of x, w or y that spans more than 2 GiB (a row stride of about
4.2M BF16 elements or more) gave wrong rows without an error. The gfx950
check now rejects these inputs, and the wrapper makes y before the check, so
the check uses its real element size.

test_gemm_a16_w16_gluon_tile_span_2gib: a tile just under 2 GiB gives the
right result, and a tile just over 2 GiB raises ValueError.

Claude-Session: https://claude.ai/code/session_01EF9fZXTfW657tAAifBV5bw
The gfx950 kernel reads bias with a stride of 1, so a bias view such as
base[::2] added the wrong values (86% of the outputs were wrong in the new
test). The wrapper now makes bias contiguous before the launch.

test_gemm_a16_w16_gluon_strided_bias: a bias view with a stride of 2.

Claude-Session: https://claude.ai/code/session_01EF9fZXTfW657tAAifBV5bw
No tuned shape selected a tile with BLOCK_N = 64: the sweep of 137 (N, K)
pairs and 357 M buckets timed 64x64, 128x64 and 256x64, and they did not
win. The tests did not run them. The wrapper now allows BLOCK_N of 128 or
256 and raises ValueError for 64. BLOCK_M can still be 64, 128 or 256.

Claude-Session: https://claude.ai/code/session_01EF9fZXTfW657tAAifBV5bw
@zhanglx13
zhanglx13 force-pushed the llirSched_integration branch from c1bf534 to 604381a Compare December 2, 2026 17:49
@zufayu
zufayu requested a review from a team December 2, 2026 23:06

This branch has not been deployed

No deployments
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.

3 participants