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

[Model] Add support for DeepSeek-V2 Model #2972

Merged
merged 3 commits into from
Oct 13, 2024

Conversation

rickzx
Copy link
Contributor

@rickzx rickzx commented Oct 11, 2024

This PR implements the DeepSeek-V2 Model architecture: https://huggingface.co/deepseek-ai/DeepSeek-V2-Lite/blob/main/modeling_deepseek.py.

The notable changes from the common LLM architecture includes:

  • Multihead Latent Attention (MLA)
  • Yarn Rotary Positional Embeddings
  • DeepSeekMoE

Example execution on M2 ultra:

% mlc_llm chat ../models/DeepSeek-V2-Lite-Chat-MLC-q0f16 --model-lib ../models/DeepSeek-V2-Lite-Chat-MLC-q
0f16/model.dylib
>>> who are you?
 I am an AI assistant created by DeepSeek to be helpful and harmless.

TODO:

  • Currently the model architecture only supports Deepseek-V2-Lite. To support Deepseek-V2, we also need to support the group_limited_greedy strategy.
  • Support tensor parallel > 1.

@rickzx rickzx force-pushed the rick/pr-deepseek-v2 branch 2 times, most recently from 4d888d2 to 1cfc4d2 Compare October 12, 2024 04:34
@MasterJH5574 MasterJH5574 merged commit 436e189 into mlc-ai:main Oct 13, 2024
2 checks passed
@fengyang95
Copy link

fengyang95 commented Oct 14, 2024

Hello @rickzx , I noticed that the PR has been merged, and I wanted to ask if the todo items mentioned have been completed. Is support now available for deepseek-v2 (not the lite version)?

@rickzx
Copy link
Contributor Author

rickzx commented Oct 14, 2024

Hello @rickzx , I noticed that the PR has been merged, and I wanted to ask if the todo items mentioned have been completed. Is support now available for deepseek-v2 (not the lite version)?

Hi @fengyang95, the TODO items mentioned above hasn't been completed yet. I plan to finish those items asap, hopefully by end of week. The non-lite version is not supported with the current version

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.

3 participants