Skip to content

Conversation

Yard1
Copy link
Contributor

@Yard1 Yard1 commented Apr 27, 2022

What does this PR do?

If a scalar tensor is passed to distributed_concat, the output tensors are correctly converted to one element vectors. However, this is not done for the tensor itself, which causes an exception to be thrown in dist.all_gather due to a tensor length mismatch. This PR fixes that.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

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.

@Yard1
Copy link
Contributor Author

Yard1 commented Apr 27, 2022

cc @sgugger

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 fixing this! Just left some suggestion to make the code simpler.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 27, 2022

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

@sgugger sgugger merged commit 5896b3e into huggingface:main Apr 27, 2022
@Yard1 Yard1 deleted the patch-1 branch April 27, 2022 14:42
chamidullinr pushed a commit to chamidullinr/transformers that referenced this pull request Apr 28, 2022
* Fix `distributed_concat` with scalar tensor

* Update trainer_pt_utils.py
elusenji pushed a commit to elusenji/transformers that referenced this pull request Jun 12, 2022
* Fix `distributed_concat` with scalar tensor

* Update trainer_pt_utils.py
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