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 Mistral #34927

Conversation

VladOS95-cyber
Copy link
Contributor

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

What does this PR do?

This PR uses the torch.distributed.tensor.parallel subpackage to implement Tensor Parallel for Mistral.

Fixes # (issue)

Before submitting

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.

@Rocketknight1
Copy link
Member

cc @ArthurZucker since I think he was handling the tensor parallelism issue - let me know if I should have pinged someone else instead!

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.

LGTM thanks for adding! 🤗

@ArthurZucker ArthurZucker merged commit 1141eff into huggingface:main Nov 26, 2024
15 checks passed
@DebarshiChanda
Copy link

@VladOS95-cyber @ArthurZucker Hi guys, I had a small doubt. Why aren't the changes in the query_states, key_states and value_states applied to other attention classes (like MistralFlashAttention2, MistralSdpaAttention) as well?

@VladOS95-cyber
Copy link
Contributor Author

@VladOS95-cyber @ArthurZucker Hi guys, I had a small doubt. Why aren't the changes in the query_states, key_states and value_states applied to other attention classes (like MistralFlashAttention2, MistralSdpaAttention) as well?

Hey @DebarshiChanda! Thanks for noticed that, i think you are right and we should apply the same infer logic for other attention classes. I am going to fix it in another PR #35007

BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants