Add Xiaomi MiMo-V2#45144
Conversation
Important points:fixed in: #45441
|
|
Will try to take a look, likely next week after torch conference. Bad timing with holidays + conference sorry 😢 appreciate the work tho, just as a heads up that things are a bit delayed |
Ah true, np, I understand. Thanks for letting me know. |
vasqu
left a comment
There was a problem hiding this comment.
Some initial comments: I think the biggest point is re attention I'd rather disable the attention types than to support all these paths - it gets too messy
|
Feel free to ping me when it's ready for another review 🤗 |
|
Updated with the recent changes, CI should be good now? Not sure that Mistral tokenizer failure is related. Ye that's disappointing, even the V2.5 follows the same old config patterns. In any case you can ping me anytime, if you have any news I'll do a follow-up if need be @vasqu thanks again. |
|
run-slow: mimo_v2_flash |
|
@casinca just moved/copied the dummy model to internal testing, sanity checking with run slow but then merging 🤗 |
|
This comment contains models: ["models/mimo_v2_flash"] |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, mimo_v2_flash |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, mimo_v2_flash |
CI recapDashboard: View test results in Grafana |
|
Congrats on the merge !! 🤗 This was super annoying, CI being flaky and all... |
What does this PR do?
Hello, this PR aims to add the MiMo-V2-Flash model to the Transformers library
Fixes #42954
MiMo-V2 is "The last of the OSS SOTAs" that isn't natively supported by the Transformers library (besides Kimi), so I hope we can make this work.
Code Agent Policy
The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.
PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.
This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read
CONTRIBUTING.md.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
Only pinging HF engineers who were involved in the PRs mentioned below:
Modular Sensei @vasqu , I took your comments from the other PR, to find the best candidates to inherit from. Although see #45144 (comment) for some important points.
@ArthurZucker for gpt-oss similarity and text model
For reference, there were already 2 previous PRs (1 closed and 1 non modular/abandoned):
Afaik, MiMo in the codebase is a bit novel as it's the only hybrid SWA that combines both dual theta RoPE and dual head
dims + attn sinks (like gpt-oss). Most similar models are either one or the other, but not both.
So modularity wasn't easy mode pass, pass, pass.
I added some verbose NOTES for context/choices, and make the review easier. I'll obviously remove these once things are settled.
Additional useful info
(copy pasta from my own readme impl)
sqrt(hidden_size / (num_attention_heads * v_head_dim))