Skip to content

[c10d] Make reduce as a custom op#79686

Closed
alanwaketan wants to merge 2 commits intogh/alanwaketan/37/basefrom
gh/alanwaketan/37/head
Closed

[c10d] Make reduce as a custom op#79686
alanwaketan wants to merge 2 commits intogh/alanwaketan/37/basefrom
gh/alanwaketan/37/head

Conversation

@alanwaketan
Copy link
Copy Markdown
Collaborator

@alanwaketan alanwaketan commented Jun 16, 2022

Stack from ghstack (oldest at bottom):

Summary:
This patch makes reduce as a custom op such that it's dispatcher
passable. It's one part of the effort to route comm ops to the dispatcher
such that tracing mechanisms that relies on the dispatcher can trace them,
e.g., LazyTensor and AOTAutograd.

Test Plan:
python test/distributed/test_c10d_nccl.py -k test_reduce_ops
python test/distributed/test_c10d_gloo.py -k test_reduce_basics
...and other existing distributed tests.

Summary:
This patch makes reduce as a custom op such that it's dispatcher
passable. It's one part of the effort to route comm ops to the dispatcher
such that tracing mechanisms that relies on the dispatcher can trace them,
e.g., LazyTensor and AOTAutograd.

Test Plan:
python test/distributed/test_c10d_nccl.py -k test_reduce_ops
python test/distributed/test_c10d_gloo.py -k test_reduce_basics
...and other existing distributed tests.

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Jun 16, 2022

🔗 Helpful links

✅ No Failures (0 Pending)

As of commit 38f90ce (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot facebook-github-bot added the oncall: distributed Add this issue/PR to distributed oncall triage queue label Jun 16, 2022
alanwaketan pushed a commit that referenced this pull request Jun 16, 2022
Summary:
This patch makes reduce as a custom op such that it's dispatcher
passable. It's one part of the effort to route comm ops to the dispatcher
such that tracing mechanisms that relies on the dispatcher can trace them,
e.g., LazyTensor and AOTAutograd.

Test Plan:
python test/distributed/test_c10d_nccl.py -k test_reduce_ops
python test/distributed/test_c10d_gloo.py -k test_reduce_basics
...and other existing distributed tests.

ghstack-source-id: 6386217
Pull Request resolved: #79686
Summary:
This patch makes reduce as a custom op such that it's dispatcher
passable. It's one part of the effort to route comm ops to the dispatcher
such that tracing mechanisms that relies on the dispatcher can trace them,
e.g., LazyTensor and AOTAutograd.

Test Plan:
python test/distributed/test_c10d_nccl.py -k test_reduce_ops
python test/distributed/test_c10d_gloo.py -k test_reduce_basics
...and other existing distributed tests.

[ghstack-poisoned]
Copy link
Copy Markdown
Contributor

@mrshenli mrshenli left a comment

Choose a reason for hiding this comment

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

LGTM

.def(
"reduce",
[](::c10d::ProcessGroup& pg,
[](const c10::intrusive_ptr<::c10d::ProcessGroup>& pg,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto on naming

Copy link
Copy Markdown
Collaborator Author

@alanwaketan alanwaketan Jun 24, 2022

Choose a reason for hiding this comment

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

Let me follow up on #80246.

@alanwaketan
Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Copy Markdown
Contributor

Hey @alanwaketan.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

facebook-github-bot pushed a commit that referenced this pull request Jun 27, 2022
Summary:
This patch makes reduce as a custom op such that it's dispatcher
passable. It's one part of the effort to route comm ops to the dispatcher
such that tracing mechanisms that relies on the dispatcher can trace them,
e.g., LazyTensor and AOTAutograd.

Pull Request resolved: #79686
Approved by: https://github.com/mrshenli

Test Plan:
contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/3367e632b2613bfd26bee8b8d74951b791687346

Test plan from GitHub:
python test/distributed/test_c10d_nccl.py -k test_reduce_ops
python test/distributed/test_c10d_gloo.py -k test_reduce_basics
...and other existing distributed tests.

Reviewed By: atalman

Differential Revision: D37455697

Pulled By: alanwaketan

fbshipit-source-id: a0167adecf6d044c0fa503a3fd5379b169ce0c63
@facebook-github-bot facebook-github-bot deleted the gh/alanwaketan/37/head branch June 28, 2022 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category topic: new features topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants