Skip to content

Conversation

mingyangHao
Copy link

Hi,

Currently in your sparse prefill kernel, you validate the indices with two conditions: t >= 0 && t < params.s_kv.
Thats a bit redundant, because in real world scenarios it make more sense to pad it with -1. In addition, the generation and validation of indices should be done by indexer, not mla.
In your test_prefill when topk<indices, you cat 2147480000 to indices. If you change it to -1, you can save the comparation of && t < params.s_kv.

@mingyangHao mingyangHao changed the title Change invalid indices mask to -1 to save some cmp instrcutions Change invalid indices mask to -1 to save some cmp insts Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant