Skip to content

[Triton/Gluon] [Bugfix] gfx1250 Gluon a8w8 blockscale: NUM_BUFFERS config key, clamped to the split - #6679

Merged
Boss2002n merged 3 commits into
mainfrom
satya/gluon_blockscale_num_buffers
Oct 21, 2026
Merged

Boss2002n merged 3 commits into
mainfrom
satya/gluon_blockscale_num_buffers

Conversation

@Boss2002n

@Boss2002n Boss2002n commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

The gfx1250 Gluon blockscale configs kept the buffer count in num_stages, and the wrapper renamed it to NUM_BUFFERS.

without the clamp, configs with too many buffers cause GPU hangs

@Boss2002n Boss2002n self-assigned this Oct 19, 2026
@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 (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 gfx1201 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 6679 --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.

@Boss2002n Boss2002n changed the title [Triton/Gluon] [Bugfix] Clamp NUM_BUFFERS to the split in the gfx1250 Gluon a8w8 blockscale wrappers [Triton/Gluon] [Bugfix] gfx1250 Gluon a8w8 blockscale: NUM_BUFFERS config key, clamped to the split Oct 19, 2026
@Boss2002n
Boss2002n marked this pull request as ready for review October 19, 2026 16:48
@Boss2002n
Boss2002n requested review from a team and a balanced review from Copilot October 19, 2026 16:48

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 preshuffled compute-bound clamp still permits an extra tile and out-of-bounds scale reads.

3 open issues
What changed in this PR

This PR addresses GPU hangs in gfx1250 Gluon blockscale GEMM by limiting buffer counts to the available K tiles per split.

Changes:

  • Rename config keys from num_stages to NUM_BUFFERS.
  • Clamp buffer counts in both GEMM wrappers.
  • Filter tuning candidates and update tuning guidance.
File Description
aiter/​ops/​triton/​utils/​_triton/​tuning/​kernels.py Filter unsupported buffer counts.
aiter/​ops/​triton/​utils/​_triton/​tuning/​AGENTS.md Update the stage-key example.
aiter/​ops/​triton/​gemm/​basic/​gemm_a8w8_blockscale.py Clamp buffer counts in both wrappers.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale/​DEFAULT.json Rename the default buffer key.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=8192-K=1536.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=8192-K=1024.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=768.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=4096.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=3072.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=16384.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=65536-K=1536.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=6144-K=7168.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=4096-K=8192.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=4096-K=4096.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=4096-K=2048.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=32768-K=1024.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=2048-K=7168.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=16384-K=1536.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=1536-K=7168.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=1536-K=4096.json Rename buffer keys.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​gemm/​gemm_a8w8_blockscale_preshuffled/​DEFAULT.json Rename the default buffer key.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 17:01
@Boss2002n
Boss2002n force-pushed the satya/gluon_blockscale_num_buffers branch from f48d62a to dd3fc6a Compare October 19, 2026 17:02

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

Uneven final splits can still permit out-of-bounds reads despite the new buffer clamp.

2 open issues
2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 17:08

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

Removing single-buffer candidates from the shared search space leaves valid small-K MXFP4 shapes without tuning candidates.

3 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 17:27
@Boss2002n
Boss2002n force-pushed the satya/gluon_blockscale_num_buffers branch from dd3fc6a to 85c7d2b Compare October 19, 2026 17: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 cap still permits out-of-bounds prefetches on a short final split, and buffer reductions lack regression coverage.

2 open issues
3 resolved since last review

Review effort: Balanced

@zufayu
zufayu requested review from a team and vgokhale October 20, 2026 00:13
Copilot AI balanced review requested due to automatic review settings October 20, 2026 20:02
Removed detailed docstring for clamp_num_buffers function.

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 compute-bound clamp needs regression coverage, and the unrelated wrapper refactors should be separated.

4 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 20, 2026 20:09

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

Removing one-buffer candidates leaves supported FP4 tuning inputs without valid configurations.

4 open issues
3 previously missed issues

In code that hasn't changed since last review

Medium severity Test buffer reduction for both small-K kernel types

aiter/​ops/​triton/​gemm/​basic/​gemm_a8w8_blockscale.py:400

The existing small-K cases in op_tests/triton_tests/gemm/basic/test_gemm_a8w8_blockscale.py use the default bandwidth-bound path without reducing its two buffers, so they do not test this clamp. Add short-split cases that require buffer reduction for both kernel types, including the compute-bound one-tile case, and compare against the Torch reference.

Medium severity Move unrelated clamp refactors to a follow-up PR

aiter/​ops/​triton/​gemm/​basic/​gemm_afp8wfp8.py:495

The equivalent clamp refactors in gemm_afp8wfp8.py, gemm_afp4wfp4.py, and gemm_a16w16.py mix cleanup with the a8w8 bug fix, against the one-problem rule in aiter/ops/triton/README.md:73. Move these three wrapper refactors to a follow-up PR.

Medium severity Preserve one buffer for gfx1250 AFP4WFP4 preshuffle

aiter/​ops/​triton/​utils/​_triton/​tuning/​space.py:31

For gfx1250 AFP4WFP4 preshuffle at (M,N,K)=(16,256,256), removing 1 leaves no tuning candidates: kernels.py:751–756 permits only BLOCK_SIZE_K=256 and at most one buffer. Keep 1 in the shared list and restrict the two-buffer minimum to families that need it.

Review effort: Balanced

@azaidy azaidy 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.

LGTM!

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