Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use f16 as split-k partial output data type #900

Merged
merged 8 commits into from
Feb 27, 2025
Merged

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.

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.

2 participants