[AMD] Fp8 prefill integration with radix cache path for dpsk models#20187
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request extends the functionality of FP8 prefill attention to include the radix-cache path for dpsk models, addressing a previous limitation. By integrating this capability and optimizing the K/V generation process with a fused GEMM operation, the changes aim to enhance the overall efficiency and performance of the attention mechanism, leading to faster inference speeds. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request integrates Fp8 prefill with the radix cache path for dpsk models, which is a valuable performance enhancement. The changes are well-structured, primarily involving the addition of a new mla_fp8_prefill_attn function by refactoring existing code and extending it to handle the radix cache path. A new optimization for MXFP4 weights using a fused kernel is also introduced, which is a nice touch. The logic appears sound. I have one minor suggestion to improve code conciseness.
|
/tag-and-rerun-ci |
|
@1am9trash Let's extend fp8 prefill attention to (in follow-up PRs):
|
Motivation
Previously, fp8 prefill attention on dpsk models did not cover the radix-cache path.
Modifications
This PR enables fp8 prefill attention for the radix-cache path.
To reduce extra element-wise casts, it also uses
fused_gemm_afp4wfp4_split_cat, following the same design principle as the existing fp8 prefill path.(Not cover fp8 fused gemm yet.)
Accuracy Tests
Tested with radix-cache on/off and fp8/bf16 prefill.

Benchmarking and Profiling
Compared fp8 vs. bf16 prefill on dspk-r1-mxfp4 with 70k/200 and radix-cache on.
server cmd:
client cmd:
Speed on MI355 (cc=1-16):
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci