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

[C10D] Add __repr__ to P2POp class #126538

Closed
wants to merge 2 commits into from

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented May 17, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/126538

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 3f99204 with merge base failed to retrieve merge base, please contact dev infra:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category labels May 17, 2024
@wconstab
Copy link
Contributor Author

Wonder whether folks prefer local ranks or global ranks for src/dsc

I went with local since i thought its helpful to print the PG too and if you print the PG and then print global ranks its confusing. Also, the log-prefix for each log line usually shows the global rank, so you get both pieces of info. And local rank is more 'helpful' in some cases (stage 0 is local rank 0, for PP)

otoh our APIs are confusing, and they ask you to specify a PG and also specify global ranks, so maybe printing global ranks is most consistent.

@wconstab wconstab requested review from kwen2501 and H-Huang May 17, 2024 15:08
Copy link
Contributor

@kwen2501 kwen2501 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 it!

[ghstack-poisoned]
else:
return super().__repr__()

return f"P2POp({op_name} pg={group_name}, s={s}, d={d}, {self.tensor.shape}, {self.tensor.dtype})"
Copy link
Contributor

@c-p-i-o c-p-i-o May 17, 2024

Choose a reason for hiding this comment

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

Print the tag too if it exists?
Don't know how/when it's used - but might be useful?

tag (int, optional): Tag to match send with recv.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea.... actually NCCL doesn't even support tag. So i would print it out of 'completeness' or compatibility with Gloo, but i think nobody is using tag anyway and we should probably deprecate it.

@wconstab
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 17, 2024
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants