[HIP] flash SWA GQA decode kernel — Inkling attention parity (window+relpos+sink+gate)
- k_flash_swa_gqa_decode / vetta_flash_swa_gqa_decode: exact strata
k3_flash_swa_gqa semantics on a contiguous f32 KV cache:
* SWA window: k_start = (window>0 && cur_pos>=window) ? cur_pos-window+1 : 0;
* relpos bias rel_bias[h,dist] added to the score (dist=cur_pos-s, <max_rel);
* attention sink_logit[h]: virtual sink token (value 0) contributing
exp(sink-m) to the softmax denominator only;
* sigmoid gate_attn[h,d] applied per output dim.
Two-pass softmax over the windowed range, f32 throughout. rel_bias /
sink_logit / gate are optional (NULL disables each).
- Parity test vs a CPU oracle across 4 configs (window on/off x relpos x sink
x gate): max_rel_err 9.4e-7 .. 3.6e-6. The Inkling-specific attention math
(local window, relative position, sink, gate) is verified.
With ShortConv4, this covers the defining Inkling attention mechanisms; the
AttnRes block-mix deep residual is the remaining parity piece.
Verified: RUSTFLAGS="-D warnings" cargo test --workspace = 97/97 PASS;
lean proofs (4 files, 42 theorems) green; GPU 12/12 (--features hip).