-
Notifications
You must be signed in to change notification settings - Fork 11.6k
llama : add Xiaomi Mimo (with proper MTP - multi token predict) #13236
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: master
Are you sure you want to change the base?
Conversation
Would this implementation work on deepseev3? |
@sorasoras Judging from this illustration, yes it's the same: https://dataturbo.medium.com/deepseek-technical-analysis-3-multi-token-prediction-f8f3ea7eaf9c ![]() |
Maybe this can be implemented by loading the MTP layers as a separate draft model and reusing the speculative decoding functionality. AFAICT, the predicted tokens from the MTP blocks are technically draft tokens and they have to be accepted by the main decoder. Btw, based on these 2 diagrams, if they are correct, there is a small difference between DS and Mimo - Mimo uses the same What is not clear to me is how big is |
Ok thanks for the clue, it sounds like what you suggest is exactly what they did on vLLM implementation I think the N is not important as the MTP layer has its own KV cache. The number of N token need to be corresponse to the number of embedding vectors from |
I'm thinking more about the implementation today, having 2 main ideas in my mind but both have downsides: First idea is to have an API like The downside is that:
My second idea is to have something equivalent to |
This is a WIP,
Given N input token, I can now generate either the next N+1 or N+2, but not yet all the 2 tokens at the same time.
The way it works is:
If we had an API for multiple output head, it might have been easier. WDYT @ggerganov ?
Illustration from their technical report: