Expand description
Gated NoPE MLA CPU ref. Do not reuse qwen3_attention blindly.
CUDA: super::mla_cuda (default; K3_CUDA_MLA=0 CPU).
Structs§
Functions§
- apply_
output_ gate - Apply
sigmoid(g) ⊙ attnwhen the output gate is on; otherwise identity. - cuda_
mla_ enabled - FullAttention BoundLayer uses CUDA
mla_decodeunlessK3_CUDA_MLA=0. Same polarity asK3_CUDA_KDA. Projections stay on the host either way. - gated_
mla_ attend - Gated NoPE attend: optionally skip RoPE, SDPA, optional output gate.
- maybe_
rope - Optional RoPE on the rope slice of a packed
[nope | rope]head. NoPE leavesq/kunchanged. - mla_
decode_ token - One decode token: optional RoPE, append K/V, SDPA, optional output gate.
Projections stay in
mla_mixer. CUDAk3_mla_*matches this order. - mla_
from - sdpa
- Causal scaled-dot-product attention.
q/k:[T, H, dq],v:[T, H, dv]. - sdpa_
one - Decode SDPA: one query
[H, dq]against cached K/V of lengtht.