-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support deepseek prefill attention shape (#765)
Deepseek requires `head_dim_qk` of 192 and `head_dim_vo` of 128, this PR implements this feature for prefill attention on ragged tensors. (we can also also support paged kv-cache but it's not emergent, because we only use `head_dim_qk=192, head_dim_vo=128` for ragged tensor in DeepSeek MLA w/o matrix absorption, and we need another MQA kernel with `head_dim_qk=576, head_dim_vo=512` for Deepseek MLA w/ matrix absorption, I'll upstream that kernel in the next PR) ## Checklist - [x] Make FA3 template compatible with deepseek model shape - [x] Make FA2 template compatible with deepseek model shape - [x] Fix AOT compilation scripts - [x] Fix C++ tests/benchmarks ## Changes to the programming interface We added an optional field `num_heads_vo` in the `plan` function allowing user to specify different `num_heads_qk` and `num_heads_vo`: ```python wrapper.plan( ... num_heads_qk, num_heads_vo=num_heads_vo ... ) ```
- Loading branch information
Showing
66 changed files
with
1,428 additions
and
1,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.