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

Update modeling_opt.py #22868

Closed
wants to merge 2 commits into from
Closed

Update modeling_opt.py #22868

wants to merge 2 commits into from

Conversation

sushmanthreddy
Copy link
Contributor

@sushmanthreddy sushmanthreddy commented Apr 19, 2023

What does this PR do?

As suggested in the #22561 ,moved labels to the same device as logits for OTP , codegen and gptj

@sgugger can u pls review this once??

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 19, 2023

The documentation is not available anymore as the PR was closed or merged.

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.

Thanks for your PR! I left a comment.

Comment on lines +957 to +958
# move labels to correct device to enable model parallelism
labels = labels.to(logits.device)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be done before the shift_labels are defined or it won't work.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

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.

None yet

3 participants