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

Fix beam search generation for GPT2 and T5 on model parallelism #9219

Conversation

TobiasNorlund
Copy link
Contributor

What does this PR do?

This PR fixes beam search generation crash when the model layers are distributed on several devices (model parallelism). I have also added a test which showcase the bug on master and pass with the provided fix. Fixes issue #9200

This is my first contribution to Transformers, so please let me know if something seems wrong or can be improved! The added test doesn't actually test anything at the moment, just raises an error on master. Looking forward to some feedback on how you'd like to see that.

Before submitting

Who can review?

@LysandreJik
@alexorona
@patrickvonplaten

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Looks good to me - thanks for adding the test!

@patrickvonplaten
Copy link
Contributor

@sgugger can you maybe review as well and merge if ok?

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Very clean, thanks for adding the new test!

@sgugger sgugger merged commit 08abdab into huggingface:master Dec 21, 2020
thevasudevgupta pushed a commit to thevasudevgupta/transformers that referenced this pull request Dec 23, 2020
guyrosin pushed a commit to guyrosin/transformers that referenced this pull request Jan 15, 2021
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.

3 participants