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

Add Pytorch Tensor Parallel support for Qwen2, Qwen2Moe, Starcoder2 #35007

Conversation

VladOS95-cyber
Copy link
Contributor

@VladOS95-cyber VladOS95-cyber commented Nov 28, 2024

What does this PR do?

This PR uses the torch.distributed.tensor.parallel subpackage to implement Tensor Parallel for Qwen2, Qwen2Moe, Starcoder2.
Fix qkv states dims for Mistral

Before submitting

Who can review?

@ArthurZucker

@VladOS95-cyber
Copy link
Contributor Author

Hey @ArthurZucker! This PR is ready for review, please, take a look.

@VladOS95-cyber VladOS95-cyber force-pushed the add-tensor-parallel-support-for-qwen2 branch 2 times, most recently from 2601f22 to 73d5df4 Compare November 29, 2024 12:05
@VladOS95-cyber
Copy link
Contributor Author

I think I should Fix Starcoder2 as well

@VladOS95-cyber VladOS95-cyber force-pushed the add-tensor-parallel-support-for-qwen2 branch from 73d5df4 to 6d6014e Compare November 29, 2024 17:25
@VladOS95-cyber VladOS95-cyber changed the title Add Pytorch Tensor Parallel support for Qwen2 and Qwen2Moe Add Pytorch Tensor Parallel support for Qwen2, Qwen2Moe, Starcoder2 Nov 29, 2024
@ArthurZucker
Copy link
Collaborator

Thanks, sorry a bit slow this week, reviewing asap!

@VladOS95-cyber VladOS95-cyber force-pushed the add-tensor-parallel-support-for-qwen2 branch from 8228ce7 to 7292f79 Compare December 2, 2024 11:12
@VladOS95-cyber VladOS95-cyber force-pushed the add-tensor-parallel-support-for-qwen2 branch from 7292f79 to 8da9c10 Compare December 4, 2024 07:42
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Lovely! Thanks for fixing and bringing more support!

@ArthurZucker ArthurZucker merged commit accb720 into huggingface:main Dec 4, 2024
2 of 4 checks passed
@ArthurZucker
Copy link
Collaborator

ArthurZucker commented Dec 4, 2024

Thanks @VladOS95-cyber 🤗

BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
…uggingface#35007)

* add base tp plan for qwen2 and qwen2moe

* add parallel tp for starcoder2

* fix modular conversion

* add infer dim for qkv states

* Update src/transformers/models/qwen2_moe/configuration_qwen2_moe.py

---------

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
…uggingface#35007)

* add base tp plan for qwen2 and qwen2moe

* add parallel tp for starcoder2

* fix modular conversion

* add infer dim for qkv states

* Update src/transformers/models/qwen2_moe/configuration_qwen2_moe.py

---------

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
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.

2 participants