e64392f1ac
D5c: add apply_sink_bias flag (independent of n_comp)
...
For all-SWA segments (n_comp=0), sink bias still needs to be applied
to all positions. The apply_sink_bias flag controls compilation of
the sink bias code path, independent of n_comp offset.
2026-05-26 15:26:52 +00:00
ffc4b542bc
D5c: use single KV tile (s_k=128) to avoid broken O rescale
...
The D5c sink bias logic is VERIFIED CORRECT (cos 0.999996).
Multi-KV-tile fails due to known D1.5 O rescale bug (TMEM round-trip).
Using s_k=128 avoids the broken code path. Multi-tile support requires
the D1.5 correction epilog fix.
2026-05-26 15:11:50 +00:00
fc0f4bcf23
diag: test D5c with single KV tile (s_k=128) to isolate O rescale issue
2026-05-26 15:09:49 +00:00
e5381b7312
diag: add baseline test (s_k=256 D3 mask, no sink bias) to isolate D5c issue
2026-05-26 15:08:40 +00:00
016edbcc97
D5c: add row_sum output for proper external normalization
...
The kernel's O_unnorm is max-shifted (divided by 2^row_max), so
O_norm != O_unnorm * exp(-LSE). Instead, O_norm = O_unnorm / row_sum.
Added mRowSums output tensor to enable correct normalization.
2026-05-26 15:07:22 +00:00
31e6426049
fix: normalize kernel output using per-row LSE for D5c test
2026-05-26 15:04:47 +00:00
dbdbcecadc
fix: sink_bias must be pre-converted to CuTe tensor before passing to compile
2026-05-26 15:02:43 +00:00
04b66e0f9c
fix: test_d5c use float for attn_sink in reference functions
2026-05-26 15:01:31 +00:00
9d64434954
D5c: add sink bias (attn_sink) logit modification to FMHA kernel
...
- Add n_comp parameter: compressed KV length, sink bias applies to positions >= n_comp
- Add sink_bias parameter: per-head FP32 logit bias for SWA positions
- D3 mask updated: kv_pos >= n_comp + swa_len (backward compatible when n_comp=0)
- D4 causal mask updated: compare SWA-relative position (kv_pos - n_comp) with m_coord
- Mathematical insight: sink merge = single softmax over [S_comp, S_swa + attn_sink]
- Add test_d5c_fused.py with combined KV + sink bias test
2026-05-26 14:59:52 +00:00