Repository navigation
[2/8] refactor(kernels): move attention kernels to miles/kernels/attention - #3606
Merged
Zhichenzzz merged 1 commit intoOct 8, 2026
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Zhichenzzz
added this pull request to stack #3611
September 22, 2026 23:16
This was referenced Sep 22, 2026
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
September 23, 2026 06:19
45f9d98 to
d0257a8
Compare
This was referenced Sep 23, 2026
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
2 times, most recently
from
September 23, 2026 23:15
5ecf343 to
83ed40f
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
September 24, 2026 01:05
83ed40f to
044f230
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
2 times, most recently
from
September 30, 2026 20:05
4dd799c to
3c45a02
Compare
HJSang
approved these changes
Sep 30, 2026
HJSang
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Just refactoring and no risk to merge
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
September 30, 2026 21:57
3c45a02 to
817ed9e
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
October 2, 2026 07:51
817ed9e to
188e617
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
2 times, most recently
from
October 2, 2026 22:31
4c14c11 to
f82f79a
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
October 3, 2026 07:43
f82f79a to
7170a9a
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
October 7, 2026 22:54
7170a9a to
69cd55c
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
October 7, 2026 23:45
69cd55c to
0bde626
Compare
yueming-yuan
approved these changes
Oct 8, 2026
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
2 times, most recently
from
October 8, 2026 15:19
254e1b0 to
d540607
Compare
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
October 8, 2026 16:47
d540607 to
6cdfb87
Compare
…ention Second half of filing every hand-written training kernel by op. Moves plus import updates; kernel sources are unchanged. - dsa/: the GLM-5 / DeepSeek-V3.2, DeepSeek-V4 and DeepSeek-V4.1 TileLang indexer and sparse-attention kernels, still one copy per model (the next PR merges them), and the top-k selector (from miles_plugins/models/dsa_topk.py). V4.1's indexer import of dsa_topk follows the selector; left alone it breaks at import time with no textual conflict. - dsa/kpool.py: the pure-Triton half of GLM-5.3-Flash's key-pooled selection splits out of glm5_next/ops/kpool_indexer.py; the replay-aware kpool_select_topk stays in the plugin. - qsa/: Qwen3.8-Next's Triton block-sparse attention, out of qwen3_8_next/ops/kernel/ (sparse_attention.py, block_sparse_attention.py), exported from the package. - deepseek_v4/ops/kernel is gone; its precision-aligned ops move up to deepseek_v4/ops. - README: the layout and the rules. The GDN backend selector stays in miles_plugins/models: it only picks between fla and FlashQLA and owns no kernel.
Zhichenzzz
force-pushed
the
zhichen/kernels-reorg-attention
branch
from
October 8, 2026 19:16
6cdfb87 to
a789e40
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Files the attention kernels under
miles/kernels/attention/. Moves and import updates only.dsa/: the GLM-5 / DeepSeek-V3.2, DeepSeek-V4 and DeepSeek-V4.1 TileLang indexer + sparse-attention copies (merged in [3/8] refactor(kernels): unify the DSA kernels of GLM-5 and DeepSeek-V4 / V4.1 #3607), the top-k selector, and GLM-5.3-Flash's key-pool selection (kpool.py).qsa/: Qwen3.8-Next's Triton block-sparse attention.README.md: the layout and the rules.The GDN backend selector stays in
miles_plugins/models: it only picks between fla and FlashQLA and owns no kernel. DeepSeek-V4.1'sdsa_topkimport follows the selector; left alone, it would break at import time without any textual conflict.Tests
main.This branch on H200 (
45f9d98bc), againstmainmainpy_compile+ import of every changed moduletests/fast/test_linear_attn_kernel_selection.pyStack
miles/kernelsmiles/kernels/attentionmiles_plugins/models/linear_attn.py)Rules for
miles/kernelsare in its README: only kernels we write, one directory per op, names say what is computed (never the backend), callers import the entry, a torch-reference test per op.