Repository navigation
[Triton/Gluon] fix(attention): normalize Gluon split constexpr values - #6581
Conversation
Co-authored-by: Cursor <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
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.
Summary
Cast
NUM_SEGMENTSandTILE_SIZEto Pythonintbefore the 3D (split-KV) unified-attention launch.Problem
On gfx1250 the Gluon 3D launch fails during constexpr lowering:
compute_segment_paramscapsNUM_SEGMENTSatcdiv(max_seqlen_k, tile). ATOM's decode metadata passesmax_seqlen_kasnp.max(context_lens), a numpy integer, so whenever the context is short enough for that cap to bind,NUM_SEGMENTScomes 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_paramswithmax_seqlen_k=np.int64(300)returns anumpy.int64NUM_SEGMENTS; withnp.int64(5000)(cap binds) or a Python300it returnsint.Test
rocm/fw-bringup:gfx1250-atom-k3-20261014, Triton3.8.0.dev20260903+git9551a57b, PyTorch2.11.0+rocm10.1.0a20260811.