-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Deepseek V3.2] Change indexer weights_proj to fp32 #13459
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @hlu1, 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 refines the Deepseek V3.2 model's Highlights
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
|
c8c3632 to
7d23e01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request changes the precision of the weights_proj layer in the NSA indexer to fp32 from bf16. This change aligns with an update in the original DeepSeek-V3.2 repository. As a consequence, the fuse_wk_and_weights_proj optimization is no longer valid due to a type mismatch and has been cleanly removed from the codebase. The necessary input casting to float() for the weights_proj layer has been correctly added. Additionally, the documentation is updated with new accuracy results for gsm8k and aime 2025. My review includes a couple of minor suggestions for the documentation to improve clarity and fix a typo.
5aa0046 to
b5a0096
Compare
b5a0096 to
d7564d3
Compare
d7564d3 to
11c7304
Compare
|
|
||
| if not self.fuse_wk_and_weights_proj: | ||
| weights, _ = self.weights_proj(x) | ||
| weights, _ = self.weights_proj(x.float()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this gemm was orignally in the _get_logits_head_gate() function.
Motivation
Following deepseek-ai/DeepSeek-V3.2-Exp@8631a81, change the indexer
weights_projprecision from bf16 to fp32.#13439 fixed the rope issue.
Modifications
weights_projprecision from bf16 to fp32fuse_wk_and_weights_projoptimization is no longer valid after the fix because thewkprecision is bf16 andweights_projprecision is fp32. Remove it from the code base.Accuracy Tests
See updated doc in PR
Benchmarking and Profiling
Checklist