Skip to content

[Triton/Gluon] Add fused Kimi-K3 KDA whole-layer ops (gfx950, TP8) - #6550

Closed
karverma-amd wants to merge 7 commits into
ROCm:mainfrom
karverma-amd:karverma/kimi-k3-kda-fused
Closed

karverma-amd wants to merge 7 commits into
ROCm:mainfrom
karverma-amd:karverma/kimi-k3-kda-fused

Conversation

@karverma-amd

Copy link
Copy Markdown
Contributor

Summary

Adds fused Kimi-K3 KDA (Kimi Delta Attention) whole-layer Gluon ops for MI355X (gfx950), TP8:

  • Prefill — ragged-batch gated-delta core (forget-B + beta sigmoid + causal conv + fp32 chunked gated-delta scan + gated RMSNorm) in a single Gluon launch; the caller applies o_proj.
  • Decode — the whole KDA layer (QKVG/beta-forget-A projections + conv + single-token gated-delta recurrence + gated RMSNorm + fused O matmul), returning the rank-local O partial for the caller's tensor-parallel reduce.

New files (no existing code touched):

aiter/ops/triton/kimi_delta_attn/{__init__,fused_layer_prefill,fused_layer_decode}.py
aiter/ops/triton/_gluon_kernels/gfx950/kimi_delta_attn/{fused_kda_layer_prefill,fused_kda_layer_decode}.py

Design

  • Public wrappers kimi_kda_fused_layer_{prefill,decode} with *_supported() predicates — gfx950 + Triton ≥ 3.8 gate, lazy tile import (module stays importable on CPU / old Triton / non-gfx950), fail-closed (report, don't assert), mirroring fused_gdn_prefill_qkvz.
  • Decode dispatch routes by batch range to {m64, m256} (m ≤ 64 → m64, m > 64 → m256), chosen from an on-device tile-vs-tile bake-off across every real decode tier: the two general schedules are correct over their range and within a few µs of the per-tier best, while the per-size variants are never fastest and the serial catch-all is 2–8× slower at large m. Decode batches are exact single tokens (no ragged lengths), so the split is unambiguous.

Provenance & validation

Kernels ported from the validated Artemis Kimi-K3 MI355X TP8 pack. On MI355X (gfx950, Triton 3.8):

  • Ops compile/run and update conv/recurrent state in place, deterministic, bit-identical to the Artemis source across all decode batch sizes and prefill shapes.
  • End-to-end through SGLang (Kimi-K3, TP8): reproduces the fused-layer speedup, GSM8K (1319-Q, 5-shot) = 0.978.
  • Importable everywhere / fails closed off gfx950 or pre-3.8 Triton.

black clean; ruff advisory remainder is confined to the hand-tuned Gluon tiles (kept byte-faithful).

@karverma-amd
karverma-amd requested a review from a team October 14, 2026 22:46
@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 6550 --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.

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

Decode drops supported tail rows, tensor checks leave unsafe inputs accepted, and tests and benchmarks are missing.

8 open findings
What changed in this PR

Adds model-specific Kimi-K3 Delta Attention operations to AITER’s Gluon backend for gfx950 with TP8.

Changes:

  • Adds ragged prefill with in-place cache updates.
  • Adds decode projections, recurrence, and rank-local output projection.
  • Adds public wrappers with support predicates and lazy kernel imports.
File Description
aiter/​ops/​triton/​kimi_delta_attn/​fused_layer_prefill.py Prefill validation and dispatch.
aiter/​ops/​triton/​kimi_delta_attn/​fused_layer_decode.py Decode validation and batch routing.
aiter/​ops/​triton/​kimi_delta_attn/​__init__.py Public operation exports.
aiter/​ops/​triton/​_gluon_kernels/​gfx950/​kimi_delta_attn/​fused_kda_layer_prefill.py Chunked prefill pipeline and cache updates.
aiter/​ops/​triton/​_gluon_kernels/​gfx950/​kimi_delta_attn/​fused_kda_layer_decode.py Decode schedules and output projection.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

):

m = x.shape[0]
group = 8
Comment on lines +211 to +212
if tuple(state_indices.shape) != (m,) or not state_indices.is_contiguous():
return False, f"cache indices must be contiguous [{m}]"
f"kimi_kda_fused_layer_decode does not support this call: {reason}"
)

tile = _load_tile(_select_tile_key(x.shape[0]))
Comment on lines +234 to +236
or tuple(has_initial_state.shape) != (sequences,)
):
return False, f"has_initial_state must be bool [{sequences}]"
):
return False, f"has_initial_state must be bool [{sequences}]"

