Skip to content

Add Qwen2MoE#29377

Merged
ArthurZucker merged 46 commits into
huggingface:mainfrom
bozheng-hit:qwen2_moe
Mar 27, 2024
Merged

Add Qwen2MoE#29377
ArthurZucker merged 46 commits into
huggingface:mainfrom
bozheng-hit:qwen2_moe

Conversation

@bozheng-hit

@bozheng-hit bozheng-hit commented Feb 29, 2024

Copy link
Copy Markdown
Contributor

Adding Qwen2MoE

This PR adds the support of codes for the coming Qwen2MoE models. For information about Qwen, please visit https://github.com/QwenLM/Qwen. @ArthurZucker

@ArthurZucker ArthurZucker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a few small comments for a small review for now!

Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
@bozheng-hit
bozheng-hit requested a review from ArthurZucker March 2, 2024 03:24
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ArthurZucker ArthurZucker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Overall alright, I think one thing we need to be careful about is to test in the terst_modeling_qwen2_moe when there are sparse and non sparse. The loss needs to ignore None router logits!

Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
@bozheng-hit
bozheng-hit requested a review from ArthurZucker March 9, 2024 20:39
@JustinLin610

Copy link
Copy Markdown
Contributor

Hey, I guess our update of the testing solves the issues mentioned. Take another look?

@ArthurZucker ArthurZucker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM Almost not comment, I'll do another full review tomorrow but it is pretty much mergable ! 🔥

Mostly using the latest api would be nice for cache_positions in the Model, but it's really optional!

Comment thread README.md Outdated
Comment thread docs/source/en/model_doc/qwen2_moe.md
Comment thread docs/source/en/model_doc/qwen2_moe.md
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py Outdated
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py
Comment thread src/transformers/models/qwen2_moe/modeling_qwen2_moe.py
bozheng-hit and others added 2 commits March 21, 2024 23:27
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
@bozheng-hit

Copy link
Copy Markdown
Contributor Author

@ArthurZucker Hi, I have rebased our branch and solved all the conflicts. I think the codes are ready to be merged now.

@ArthurZucker

Copy link
Copy Markdown
Collaborator

Thanks for your efforts! merging 🥳

@ArthurZucker
ArthurZucker merged commit 1c39974 into huggingface:main Mar 27, 2024
@ydshieh

ydshieh commented Mar 27, 2024

Copy link
Copy Markdown
Collaborator

Hi @bozheng-hit

Thank you for adding this model 🚀

I see Qwen/Qwen1.5-MoE-A2.7B is used in the tests, but I could not find it on the Hub. See

https://huggingface.co/models?search=Qwen1.5-MoE

Could you check this, open a PR to make some necessary updates, and make sure the integration tests pass by running

RUN_SLOW=1 TF_FORCE_GPU_ALLOW_GROWTH=yes python3 -m pytest -v tests/models/qwen2_moe

Thank you in advance

@lucasjinreal

Copy link
Copy Markdown

Didn't saw Qwen/Qwen1.5-MoE-A2.7B anywhere, time estimation on new model release?

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.

6 participants