Added cosmos3 model - #46146
Conversation
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
|
Converting to draft for now until we decide on the final checkpoint format |
zucchini-nlp
left a comment
There was a problem hiding this comment.
I am not sure if we need a whole new model for it since the arch is identical to qwen3-vl from what I see. The only diff seems to be the conversion mapping and keys_to_ignore_at_load, for which I added questions below
Since you are still deciding on ckpt, maybe we could release it by re-using a qwen3-vl model. WDYT?
Signed-off-by: Maciej Bala <mbala@nvidia.com>
|
The code works now with the planned Cosmos3 checkpoint format, reopening for review. |
Signed-off-by: Maciej Bala <mbala@nvidia.com>
zucchini-nlp
left a comment
There was a problem hiding this comment.
Nice, let's merge after addressing a few nitty-picky comments :)
|
Btw, we reverted some bigger PR, need to sync with main for the CI to pass again |
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: Maciej Bala <mbala@nvidia.com>
Signed-off-by: MaciejBalaNV <mbala@nvidia.com>
|
run-slow: cosmos3_omni |
|
This comment contains models: ["models/cosmos3_omni"] |
|
run-slow: cosmos3_omni |
|
This comment contains models: ["models/cosmos3_omni"] |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, cosmos3_omni, qwen3_5, qwen3_5_moe, qwen3_omni_moe, qwen3_vl, qwen3_vl_moe |
|
run-slow: cosmos3_omni |
|
This comment contains models: ["models/cosmos3_omni"] |
|
Thanks god, slow CI decided to turn green. Merging... |
i don't think it's relevant, ping me if you want me to force merge. |
|
Yep, the CI is fine, it's just me. The model has sampling on by default and I didn't get at first why the CI keeps complaining after I adjust expectations with runners 😅 |
* Added cosmos3 model Signed-off-by: Maciej Bala <mbala@nvidia.com> * bugfix for processing_utils.py Signed-off-by: Maciej Bala <mbala@nvidia.com> * Add extra tests * Rename architecture; linter fixes Signed-off-by: Maciej Bala <mbala@nvidia.com> * Rename the architecture again for now Signed-off-by: Maciej Bala <mbala@nvidia.com> * Adapted to new Cosmos3 checkpoint format * Improve the checkpoint loading Signed-off-by: Maciej Bala <mbala@nvidia.com> * Simplified docs Signed-off-by: Maciej Bala <mbala@nvidia.com> * Renamed cosmos3 to cosmos3_reasoner Signed-off-by: Maciej Bala <mbala@nvidia.com> * Removed cosmos3 tests Signed-off-by: Maciej Bala <mbala@nvidia.com> * Revert processing fix Signed-off-by: Maciej Bala <mbala@nvidia.com> * Answered review comments Signed-off-by: Maciej Bala <mbala@nvidia.com> * Rename to Cosmos3ReasonerForConditionalGeneration Signed-off-by: Maciej Bala <mbala@nvidia.com> * Renamed config key Signed-off-by: Maciej Bala <mbala@nvidia.com> * Run make fix-repo Signed-off-by: Maciej Bala <mbala@nvidia.com> * Refactored naming Signed-off-by: Maciej Bala <mbala@nvidia.com> * Some more renaming; fix linter issues; Add Cosmos3 Processor Signed-off-by: MaciejBalaNV <mbala@nvidia.com> * Linter fixes Signed-off-by: MaciejBalaNV <mbala@nvidia.com> * Multiple fixes Signed-off-by: Maciej Bala <mbala@nvidia.com> * fix test and linter Signed-off-by: Maciej Bala <mbala@nvidia.com> * Make fix-repo fixes Signed-off-by: Maciej Bala <mbala@nvidia.com> * Linter fix Signed-off-by: Maciej Bala <mbala@nvidia.com> * Change date Signed-off-by: Maciej Bala <mbala@nvidia.com> * rename it all and load existing AutoModel * docs * fix repo * fix docs * ugly typo * adjust expectation * dont sample in test! * forgot this one * style --------- Signed-off-by: Maciej Bala <mbala@nvidia.com> Signed-off-by: MaciejBalaNV <mbala@nvidia.com> Co-authored-by: raushan <raushan@huggingface.co>
After the transformer PR was merged for Reasoner-only here: huggingface/transformers#46146, I'm updating the cosmos docs to reflect this change. Also made some small updates for vllm, like installing 0.23 version, which is the first one with Cosmos Reasoner-only support. --------- Signed-off-by: Maciej Bala <mbala@nvidia.com>
What does this PR do?
This PR adds a support for Cosmos3 Reasoner model (not released yet). It's a Mixture Of Transformers model, where we have a Generator and a Reasoner tower in a unified checkpoint. The Reasoner tower has Qwen3-VL architecture, so we can directly reuse it. However, we need extra code to handle the checkpoint mapping, since the final checkpoint will be in a unified Reasoner+Generator diffusers format.
Additionally, this PR fixes one issue which currently is present on top of tree - when using latest vllm and latest transformers build from source, even basic
vllm serve Qwen/Qwen3-VL-8B-Instructfails during dummy run. This root-cause of the bug is this commit:ba06e3fbdf355c363ac067ebcda210017e90a852, reverting it also fixes Qwen-VL.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.
@yonigozlan for a vision model review