- Add apply_swa_mask flag to FmhaKernel constructor - After TMEM load of S, use tTMEM_LOADcS coordinates to map register fragment positions to (row, col) in QK matrix - Mask positions >= swa_lens[batch_idx] to -inf before softmax - Supports multi-KV-tile (kt*128 + k_coord for absolute position) - swa_lens parameter passed as CuTe tensor, indexed by block_idx_z - Dummy tensor (max int) when swa_lens=None (no masking) - New test: test_d3_inkernel_mask.py with proper in-kernel masking - Replaces pre-masking approach (BF16 min on K) which can't produce -inf
9.5 KiB
9.5 KiB