Skip to content

Conversation

@yzh119
Copy link
Collaborator

@yzh119 yzh119 commented Feb 27, 2025

We use f32 as split-k partial output data type, mainly for accuracy concern.
However, the official FlashMLA implementation uses 16-bit partial data type, so I guess 16bit split-k is enough for production.
This PR changes flashinfer mla implementation's intermediate data type to 16bit.

This is the third piece (4 in total) of split-k related optimizations.

@yzh119 yzh119 merged commit e4a68e4 into main Feb 27, 2025
@muoshuosha
Copy link
Contributor

If the input and output are bf16, is the accuracy still sufficient without using fp32 for partial output?

@zhyncs zhyncs deleted the mla-16bit-splitk branch February 27, 2025 16:38
@yzh119
Copy link
Collaborator Author

yzh119 commented Feb 27, 2025

Hi @muoshuosha FlashMLA official implementation uses bf16 as partial output, when inputs and outputs are bf16. Here we just align with the official design.

@yzh119
Copy link
Collaborator Author

yzh119 commented Mar 4, 2025

As pointed out by @beginlner, flashmla uses f32 as intermediate output data type. We should make the partial O dtype a template parameter.

MasterJH5574 added a commit to MasterJH5574/flashinfer that referenced this pull request Mar 13, 2025
This PR applies changes in flashinfer-ai#898 and flashinfer-ai#900 to the MLA TVM binding.
yzh119 pushed a commit that referenced this pull request Mar 13, 2025
This PR applies changes in #898 and #900 to the MLA TVM binding.
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.

3 participants