Repository navigation
[Triton/Gluon] unified_attention: public gfx950 Gluon gate predicate - #7958
Conversation
…950_gluon_supported `_gfx950_gluon_supported` takes the private `_UAParams`, so a caller that decides something from the gate up front (ATOM's Kimi-K3 DSpark draft picks its q dtype by it) has to build all of `_UAParams` by hand, and every new required field breaks it (ROCm#7100, ROCm#7421). `gfx950_gluon_supported` takes only what the gate reads; `_gfx950_gluon_supported` delegates to it, so the gate keeps one definition and unified_attention's behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision 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
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
There was a problem hiding this comment.
🟡 Changes recommended
The docstring at unified_attention.py:241 exceeds Triton’s one- or two-sentence rule and needs a shorter summary with concise argument entries.
1 open issue
What changed in this PR
Exposes the gfx950 Gluon support gate as a public predicate so external callers can check compatibility without constructing the private _UAParams tuple.
Changes:
- Adds
gfx950_gluon_supported(...)with explicit gate inputs and documented defaults. - Keeps the private helper as a delegate, preserving existing callers and gate logic.
- Adds tests for public/private agreement, dtype acceptance, and missing shuffled-cache width.
| File | Description |
|---|---|
op_tests/triton_tests/attention/test_unified_attention.py |
Adds standalone predicate and compatibility tests. |
aiter/ops/triton/attention/unified_attention.py |
Exposes the public predicate and delegates the private helper to it. |
Review effort: Balanced
…docstring A one-line summary, one entry per argument and the return value, as the Triton ops guidelines ask for a public function. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
cagrikymk
left a comment
There was a problem hiding this comment.
Could you take a look at my comments about the added tests?
I would much rather to not test these behaviors. It doesnt add much value besides maintenance burden.
Besides that, revealing public API sounds good to me!
Review: the private gate delegates to the public function, so a test that compares the two cannot fail, and the rest tests plumbing. Co-Authored-By: Claude Code <[email protected]>
…ad's q cast ROCm/aiter#7958 exposes the gfx950 Gluon gate as a public predicate that takes only what the gate reads. Use it instead of building aiter's private _UAParams by hand: gluon_takes_pool_dtype_q and _UNFIXED_FIELDS are gone, and a new _UAParams field can no longer break the Kimi-K3 DSpark GQA draft. DSparkGQABlockAttention drops num_heads and block_rows, which only fed the private tuple. Co-Authored-By: Claude Code <[email protected]>
…dicate A caller on a shared code path should not name an architecture. Add unified_attention_gluon_supported, which takes the gate's arguments and dispatches on the device inside: gfx950 asks gfx950_gluon_supported (ROCm#7958); other architectures answer False until their kernels are checked here. Follows gather_kv_b_proj_flydsl_supported. Co-Authored-By: Claude Code <[email protected]>

Summary
Expose the gfx950 Gluon gate of
unified_attentionas a publicgfx950_gluon_supported(...)that takes only the arguments the gate reads. The private_gfx950_gluon_supported(params)delegates to it; no caller changes.Motivation
_gfx950_gluon_supported(params)takes the private_UAParamsNamedTuple (40 fields). A caller that needs the gate's answer before callingunified_attentionhas to build a whole_UAParamsby hand. ATOM does this for its Kimi-K3 DSpark GQA draft, which casts q to the KV pool's dtype only where the gfx950 Gluon kernel serves the read. The gate reads 10 of those fields, but every new required field breaks such a caller at startup: #7100 (spec_decode) and #7421 (v_cache_dtype) each did (ROCm/ATOM#3333).Changes
gfx950_gluon_supported(*, q_dtype, kv_cache_dtype, head_size, block_size, head_size_v=None, shuffled_kv_cache=False, k_width=None, softcap=0.0, use_alibi_slopes=False, use_qq_bias=False).head_size_vdefaults tohead_size;k_width, the shuffled K cache's trailing dimension, is required withshuffled_kv_cache._gfx950_gluon_supported(params)delegates to it, so the gate has one definition. No caller changes: the private function keeps its name, its_UAParamsargument and its result; only its body moved (the diff shows it as removed and re-added). Its three call sites inunified_attention.pyare untouched.Testing
unified_attention)Documentation
Dependencies
Breaking Changes
None.
PR Self-Review
Reviewed revision
faffc4e
Behavior and intent
No runtime behavior changes:
unified_attentionroutes exactly as before, through_gfx950_gluon_supported, whose body is now the public function. The addition is a public predicate with the gate's real inputs, so callers outside aiter stop depending on_UAParams' field list, which changes with features that do not touch the gate.Validation and unverified scope
On MI355X (gfx950),
rocm/atom-dev:nightly_202611131540with this change applied to its aiter:python3 -m pytest -q op_tests/triton_tests/attention/test_unified_attention.py: 2,734 passed, 0 failed (2,963 skipped: other architectures' cases). Every one of these reaches the gate through_gfx950_gluon_supported, which now delegates to the public function.That run was at
2fdc6ebd86; the code since then changed only in the function's docstring. Unverified: MI300X and gfx1250, where the gate isFalsebefore and after (DEVICE_ARCH == "gfx950").PR-specific question
What is the most important boundary or failure mode introduced, and what evidence covers it? The risk is the public predicate answering differently from the gate
unified_attentionapplies. It cannot: the private gate is now a one-call delegate to it, so there is one definition, and the existing unified-attention tests pass through that delegate. The only new failure path is theValueErrorwhenshuffled_kv_cache=Trueis given withoutk_width, which no internal caller can hit (_UAParamsalways carriesk_width).Changed op tests
None.