You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Gluon KDA decode (fused_recurrent_kda with conv_state, and fused_recurrent_kda_packed_decode) now also accepts the conv weight as [3*H*K, W]: a fused [3*H*K, 1, W] conv1d weight viewed as 2-D. Callers that keep the q/k/v short convolutions in one conv1d parameter, as vLLM's KDA layers do, can pass that parameter directly. They can then drop the transposed copy they keep today, along with the refresh it needs after every weight write and the stale weights left when a write skips that refresh.
Scope: the gfx950 and gfx1250 Gluon decode kernels and their wrapper. The Triton fused_kda_decode is unchanged, and the existing [3, W, H*K] layout compiles to the same code as before.
Motivation
The Gluon decode required a contiguous [3, W, H*K] weight (assert conv_weight.shape == (3, W, H * K) and conv_weight.is_contiguous() in aiter/ops/triton/attention/kda.py).
AITER's Triton fused_kda_decode already accepts both layouts (aiter/ops/triton/gated_delta_net/fused_kda_decode.py:188-198).
Changes
aiter/ops/triton/attention/kda.py: conv_weight may be [3, W, H*K] with any strides, or [3*H*K, W], which is read as its transposed [3, W, H*K] view. The weight's (group, width, channel) strides go to the kernels as constexprs.
aiter/ops/triton/_gluon_kernels/{gfx950,gfx1250}/attention/kda_decode.py: the kernels address the weight through these strides. A contiguous [3, W, H*K] weight gives the offsets they used before.
gfx950: when a channel's taps are adjacent (width stride 1, as in [3*H*K, W]), the kernel loads them as one vector and splits it into the taps, instead of one strided load per tap.
op_tests/triton_tests/attention/test_kda.py: test_fused_recurrent_kda_packed_decode also runs with the weights as [3*H*K, W], and with either layout padded (stored in a buffer one larger in every dimension). Output, recurrent state and conv state must equal the contiguous [3, W, H*K] result bit for bit. test_fused_conv_rms_gate_spec (several tokens per sequence, the speculative-decoding path) also passes the bf16 [3*H*K, W] weight directly.
op_tests/op_benchmarks/triton/bench_kda.py: --fused --conv1d_layout passes the weights as [3*H*K, W]. --num_buffers also accepts 4 and 8, the values gfx950's tuned decode configs use.
Performance (if applicable)
[3*H*K, W] runs at the speed of [3, W, H*K] (−2.2 % to +0.9 % per call; the one larger difference is run-to-run variation, see below), and [3, W, H*K] runs the same code as before.
MI355X, one decode token per sequence, fp32 conv weight. Setup under "Validation and unverified scope".
The bench then runs BV 128, SK 16, 4 warps and num_buffers 8. That is the fused entry of aiter/ops/triton/configs/gfx950/gluon/attention/kda_decode/DEFAULT.json, which fused_recurrent_kda selects for one-token decode.
Each column ran twice, in mirrored order. A cell is the mean of the two runs' medians (3 timings each).
Heads
Batch
Base (µs)
[3, W, H*K] (µs)
[3*H*K, W] (µs)
[3*H*K, W] vs [3, W, H*K]
8
1
4.35
4.35
4.30
−1.1 %
8
4
4.39
4.39
4.33
−1.4 %
8
16
4.84
4.85
4.80
−1.0 %
8
64
11.65
11.72
11.81
+0.8 %
8
256
42.20
42.65
42.47
−0.4 %
16
1
4.36
4.38
4.30
−1.8 %
16
4
4.46
4.46
4.39
−1.6 %
16
16
6.78
6.79
6.72
−1.0 %
16
64
22.22
22.30
22.40
+0.4 %
16
256
90.57
91.54
90.15
−1.5 %
32
1
4.38
4.39
4.33
−1.4 %
32
4
4.86
4.86
4.78
−1.6 %
32
16
12.49
12.83
12.10
−5.7 %
32
64
44.52
45.42
45.82
+0.9 %
32
256
193.83
195.07
196.02
+0.5 %
64
1
4.48
4.48
4.38
−2.2 %
64
4
6.69
6.70
6.69
−0.1 %
64
16
24.21
24.25
24.08
−0.7 %
64
64
91.52
92.58
91.47
−1.2 %
64
256
380.51
380.25
379.51
−0.2 %
Noise: Base and [3, W, H*K] run identical code, and differ by −0.1 % to +2.7 %.
The 32-head, batch-16 row (−5.7 %) is run-to-run variation: one [3, W, H*K] run was slow (13.3 µs; the other run 12.3 µs). Against the base, [3*H*K, W] is −3.1 % on that row.
Why the kernel has a vector load: with one strided load per tap instead, [3*H*K, W] was 3.4 % to 11.7 % (0.23 to 1.03 µs) slower than [3, W, H*K] on 11 of the 12 rows at batch 16 or smaller.
At --num_buffers 2 (bench_kda's default), [3*H*K, W] is 1.3 % to 3.2 % faster on 7 of the 12 rows at batch 16 or smaller, and 3.3 % to 4.2 % slower on 4 of the 8 rows at batch 64 and 256.
The slower rows are an occupancy effect. There the kernel uses 128 VGPRs against 130, so 4 waves fit per SIMD instead of 3, which slows these memory-bound launches.
With both binaries launched at 3 waves per SIMD (a 48 KB LDS request), [3*H*K, W] is slower than [3, W, H*K] on no row at 16 to 64 heads and batch 16 to 256.
At --num_buffers 8 both layouts run 3 waves per SIMD (152 and 154 VGPRs).
Testing
Unit tests added or updated
Performance benchmarks run
Tested on MI250X
Tested on MI300X
Documentation
Docstrings updated
User guide updated
Performance guide updated
No documentation change is needed, with the reason stated below
The docstring of fused_recurrent_kda does not describe the conv arguments. The comment at the shape check in kda.py names the two accepted layouts.
Dependencies
No new third-party dependencies added
New dependencies are listed and justified below
Breaking Changes
None. Every conv weight the base accepted is still accepted. A contiguous [3, W, H*K] weight compiles to the same instruction stream as the base: on gfx950 as launched on an MI355X, on gfx1250 in a compile without hardware.
PR Self-Review
Reviewed revision
76b01ddce3f01162345fcb6dcdc3950e43b28602
Behavior and intent
The decode's results do not change for any weight the base accepted.
Two inputs are newly accepted: [3*H*K, W], and [3, W, H*K] with other strides. Callers can then pass their conv1d parameter directly, instead of a copy that must be refreshed after every weight write.
Validation and unverified scope
Setup:
AMD Instinct MI355X (gfx950), one GPU.
Image vllm/vllm-openai-rocm:nightly-rocm72-c50aca14416ef29f6ed0ed256302f30646726dcd: Triton 3.8.0, torch 2.13.0, HIP 7.2.
The base (AITER main 3914a15697) and this PR were imported from source with AITER_TRITON_ONLY=1. Every test step and benchmark column had its own Triton cache, empty when it first ran.
The tests ran at 32244fb296, the multi-token check at 43892ff91b, and the benchmark and the gfx950 code comparison at 31c78201b4. The later commits change only the test file.
Results:
Whole test file:pytest op_tests/triton_tests/attention/test_kda.py with this PR gives 158 passed and 292 skipped. The skips are 283 gfx1250-only variants and features, and 9 gfx950 shape limits.
The base with this PR's test file,-k "packed_decode or fused_conv": 45 passed, 54 failed, 99 skipped. The 54 failures are the cases with conv1d_layout or padded_weight set, which stop at the shape and contiguity assert in kda.py.
Deliberate breaks: each fails exactly these cases, and the others pass:
taps 1 and 3 swapped in the gfx950 vector load: the 12 conv1d_layout=True cases of the one-token test at the bit-exact comparison, and the 36 of the multi-token test at its reference comparison;
the wrapper deriving the group stride from the width stride: the 6 padded [3, W, H*K] cases, at the bit-exact comparison;
the wrapper assuming channel stride W on the vector path: the 6 padded [3*H*K, W] cases, at the bit-exact comparison.
The multi-token (speculative decoding) path was also checked beyond the tests, with padded weights and at 4 warps as well as the 8 its config uses:
inputs from test_fused_conv_rms_gate_spec, plus one-token inputs, at 4 and 8 warps;
[3*H*K, W] in bf16 and fp32, and both layouts padded (fp32), equal [3, W, H*K] bit for bit in output, state and conv state, in 112 cases;
under the three breaks above, exactly the affected cases differ: the 84 [3*H*K, W] cases, the 28 padded [3, W, H*K] cases and the 28 padded [3*H*K, W] cases.
gfx950 code for one sequence of one token, at 8 to 64 heads, at 4 warps (num_buffers 8) and 8 warps (num_buffers 2), with and without the multi-token path:
[3, W, H*K]: the same instruction stream as the base in all 16 variants (998 instructions and 122 VGPRs at 4 warps);
[3*H*K, W], fp32 weight: 2 buffer_load_dwordx4 replace 4 buffer_load_dwordx2 at 4 warps, and 1 buffer_load_dwordx4 replaces 4 buffer_load_dword at 8 warps. Nothing else changes in the loads, and the VGPR count is the same.
bench_kda.py: see Performance.
Unverified:
gfx1250 was compiled with Triton 3.8.0 at 8 to 64 heads, without hardware, and not run.
[3, W, H*K] gives the base's instruction stream.
[3*H*K, W] compiles, with 3 more buffer_load_b128 and 12 fewer buffer_load_b32.
Padded weights: correct (above), not timed; their gfx950 code was not inspected.
The speculative-decoding config (8 warps, num_buffers 2): checked for correctness above, not timed.
Other environments: Triton versions other than 3.8.0, and MI250X and MI300X. This decode is gfx950/gfx1250 only.
PR-specific question
What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
Before this PR, the 18 cases of test_fused_recurrent_kda_packed_decode with conv1d_layout or padded_weight set, and the 36 conv1d_layout=True cases of test_fused_conv_rms_gate_spec, fail at the shape and contiguity assert in fused_recurrent_kda, because the decode accepted only a contiguous [3, W, H*K] weight.
No existing test passed another weight layout to the Gluon decode. The fused-conv tests copied their [3*lp, W] weights to [3, W, lp] first.
Changed op tests
op_tests/triton_tests/attention/test_kda.py: test_fused_recurrent_kda_packed_decode gains conv1d_layout and padded_weight. They pass the same weights as [3*H*K, W], and either layout from a buffer one larger in every dimension, through the test's existing checks: equality with fused_recurrent_kda on [3, W, H*K], and the independent PyTorch reference. Extending the test, rather than adding one, keeps every layout on the same inputs and checks. test_fused_conv_rms_gate_spec gains conv1d_layout too, which passes the bf16 [3*H*K, W] weight instead of the fp32 [3, W, H*K] copy, through the test's existing PyTorch reference. Its several-token steps run the resident-state call of the gfx950 decode with the 8-warp config, which the one-token test does not reach.
op_tests/op_benchmarks/triton/bench_kda.py: a benchmark; it asserts nothing. --conv1d_layout times the [3*H*K, W] column of the Performance table, and --num_buffers 4 and 8 let it time the config fused_recurrent_kda selects for one-token decode. No existing option did either.
This change was developed with AI assistance (Claude); I reviewed every line and ran the tests listed.
fused_recurrent_kda's Gluon decode (gfx950/gfx1250) required conv_weight
as a contiguous [3, W, H*K] tensor, so callers that store the q/k/v
short convs as one fused conv1d parameter ([3*H*K, 1, W]) had to keep a
transposed copy, which a weight refit does not update.
Read the weight through (group, width, channel) strides instead, and
accept [3, W, H*K] with any strides or [3*H*K, W], the two layouts the
Triton fused_kda_decode already supports; [3*H*K, W] is passed as its
transposed [3, W, H*K] view. The strides are constexpr, so the existing
contiguous layout compiles to the same offsets as before.
On gfx950, when a channel's taps are adjacent (width stride 1, as in
[3*H*K, W]), load them as one vector per channel and split it into the
taps, instead of one strided load per tap.
test_fused_recurrent_kda_packed_decode now also runs with the fused
conv1d layout and must match the [3, W, H*K] result bit for bit.
bench_kda.py --fused --conv1d_layout times the same weights in the
fused layout, and --num_buffers also takes 4 and 8, the values gfx950's
tuned decode configs use.
Signed-off-by: Rony Leppänen <[email protected]>
Co-authored-by: Claude <[email protected]>
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 7225 --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.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The tests do not cover non-dense 3-D weights with independent group, width, and channel strides, leaving output, recurrent-state, and convolution-state correctness unverified after removing the contiguity check.
This PR lets Gluon KDA decode accept fused conv1d weights directly, avoiding a separate transposed copy that callers must refresh after weight updates.
Changes:
Accepts [3*H*K, W] weights and strided [3, W, H*K] weights.
Adds stride-aware addressing on gfx950 and gfx1250, with vectorized tap loads on gfx950.
Extends packed-decode tests and benchmark options for the conv1d layout.
File
Description
op_tests/triton_tests/attention/test_kda.py
Adds conv1d-layout cases to packed-decode checks.
op_tests/op_benchmarks/triton/bench_kda.py
Adds a conv1d-layout option and more buffer-count choices.
aiter/ops/triton/attention/kda.py
Accepts both weight layouts and passes their strides to kernels.
test_fused_recurrent_kda_packed_decode also passes the conv weight padded:
both layouts stored in a buffer one larger in every dimension, so the
group, width and channel strides are not the dense ones. Output, recurrent
state and conv state must still equal the contiguous [3, W, H*K] result
bit for bit.
Signed-off-by: Rony Leppänen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The new layout tests cover only one token with 4 warps, leaving the gfx950 speculative-decode resident-state path and its 8-warp vector-load layout unverified against contiguous weights for output, recurrent state, and convolution state.
The new layout cases run only one token with 4 warps, so they do not cover the gfx950 resident-state call or its 8-warp vector-load layout used by speculative decode. Extend test_fused_conv_rms_gate_spec with these layout and padding cases, and compare the output, recurrent state, and conv state against contiguous weights.
test_fused_conv_rms_gate_spec also passes the bf16 [3*H*K, W] weight
directly, as a [3*H*K, 1, W] conv1d parameter viewed 2-D, instead of the
fp32 [3, W, H*K] copy. Its multi-token steps run the gfx950 decode's
resident-state call with the 8-warp config, which the one-token cases do
not reach.
Signed-off-by: Rony Leppänen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Re Copilot's review of 43892ff (kda_decode.py:384): added in 32244fb. test_fused_conv_rms_gate_spec now also passes the bf16 [3*H*K, W] weight directly. Its multi-token steps run the resident-state call with the 8-warp config, and with two taps of the gfx950 vector load swapped its 36 [3*H*K, W] cases fail.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human review is needed to assess whether the unpublished concern about duplicated weight-layout conversion conflicting with shared-helper guidance should affect approval.
Conflicts in op_tests/triton_tests/attention/test_kda.py: #7034 gave
test_fused_conv_rms_gate_spec and test_fused_recurrent_kda_packed_decode
the shared STATE_DTYPES list and dropped their seed parameter. Both
changes are kept, together with this branch's conv1d_layout and
padded_weight parameters.
Signed-off-by: Rony Leppänen <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
GPU validation is still needed for the gfx950 vector-load and gfx1250 strided-load changes, particularly output and state equality across both gfx1250 weight layouts and padded strides, since gfx1250 was only compile-checked.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The gfx1250 stride-addressing and gfx950 vector-load changes lack target-device runtime evidence, requiring human confirmation of correctness and performance before approval.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The weight-layout conversion is duplicated across the test and benchmark files and must be moved to the shared shuffle utility to comply with the documented rule.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The gfx1250 weight-addressing changes have only compile-time evidence and no head-matched hardware execution results, leaving runtime correctness and performance unverified for human assessment.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The gfx1250 weight-addressing changes have compile-only evidence, leaving runtime correctness and performance unverified and requiring human assessment of the remaining risk.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The gfx1250 weight-addressing changes have only compile-time validation, leaving runtime correctness on hardware for a human to confirm before approval.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The gfx1250 weight-addressing changes have compile-only evidence and no head-matched runtime correctness results, requiring human review of the untested hardware behavior before approval.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Gluon KDA decode (
fused_recurrent_kdawithconv_state, andfused_recurrent_kda_packed_decode) now also accepts the conv weight as[3*H*K, W]: a fused[3*H*K, 1, W]conv1d weight viewed as 2-D. Callers that keep the q/k/v short convolutions in one conv1d parameter, as vLLM's KDA layers do, can pass that parameter directly. They can then drop the transposed copy they keep today, along with the refresh it needs after every weight write and the stale weights left when a write skips that refresh.Scope: the gfx950 and gfx1250 Gluon decode kernels and their wrapper. The Triton
fused_kda_decodeis unchanged, and the existing[3, W, H*K]layout compiles to the same code as before.Motivation
[3, W, H*K]weight (assert conv_weight.shape == (3, W, H * K) and conv_weight.is_contiguous()inaiter/ops/triton/attention/kda.py).[3*H*K, 1, W]conv1d parameter. To call this decode, its Kimi-K3 ROCm layer (vllm/models/kimi_k3/amd/kda.py) and the GLM-5.3-Flash layer of [ROCm][Perf] Use AITER single-launch KDA decode in GLM-5.3-Flash vllm-project/vllm#63612 keep a[3, W, H*K]copy, refreshed after loads and reloads. A weight write that skips the refresh leaves the decode on stale weights; [ROCm][Perf] Use AITER single-launch KDA decode in GLM-5.3-Flash vllm-project/vllm#63612 listsnccl_m2n's direct resharding as one.fused_kda_decodealready accepts both layouts (aiter/ops/triton/gated_delta_net/fused_kda_decode.py:188-198).Changes
aiter/ops/triton/attention/kda.py:conv_weightmay be[3, W, H*K]with any strides, or[3*H*K, W], which is read as its transposed[3, W, H*K]view. The weight's (group, width, channel) strides go to the kernels as constexprs.aiter/ops/triton/_gluon_kernels/{gfx950,gfx1250}/attention/kda_decode.py: the kernels address the weight through these strides. A contiguous[3, W, H*K]weight gives the offsets they used before.[3*H*K, W]), the kernel loads them as one vector and splits it into the taps, instead of one strided load per tap.op_tests/triton_tests/attention/test_kda.py:test_fused_recurrent_kda_packed_decodealso runs with the weights as[3*H*K, W], and with either layout padded (stored in a buffer one larger in every dimension). Output, recurrent state and conv state must equal the contiguous[3, W, H*K]result bit for bit.test_fused_conv_rms_gate_spec(several tokens per sequence, the speculative-decoding path) also passes the bf16[3*H*K, W]weight directly.op_tests/op_benchmarks/triton/bench_kda.py:--fused --conv1d_layoutpasses the weights as[3*H*K, W].--num_buffersalso accepts 4 and 8, the values gfx950's tuned decode configs use.Performance (if applicable)
[3*H*K, W]runs at the speed of[3, W, H*K](−2.2 % to +0.9 % per call; the one larger difference is run-to-run variation, see below), and[3, W, H*K]runs the same code as before.MI355X, one decode token per sequence, fp32 conv weight. Setup under "Validation and unverified scope".
python op_tests/op_benchmarks/triton/bench_kda.py --fused --paged --num_heads 8 16 32 64 \ --batch_sizes 1 4 16 64 256 --seq_lens 1 --num_buffers 8 -metric time --runs 3 [--conv1d_layout]num_buffers8. That is thefusedentry ofaiter/ops/triton/configs/gfx950/gluon/attention/kda_decode/DEFAULT.json, whichfused_recurrent_kdaselects for one-token decode.[3, W, H*K](µs)[3*H*K, W](µs)[3*H*K, W]vs[3, W, H*K][3, W, H*K]run identical code, and differ by −0.1 % to +2.7 %.[3, W, H*K]run was slow (13.3 µs; the other run 12.3 µs). Against the base,[3*H*K, W]is −3.1 % on that row.[3*H*K, W]was 3.4 % to 11.7 % (0.23 to 1.03 µs) slower than[3, W, H*K]on 11 of the 12 rows at batch 16 or smaller.--num_buffers 2(bench_kda's default),[3*H*K, W]is 1.3 % to 3.2 % faster on 7 of the 12 rows at batch 16 or smaller, and 3.3 % to 4.2 % slower on 4 of the 8 rows at batch 64 and 256.[3*H*K, W]is slower than[3, W, H*K]on no row at 16 to 64 heads and batch 16 to 256.--num_buffers 8both layouts run 3 waves per SIMD (152 and 154 VGPRs).Testing
Documentation
The docstring of
fused_recurrent_kdadoes not describe the conv arguments. The comment at the shape check inkda.pynames the two accepted layouts.Dependencies
Breaking Changes
None. Every conv weight the base accepted is still accepted. A contiguous
[3, W, H*K]weight compiles to the same instruction stream as the base: on gfx950 as launched on an MI355X, on gfx1250 in a compile without hardware.PR Self-Review
Reviewed revision
76b01ddce3f01162345fcb6dcdc3950e43b28602Behavior and intent
[3*H*K, W], and[3, W, H*K]with other strides. Callers can then pass their conv1d parameter directly, instead of a copy that must be refreshed after every weight write.Validation and unverified scope
Setup:
vllm/vllm-openai-rocm:nightly-rocm72-c50aca14416ef29f6ed0ed256302f30646726dcd: Triton 3.8.0, torch 2.13.0, HIP 7.2.3914a15697) and this PR were imported from source withAITER_TRITON_ONLY=1. Every test step and benchmark column had its own Triton cache, empty when it first ran.32244fb296, the multi-token check at43892ff91b, and the benchmark and the gfx950 code comparison at31c78201b4. The later commits change only the test file.Results:
pytest op_tests/triton_tests/attention/test_kda.pywith this PR gives 158 passed and 292 skipped. The skips are 283 gfx1250-only variants and features, and 9 gfx950 shape limits.-k "packed_decode or fused_conv": 45 passed, 54 failed, 99 skipped. The 54 failures are the cases withconv1d_layoutorpadded_weightset, which stop at the shape and contiguity assert inkda.py.conv1d_layout=Truecases of the one-token test at the bit-exact comparison, and the 36 of the multi-token test at its reference comparison;[3, W, H*K]cases, at the bit-exact comparison;[3*H*K, W]cases, at the bit-exact comparison.test_fused_conv_rms_gate_spec, plus one-token inputs, at 4 and 8 warps;[3*H*K, W]in bf16 and fp32, and both layouts padded (fp32), equal[3, W, H*K]bit for bit in output, state and conv state, in 112 cases;[3*H*K, W]cases, the 28 padded[3, W, H*K]cases and the 28 padded[3*H*K, W]cases.num_buffers8) and 8 warps (num_buffers2), with and without the multi-token path:[3, W, H*K]: the same instruction stream as the base in all 16 variants (998 instructions and 122 VGPRs at 4 warps);[3*H*K, W], fp32 weight: 2buffer_load_dwordx4replace 4buffer_load_dwordx2at 4 warps, and 1buffer_load_dwordx4replaces 4buffer_load_dwordat 8 warps. Nothing else changes in the loads, and the VGPR count is the same.bench_kda.py: see Performance.Unverified:
[3, W, H*K]gives the base's instruction stream.[3*H*K, W]compiles, with 3 morebuffer_load_b128and 12 fewerbuffer_load_b32.num_buffers2): checked for correctness above, not timed.PR-specific question
What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
test_fused_recurrent_kda_packed_decodewithconv1d_layoutorpadded_weightset, and the 36conv1d_layout=Truecases oftest_fused_conv_rms_gate_spec, fail at the shape and contiguity assert infused_recurrent_kda, because the decode accepted only a contiguous[3, W, H*K]weight.[3*lp, W]weights to[3, W, lp]first.Changed op tests
op_tests/triton_tests/attention/test_kda.py:test_fused_recurrent_kda_packed_decodegainsconv1d_layoutandpadded_weight. They pass the same weights as[3*H*K, W], and either layout from a buffer one larger in every dimension, through the test's existing checks: equality withfused_recurrent_kdaon[3, W, H*K], and the independent PyTorch reference. Extending the test, rather than adding one, keeps every layout on the same inputs and checks.test_fused_conv_rms_gate_specgainsconv1d_layouttoo, which passes the bf16[3*H*K, W]weight instead of the fp32[3, W, H*K]copy, through the test's existing PyTorch reference. Its several-token steps run the resident-state call of the gfx950 decode with the 8-warp config, which the one-token test does not reach.op_tests/op_benchmarks/triton/bench_kda.py: a benchmark; it asserts nothing.--conv1d_layouttimes the[3*H*K, W]column of the Performance table, and--num_buffers4 and 8 let it time the configfused_recurrent_kdaselects for one-token decode. No existing option did either.This change was developed with AI assistance (Claude); I reviewed every line and ran the tests listed.