Skip to content

Conversation

@SeanNaren
Copy link
Contributor

@SeanNaren SeanNaren commented Feb 17, 2021

What does this PR do?

Address's @Borda comment of adding a better docstring to the broadcast function in #6039

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@SeanNaren SeanNaren added the docs Documentation related label Feb 17, 2021
@SeanNaren SeanNaren self-assigned this Feb 17, 2021
The results of the last training/testing run will be cached within the training type plugin.
In distributed training, we make sure to transfer the results to the appropriate master process.
"""
# TODO: improve these docs
Copy link
Contributor

Choose a reason for hiding this comment

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

Improved enough already to remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like rando todos, so let me remove it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

my comment, but I don't remember what I wanted to improve 🤣

@Borda Borda enabled auto-merge (squash) February 18, 2021 00:02
def barrier(self, name: Optional[str] = None) -> None:
self.training_type_plugin.barrier(name=name)

def broadcast(self, obj: object, src: int = 0) -> object:
Copy link
Collaborator

Choose a reason for hiding this comment

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

shall we then rather call source_rank?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its called source in the lower level pytorch call that is commonly used outside of TPU/some training type plugin:

https://pytorch.org/docs/stable/distributed.html#torch.distributed.broadcast

So I think it might be alright to keep it as is!

Copy link
Contributor

Choose a reason for hiding this comment

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

I vote for keep :)

@codecov
Copy link

codecov bot commented Feb 18, 2021

Codecov Report

Merging #6044 (a6c51d5) into master (c9622ba) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #6044   +/-   ##
======================================
  Coverage      93%     93%           
======================================
  Files         160     160           
  Lines       11392   11397    +5     
======================================
+ Hits        10578   10590   +12     
+ Misses        814     807    -7     

@Borda Borda added the ready PRs ready to be merged label Feb 18, 2021
@Borda Borda merged commit b019c25 into master Feb 18, 2021
@Borda Borda deleted the feat/docstring_acc branch February 18, 2021 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related ready PRs ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants