Repository navigation
[Triton/Gluon] Move Triton unit tests into their wrapper's folder - #5942
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Tests remain in the legacy folder, guidance references are stale, and tests and benchmarks still depend directly on private kernels.
Review effort: Balanced
Findings: 5
Open (6)
Benchmark chunk_kimi_delta_attn via the public wrapper · New Benchmark FlashKDA through the public wrapper · New Route tests through the public wrapper · New Refactor tests to use the kimi_delta_attn wrapper · New Move tests to the kimi_delta_attn directory · New Update stale flash_kda documentation paths · New
What changed in this PR
Relocates Kimi Delta Attention kernel modules under the wrapper-aligned kimi_delta_attn package and updates imports across wrappers, tests, benchmarks, and Gluon kernels.
Changes:
- Renames internal Triton/Gluon kernel paths and updates consumers.
- Relocates shared KDA utilities and launch helpers.
- Updates tests and benchmarks to reference the new private paths.
| File | Description |
|---|---|
op_tests/triton_tests/chunk_delta_attn/test_flash_kda.py |
Updates Triton/Gluon imports. |
op_tests/triton_tests/chunk_delta_attn/test_fast_launch.py |
Updates fast-launch imports. |
op_tests/triton_tests/chunk_delta_attn/test_chunk_delta_attn_fwd.py |
Updates KDA utility imports. |
op_tests/op_benchmarks/triton/bench_flash_kda.py |
Updates FlashKDA benchmark import. |
op_tests/op_benchmarks/triton/bench_chunk_delta_attn.py |
Updates chunk-attention benchmark import. |
aiter/ops/triton/kimi_delta_attn/chunk_delta_attn.py |
Points the public wrapper at the relocated kernels. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/wy_fast.py |
Updates internal utility imports. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/utils/l2norm.py |
Relocates L2-normalization kernels. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/utils/index.py |
Updates shared utility import. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/utils/cumsum.py |
Updates cumsum dependencies. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/utils/__init__.py |
Establishes the relocated utility package. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/intra_attn.py |
Updates internal KDA imports. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/gla_output.py |
Updates internal utility imports. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/gate.py |
Updates shared utility import. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/flash_kda.py |
Updates Triton and Gluon dependencies. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/fast_launch.py |
Relocates the optimized launch helper. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/chunk_fwd.py |
Updates forward-pipeline imports. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/chunk_delta_attn_utils.py |
Relocates shared KDA utilities. |
aiter/ops/triton/_triton_kernels/kimi_delta_attn/__init__.py |
Re-exports relocated implementations. |
aiter/ops/triton/_triton_kernels/fusions/attn_res.py |
Updates an internal path reference. |
aiter/ops/triton/_gluon_kernels/gfx950/kimi_delta_attn/flash_kda_k2.py |
Updates the fast-launch dependency. |
aiter/ops/triton/_gluon_kernels/gfx950/kimi_delta_attn/flash_kda_k1.py |
Updates the fast-launch dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6042266 to
8530c0f
Compare
The wrapper that launches these kernels is aiter/ops/triton/kimi_delta_attn/chunk_delta_attn.py, so the kernel directories take the wrapper folder's name; kernel directories mirror the wrapper folder, not the kernel family. - _triton_kernels/chunk_delta_attn/ -> _triton_kernels/kimi_delta_attn/: git mv of the 13 files plus the import path in every module that names the old one: the wrapper, the kernels' own absolute imports, the gfx950 Gluon flash_kda kernels, fusions/attn_res.py, the two benchmarks and the three tests. ruff re-sorted the import block of chunk_fwd.py, where the renamed module now sorts after the gated_delta_net one. - _gluon_kernels/gfx950/chunk_delta_attn/ -> gfx950/kimi_delta_attn/: the Gluon flash_kda kernels are launched by the same wrapper (through _triton_kernels/kimi_delta_attn/flash_kda.py). git mv of the two files plus the import path in flash_kda.py and the two tests that import the kernels directly. No code change otherwise.
8530c0f to
bc9fe6b
Compare
#5942 edited the three chunk_delta_attn tests this branch moves to triton_tests/kimi_delta_attn/; the edits apply cleanly at the new paths.
A config change now selects the tests of the kernels that load that config and of the kernels that call them, instead of its whole op folder. CK/ASM tuning CSVs no longer force the full suite, since no Triton kernel reads them. Attention configs also map to kimi_delta_attn/, where chunk_delta_attn/ moved in #5942. While DRY_RUN is on, CI still runs every test and only prints this selection. On the 17 config-only commits merged to main since Sep 10, the selection is 1-13 test files where CI ran 118-137.
A config change now selects the tests of the kernels that load that config and of the kernels that call them, instead of its whole op folder. CK/ASM tuning CSVs no longer force the full suite, since no Triton kernel reads them. Attention configs also map to kimi_delta_attn/, where chunk_delta_attn/ moved in #5942.


Move _triton_kernels/chunk_delta_attn/ to _triton_kernels/kimi_delta_attn/
The wrapper that launches these kernels is
aiter/ops/triton/kimi_delta_attn/chunk_delta_attn.py, so the kernel
directory takes the wrapper folder's name