Skip to content

feat: add functional per-head FP8 quantization for FA3 #1033

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

Merged
merged 14 commits into from
Apr 29, 2025

Conversation

happierpig
Copy link
Collaborator

@happierpig happierpig commented Apr 23, 2025

This PR adds FP8 support in FA3 to speed up compute-bound prefill kernels. It follows up on #869.

1. Bug fixes

  • Fixed deadlock, illegal memory access, and wrong results for varied num_heads and seq_len.
  • Covered by unit tests.

2. New features

  • Enabled FP8 in-kernel transpose logic of mainloop_sparse.cuh.
  • FP8 now works in:
    • BatchPrefillWithPagedKVCache
    • BlockSparseAttentionWrapper: support sparse and quantized attention

3. Python JIT interface

Note: Performance is on par with #869. Need tuning.

cc @yzh119

@happierpig happierpig requested a review from yzh119 April 23, 2025 06:29
@happierpig happierpig changed the title misc: make python interface for SingleFP8PrefillWithKVCacheDispatched feat: add functional per-head FP8 quantization for FA3 Apr 24, 2025
Copy link
Collaborator

@yzh119 yzh119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @happierpig , great contribution!

@yzh119 yzh119 merged commit 116d97d into flashinfer-ai:main Apr 29, 2025
2 checks passed
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