Skip to content

(WIP) DeepseekV3 (and Multi-Head Latent Attention) #2012

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

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

ysjprojects
Copy link
Contributor

@ysjprojects ysjprojects commented Apr 13, 2025

follow up from #1945

More alignment with the huggingface implementation, allowing custom values for q_lora_rank, v_dim, etc.
Cleaned up some lines added for debugging purposes.

Also, the errors in #1945 was simply because pythia simply did not have the necessary parameters for MLA.

Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

let's add a test :)

Copy link
Contributor

@ali-alshaar7 ali-alshaar7 left a comment

Choose a reason for hiding this comment

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

Looks good overall. +1 on the test though, and would be nice if we could share more with the base attention implementation instead of duplicating things. Maybe for a followup. Thank you.

@Borda
Copy link
Member

Borda commented Apr 23, 2025

@t-vi @lantiga mind have look, pls :)

@ysjprojects ysjprojects changed the title Multi-head Latent Attention fixes DeepseekV3 (and Multi-Head Latent Attention) May 16, 2025
@ysjprojects ysjprojects changed the title DeepseekV3 (and Multi-Head Latent Attention) (WIP) DeepseekV3 (and Multi-Head Latent Attention) May 16, 2025
@ysjprojects
Copy link
Contributor Author

@t-vi @lantiga @Borda

DeepseekV3 architecture WIP.

Should we move DeepseekV3MoE and MultiHeadLatentAttention out of model.py into its own file since the architecture is quite unique so it's unlikely that a future model would implement it again?

@ysjprojects ysjprojects marked this pull request as draft May 21, 2025 12:52
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.

4 participants