return True, ""

import torch

from aiter.ops.triton.utils._triton.arch_info import get_arch
return True, ""


def kimi_kda_fused_layer_decode(
return True, ""


def kimi_kda_fused_layer_prefill(
@zufayu
zufayu requested review from a team and Boss2002n October 15, 2026 02:09
Whole rank-local Kimi Delta Attention layer kernels for Kimi-K3 on
MI355X (gfx950):

- Prefill: ragged-batch gated-delta core (forget-B + beta sigmoid +
  causal conv + fp32 chunked gated-delta scan + gated RMSNorm), single
  Gluon launch; caller applies o_proj.
- Decode: whole-layer fused step (QKVG/beta-forget-A projections + conv
  + single-token gated-delta recurrence + gated RMSNorm + fused O matmul)
  returning the rank-local O partial for the caller's TP reduce.

Public wrappers expose kimi_kda_fused_layer_{prefill,decode} with
*_supported() predicates (gfx950 + Triton >= 3.8 gate, lazy tile import,
fail-closed), mirroring the fused_gdn_prefill_qkvz pattern. Decode
dispatch routes by batch range to {m64, m256}, chosen from an on-device
tile-vs-tile bake-off across every real decode tier (the two general
schedules dominate; the per-size variants are never fastest and the
serial catch-all is 2-8x slower at large m).

Kernels ported from the validated Artemis Kimi-K3 MI355X TP8 pack.
@karverma-amd
karverma-amd force-pushed the karverma/kimi-k3-kda-fused branch 2 times, most recently from 52e407a to 4b44303 Compare October 15, 2026 03:59
…tests

Decode:
- Gate m>64 on divisibility by the m256 recurrence group (8): the schedule
  tiles the recurrence as `m // group`, so a non-multiple m would silently
  skip its tail rows. Non-divisible m now falls back to native. (Every real
  cuda-graph decode tier above 64 is a multiple of 8; m64 tiles per-row and
  needs no such guard.)
- Validate output_tensor shape/dtype/device/contiguity before the kernel
  writes it.
- Require state_indices on the input device.

Prefill:
- Require conv/temporal cache, cache indices, cu_seqlens and
  has_initial_state on the qkv device.
- Require a contiguous has_initial_state.

Both:
- Probe the GPU arch lazily and fail closed if it can't be read, so the module
  stays importable on a CPU-only / non-ROCm host.

Tests/bench:
- Add decode + prefill tests (dispatch table incl. the divisibility guard,
  fail-closed gates, on-device run/in-place/determinism, output_tensor
  rejection) and a latency benchmark. 28 pass on gfx950.

Repo-rule compliance (aiter/ops/triton rules 5, 10, 20, 29):
- Move the host launch functions into the public wrappers so the Gluon tile
  modules are torch-free (rule 10); each launcher imports its tile kernels
  lazily, mirroring the fused_gdn_prefill_qkvz layout. Launchers run at
  cuda-graph capture, so the lazy import adds no decode-replay overhead.
- Give each launched tile kernel a make_kernel_repr repr= (rule 5), so traces
  name the compiled variant by its shape/tile/path-flag keys.
- Call the public `shared_memory_descriptor.reinterpret` (not the private
  `_reinterpret`) in the m256 tiles, matching every other aiter Gluon kernel
  and the ROCm Triton 3.8 wheel aiter CI uses; the private name is absent
  there. Validated 28/28 against that exact wheel (git7cb7b059).
- Clear the ruff 0.16.0 findings on the changed files: collapse single-child
  nested ifs, drop a dead local and an unused unpack, and rename the ambiguous
  `O` kernel argument to `OUT`.

All 28 gfx950 tests still pass after the refactor.
@karverma-amd
karverma-amd force-pushed the karverma/kimi-k3-kda-fused branch from 4b44303 to 4a0592b Compare October 15, 2026 05:08
@azaidy azaidy assigned vgokhale and unassigned Boss2002n Oct 15, 2026
…initial-state + cache updates

Addresses Copilot review:
- Put the fused-layer test in op_tests/triton_tests/kimi_delta_attn/ to
  match the wrapper folder (Triton test rule 1), not attention/.
- Assert the conv/recurrent caches change in place on decode and prefill.
- Add a prefill variant that sets has_initial_state to exercise the
  initial-state path.
@karverma-amd

Copy link
Copy Markdown
Contributor Author

Addressed the feedback. -

Thread: decode — “Require state_indices on the input device” (fused_layer_decode.py)

Already addressed in the current HEAD (53aca59). At line 237, fused_layer_decode.py returns unsupported if state_indices.device != device (device is derived from x.device), before performing the shape and contiguity checks. This suggestion was based on the initial commit and was addressed in the harden-gates commit (4a0592b). Resolving as outdated.


Thread: decode — “Validate output tensor shape, dtype, device, and contiguity” (fused_layer_decode.py)

Already addressed in 53aca59. The public wrapper validates output_tensor before dispatch at lines 294–306, rejecting non-tensors, incorrect shapes (m, 7168), non-bf16 dtypes, devices that differ from x.device, and non-contiguous storage with a ValueError. This is covered by test_decode_rejects_bad_output_tensor.

Resolving as outdated.


Thread: prefill — “Require cache metadata and tensors on qkv device” (fused_layer_prefill.py)

Already addressed in 53aca59. All cache and metadata tensors are validated to ensure they reside on qkv.device:

  • state — line 230
  • conv_state — line 241
  • state_indices — line 250
  • cu_seqlens — line 258
  • has_initial_state — line 266

This suggestion predates the harden-gates commit (4a0592b).

Resolving as outdated.


Two additional stale threads

These have the same root cause: both issues were addressed in 4a0592b.

Thread: prefill — “Require has_initial_state to be contiguous”

Already addressed in 53aca59. At line 268, fused_layer_prefill.py rejects non-contiguous has_initial_state tensors (e.g., a flags[::2] view), alongside the existing dtype, shape, and device validations.

Resolving as outdated.

Thread: Gluon decode — “m=65 skips the last recurrence row”

Addressed by gating unsupported shapes rather than widening the group. _select_tile_key in fused_layer_decode.py (lines 120–132) routes m > 64 to the m256 schedule only when m % 8 == 0. Otherwise, it returns None, allowing execution to fall back to the native path instead of launching a kernel with an uninitialized tail row.

All actual decode tiers above 64 are multiples of 8. This behavior is covered by test_select_tile_key, which verifies that 65, 70, and 100 return None.

Resolving as outdated.


@on_device
@pytest.mark.parametrize("m", [1, 8, 32, 64, 96, 128, 192, 256])
def test_decode_runs_inplace_deterministic(m):

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.

What is the purpose of this test? It is not comparing to a reference. Comparing to itself seems meaningless?

@@ -0,0 +1,1691 @@
"""Selected kda layer decode schedules and shared helpers."""

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.

the duplicated device math is a large maintenance surface. A fix
to a shared helper does not reach this copy. This is the "no duplicate kernels,
common functions go to utils" convention.

This is reimplementing conv1d, GD scan, rmsnorm etc.

The decode and prefill Gluon kernels each defined a local sigmoid (exp2-
and exp-form). Replace both with the shared common.utils.sigmoid, as
gfx950/attention/kda_decode.py already does.

The import also installs the reinterpret compat shim from common.utils
(it aliases shared_memory_descriptor._reinterpret to reinterpret on the
Triton 3.8 wheel that lacks the new name). The m256 decode schedule calls
.reinterpret, so without the shared import the m256 tiles (m=96/128/192/
256) fail to compile on Triton 3.8. The decode kernel now imports it, so
those tiles compile. Decode latencies are unchanged.
Replace the decode and prefill *_runs_inplace_deterministic tests, which
only compared the kernel to itself, with correctness checks against an
independent reference built from the native aiter ops the fused kernels
replace.

Decode: QKVG/forget projections + native fused_kda_decode + O matmul.
Prefill: native causal_conv1d_split_qkv (+SiLU) + chunk_kimi_delta_attn +
gated RMSNorm. Both keep the in-place / aliasing contract asserts and add
assert_close on the output (and the in-place state update). The references
match to ~1e-4 over every covered shape and both initial-state paths.
@karverma-amd

Copy link
Copy Markdown
Contributor Author

Thanks @vgokhale. Addressed both points.

Tests — compare to a reference, not to themselves

You're right that the *_runs_inplace_deterministic tests proved nothing. I replaced both with correctness checks against an independent reference built from the native aiter ops these kernels replace:

  • test_decode_matches_native_reference — QKVG/forget projections (matmul) + native fused_kda_decode (conv + single-token recurrence + gated RMSNorm) + O matmul. Matches to ~1.2e-4 over m ∈ {1,8,32,64,96,128,192,256}.
  • test_prefill_matches_native_reference — native causal_conv1d_split_qkv_triton_fn (+SiLU) + chunk_kimi_delta_attn + gated RMSNorm. Matches the output and the in-place state update to ~1.3e-4 over (1024,1)/(2048,4)/(8192,32) × {no-initial-state, read-initial-state}.

Both keep the in-place / aliasing contract asserts; the torch.equal(o, o2) self-check is gone.

Duplicated device math — shared helpers, plus a real bug it surfaced

Folded the two local sigmoid copies (decode exp2-form, prefill exp-form) onto the shared common.utils.sigmoid, matching what gfx950/attention/kda_decode.py already does.

That import also surfaced a real bug: the decode kernel called .reinterpret but never imported common/utils, so the reinterpret compat shim was never installed and the entire m256 schedule (m=96/128/192/256) failed to compile on Triton 3.8 — our stated minimum. It now imports the shared module, so those tiles compile (4 previously-failing tests pass). Decode latencies are unchanged.

On conv1d / GD-scan / gated-RMSNorm specifically: I looked at hoisting these too, but each is fused into its schedule's tiling and data movement — per-row (m64), grouped (m256), and chunked-ragged with prefix gather/scatter (prefill) — with the reductions on different axes and Gluon layouts. A single shared helper would either not fit all three schedules or give back the hand-tuned latency the separate schedules exist for, and they're Gluon so they can't call the existing Triton conv/rmsnorm device helpers anyway. I kept the genuinely-shared scalar math (the activation + the shim) shared and left the layout-bound tiling per schedule. Happy to revisit if you have a specific extraction in mind.

@karverma-amd
karverma-amd requested a review from vgokhale October 21, 2026 21:24

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

Can you attach some performance numbers to this? There are some very similar files that exist in aiter for KDA. The main difference I can spot from your chunked kernel compared to the others is that qkv are before the CONV is applied. The decode KDA looks very similar to me

Flash KDA: #6177
Chunk KDA: https://github.com/ROCm/aiter/blob/main/aiter/ops/triton/attention/chunk_kda.py
Decode KDA: https://github.com/ROCm/aiter/blob/main/aiter/ops/triton/attention/kda.py

@karverma-amd

Copy link
Copy Markdown
Contributor Author

Thanks @omuhamma — numbers below, plus how this differs from the existing KDA ops.

How this differs from Decode / Chunk / Flash KDA

kda.py (decode), chunk_kda.py, and Flash KDA (#6177) all implement the gated-delta core only — the recurrence / chunk math over already-projected q/k/v/g/beta. They each leave the rest of the KDA layer (in/out projections, the short conv1d, the gated-RMSNorm, and the output matmul) to separate PyTorch/aiter launches around them.

This PR fuses the whole rank-local layer into a single launch per path:

in-proj → conv1d → gated-delta recurrence → gated-RMSNorm → out-proj

So the decode kernel here looks similar to kda.py because the recurrence is the same math — but it is one stage of a larger fused op, not the op itself. In fact this PR's reference test composes exactly those native ops (fused_kda_decode / chunk_kimi_delta_attn + the projections + conv + norm) to validate correctness. The win isn't a faster core; it's eliminating the intermediate launches + HBM round-trips between the core and the surrounding projections/conv/norm/matmul.

1. Op-level: fused vs. the native path it replaces

Same component sequence the correctness test validates against (test_kimi_kda_fused_layer.py), timed with projection matmuls at bf16 (production precision, not the fp32 the reference upcasts to). gfx950, Triton 3.8, MI355X. bench_kimi_kda_fused_vs_unfused.py.

Decode (µs/call):

m 1 8 32 64 96 128 192 256
fused 57.3 57.1 57.5 58.6 69.6 79.3 101.0 106.4
unfused 94.1 113.2 103.3 106.4 125.4 147.1 161.0 209.3
speedup 1.64× 1.98× 1.80× 1.82× 1.80× 1.86× 1.59× 1.97×

Prefill (µs/call):

shape 1024/1 2048/4 4096/8 8192/32
fused 136.0 130.6 162.0 292.2
unfused 502.0 483.2 725.1 1374.3
speedup 3.69× 3.70× 4.48× 4.70×

Fused decode is 1.6–2.0× the native path; fused prefill 3.7–4.7× (prefill gains more — the chunked mixer + conv + norm are heavier relative to the projections, so more is saved by fusing).

2. End-to-end (Kimi-K3, sglang, TP8 MI355X)

The op-level win dilutes at the model level because the KDA layer is only a slice of total decode/prefill time. Speedup = native-unfused / this-PR (>1.0 = faster):

ISL / OSL C4 C8 C64 C256
1K / 1K 1.079 1.067 1.087 1.095
5K / 500 1.071 1.062 1.041 0.967
8K / 1K 1.074 1.074 1.038 — (queue-saturated)

+4–9% end-to-end in 10/11 points. The one regression is 5K/500 @ C256 (native ~3.4% faster): at max concurrency the layer is already saturated, so fusion's launch-overhead savings stop paying off. GSM8K parity held across both arms (0.95x).

Times the single fused decode/prefill kernel against the native aiter path
it replaces (the same component sequence test_kimi_kda_fused_layer.py
validates against), with projection matmuls at bf16 production precision.
Answers 'why a separate op': decode 1.6-2.0x, prefill 3.7-4.7x over the
unfused path on gfx950/MI355X.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@karverma-amd
karverma-amd force-pushed the karverma/kimi-k3-kda-fused branch from 35a77a9 to 924c483 Compare October 26, 2026 16:18
@karverma-amd
karverma-amd requested a review from omuhamma October 26, 2026 16:24
@omuhamma

omuhamma commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Could you compare your numbers directly with the other pull requests I listed? You could get claude to run the same config on both, it would be easier to compare then

Apologies on the lack of clarification on the earlier comment

@karverma-amd

Copy link
Copy Markdown
Contributor Author

Thanks @omuhamma — ran them all on one MI355X with one harness. One thing to flag up front that makes the comparison read oddly if I don't: the ops aren't measuring the same thing.

FlashKDA (#6177), chunk_kda, and kda decode are the gated-delta core — the scan over already-projected q/k/v/g/beta. This PR is the whole rank-local layer — in/out projections + conv1d + that core + gated-RMSNorm + out-matmul, fused into one launch. So a straight "my number vs their number" is core-vs-whole-layer; my op does strictly more per call. The win isn't a faster core — it's removing the launches/HBM round-trips around it.

All numbers below: gfx950 MI355X, H=12, head_dim=128 (Kimi-K3 TP8), triton.testing.do_bench (same harness as bench_flash_kda.py), µs/call. Harness committed as bench_kda_cross_pr.py so you can reproduce.

Prefill (B=1 sequence of T tokens)

T FlashKDA core (#6177)* chunk core this PR (whole layer) unfused (whole layer)
1024 110.9 596.3 200.4 1073.7
2048 234.5 732.5 290.7 1253.6
4096 309.5 1022.9 351.7 1609.8
8192 441.3 1652.6 492.8 2366.9

Decode (batch rows, 1 token each)

batch decode core (kda.py) this PR (whole layer) unfused (whole layer)
1 53.2 121.8 184.9
32 56.8 117.8 227.6
128 99.5 166.3 334.2
256 161.6 215.2 390.1

How to read it

  • Fused vs unfused whole-layer (the real apples-to-apples — same work, same machine): prefill 4.3–5.4×, decode 1.5–2.2×. This is the kernel's reason to exist.
  • Whole layer vs a bare core: at T=8192 the fused op does the entire layer in 493µs vs 441µs for the FlashKDA core alone — +12% for ~5× the work.

@omuhamma

Copy link
Copy Markdown
Contributor

I am currently working on optimizing the singular kernels (flash kda mainly), for prefill its a better idea to optimize the singular kernels since typically prefill chunks are so large that fusing wont get the best of gains for it

For decode the whole layer op fusion can be useful, at the moment we need to compare more numbers in model runs before knowing what is better. The numbers at the moment look like decode (separate gemm and kda) is performing better but it is hard to tell since they dont compare directly 1:1

@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 2456c1ed1fe8 · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. 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?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer
  • FAIL — changed op test not explained in Changed op tests: op_tests/op_benchmarks/triton/bench_kimi_kda_fused_layer.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/op_benchmarks/triton/bench_kimi_kda_fused_vs_unfused.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/triton_tests/kimi_delta_attn/test_kimi_kda_fused_layer.py
  • FAIL — Changed op tests must explain why each changed op test is necessary and non-redundant

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@omuhamma

Copy link
Copy Markdown
Contributor

I think we can close this PR, monokernels are to be done inside serving frameworks and fusing all prefill ops together will typically give no gain since these are large ops (not KLL bound), its better to optimize the kernels themselves.

@karverma-amd

Copy link
Copy Markdown
Contributor Author

Closing — on current Kimi-K3 TP8 the whole-layer fused decode now benchmarks at parity with the base per-kernel KDA
path (decode TPOT within ±3.4%, centered ~0; the original +6–9% was absorbed by upstream flash-KDA improvements),
prefill fusion gives no E2E gain, and per @omuhamma monokernels belong in the serving framework — so there's no longer a case to carry it.

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.

6 participants