Repository navigation
[Trition] Add chunk_delta_attn triton kernels - #4568
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
ruff
Function definition does not bind loop variable k
Function definition does not bind loop variable beta
Function definition does not bind loop variable v
Function definition does not bind loop variable g
Function definition does not bind loop variable scale
Function definition does not bind loop variable A_log
Function definition does not bind loop variable dt_bias
torch.nn.functional imported but unused
Do not catch blind exception: Exception
Unpacked variable A_log is never used
Unpacked variable dt_bias is never used
Import block is un-sorted or un-formatted
Unpacked variable B is never used
Unpacked variable T is never used
Unpacked variable B is never used
Unpacked variable T is never used
Unpacked variable H is never used
Unpacked variable S is never used
Unpacked variable B is never used
Unpacked variable T is never used
Unpacked variable H is never used
Unpacked variable S is never used
Unpacked variable B is never used
Unpacked variable T is never used
Unpacked variable H is never used
Unpacked variable S is never used
Unpacked variable B is never used
Unpacked variable T is never used
Unpacked variable H is never used
Unpacked variable S is never used
Unpacked variable B is never used
Unpacked variable T is never used
Unpacked variable H is never used
Unpacked variable S is never used
00bf965 to
8311db1
Compare
Dewei-Wang-sh
left a comment
There was a problem hiding this comment.
can you make it 2 PRs?
first, specify the original porting files
second, add our gfx950 optimization.
sure |
055a754 to
586ac07
Compare
586ac07 to
41d7936
Compare
1750a5a to
d639aad
Compare
…rd pass Ported from flash-linear-attention v0.5.2 Co-Authored-By: Claude Opus 4.6 <[email protected]>
d639aad to
99ad604
Compare
Dewei-Wang-sh
left a comment
There was a problem hiding this comment.
overall lgtm, but need to specifiy
- what is the original source and commit id
- does it pass on gfx1250?
Motivation
Add
chunk_delta_attn(chunked delta-attention operator with gated recurrence) as a first-class Triton op in aiter.Technical Details
Triton dispatch layer (
aiter/ops/triton/_triton_kernels/chunk_delta_attn/) ported from flash-linear-attention v0.5.2 commit 9c8e42e.chunk_fwd.py— top-level entry pointgate.py— beta sigmoid preprocessingintra_attn.py— intra-chunk attention (sub-chunk diagonal + inter-solve + W/U recompute)wy_fast.py— recompute W and U tensors from Akk inversegla_output.py— GLA output computationutils/cumsum.py— fused gate + chunk-local prefix sumutils/index.py— variable-length sequence chunk index preparationutils/l2norm.py— L2 normalization (forward only)utils/utils.py— shared constants, autotune helpers,input_guarddecoratorTest Plan
Test Result
All correctness tests pass (bfloat16, atol=1e-2, rtol=1e-2). KDA E2E Precision verification passed on GFX1250/GFX950 with Triton 3.7.0 + commit efbae9a33c.
AMD MI350X: