Skip to content

[Triton/Gluon] fix(attention): normalize Gluon split constexpr values - #6581

Merged
azaidy merged 4 commits into
mainfrom
fix/unified-attention-gluon-constexpr
Oct 26, 2026
Merged

azaidy merged 4 commits into
mainfrom
fix/unified-attention-gluon-constexpr

Conversation

@XiaobingSuper

@XiaobingSuper XiaobingSuper commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Cast NUM_SEGMENTS and TILE_SIZE to Python int before the 3D (split-KV) unified-attention launch.

Problem

On gfx1250 the Gluon 3D launch fails during constexpr lowering:

TypeError: cannot convert 16 of type <class 'numpy.int32'> to tensor

compute_segment_params caps NUM_SEGMENTS at cdiv(max_seqlen_k, tile). ATOM's decode metadata passes max_seqlen_k as np.max(context_lens), a numpy integer, so whenever the context is short enough for that cap to bind, NUM_SEGMENTS comes back as a numpy scalar. On gfx1250 only all-decode batches take the 3D path; this was hit while serving MiniMax-M3 DP4/EP4/TP1.

Checked directly: compute_segment_params with max_seqlen_k=np.int64(300) returns a numpy.int64 NUM_SEGMENTS; with np.int64(5000) (cap binds) or a Python 300 it returns int.

Test

  • MiniMax-M3 DP4/EP4/TP1 with RCCL all-to-all on MI455X: an 8-request c4 GSM8K smoke completes without the compile error it hit before this fix.
  • Environment: rocm/fw-bringup:gfx1250-atom-k3-20261014, Triton 3.8.0.dev20260903+git9551a57b, PyTorch 2.11.0+rocm10.1.0a20260811.

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

@XiaobingSuper
XiaobingSuper marked this pull request as ready for review October 20, 2026 07:53
@XiaobingSuper
XiaobingSuper requested review from a team and a balanced review from Copilot October 20, 2026 07:53

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot changed the title fix(attention): normalize Gluon split constexpr values [Triton/Gluon] fix(attention): normalize Gluon split constexpr values Oct 20, 2026
@XiaobingSuper
XiaobingSuper requested review from a team and Dewei-Wang-sh October 20, 2026 07:54
@azaidy
azaidy requested a review from farlukas October 20, 2026 22:28
The test only checked an int() cast. The numpy scalars do not come from a
tuned CSV: NUM_SEGMENTS inherits a numpy max_seqlen_k from the caller when
the context length bounds the split.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 02:38

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@XiaobingSuper
XiaobingSuper requested a review from azaidy October 26, 2026 03:15

@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!

Copilot AI balanced review requested due to automatic review settings October 26, 2026 13: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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@azaidy
azaidy merged commit 2cb3d17 into main Oct 26, 2026
65 checks passed
@azaidy
azaidy deleted the fix/unified-attention-gluon-constexpr branch October 26, 2026 20:34
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.

5 participants