KEMBAR78
[DTensor] dispatch to sharding prop over decomps by wconstab · Pull Request #159324 · pytorch/pytorch · GitHub
Skip to content

Conversation

@wconstab
Copy link
Contributor

@wconstab wconstab commented Jul 29, 2025

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 29, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit d175ad9 with merge base 1abff80 (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

@pytorch-bot pytorch-bot bot added ciflow/inductor oncall: distributed Add this issue/PR to distributed oncall triage queue labels Jul 29, 2025
wconstab added a commit that referenced this pull request Jul 29, 2025
Fixes #159110

ghstack-source-id: 39a25be
Pull Request resolved: #159324
Fixes #159110

cc H-Huang awgu wanchaol fegin fduwjj wz337 d4l3k pragupta

[ghstack-poisoned]
wconstab added a commit that referenced this pull request Jul 29, 2025
Fixes #159110

ghstack-source-id: 303e356
Pull Request resolved: #159324
@wconstab wconstab added the release notes: distributed (dtensor) release notes category label Jul 29, 2025
@eqy
Copy link
Collaborator

eqy commented Jul 29, 2025

Does that mean this needs to be updated if rms_norm will now go to the fused path?

expected_fwd_comm = 0 if shard_dim < norm_idx else 2

CC @AaronWang04

@AaronWang04
Copy link
Contributor

@eqy I didn't merge in sharding rule for forward pass of rms_norm since it never got triggered. Will add a PR for that and update the test after this gets merged

@wconstab
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 29, 2025
@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

@tianyu-l
Copy link
Contributor

@AaronWang04
I'm afraid this change will break torchtitan again.
So it'd be great if you could help with the forward op strategy soon.

@AaronWang04
Copy link
Contributor

AaronWang04 commented Jul 30, 2025

@tianyu-l I planned to add the forward op sharding strategy once this PR is stable. why would this change break torchtitan? I expect this change to be able to fall back on composite

yangw-dev pushed a commit that referenced this pull request Aug 1, 2025
pytorchmergebot pushed a commit that referenced this pull request Aug 12, 2025
Reduces collective calls in the forward pass from 2 to 1

In #158716 I added the sharding rule for the backward pass but didn't add the forward pass as it didn't get dispatched. After #159324 this should get properly dispatched hence I am adding it now.

Pull Request resolved: #159692
Approved by: https://github.com/tianyu-l
chuanhaozhuge pushed a commit that referenced this pull request Aug 14, 2025
Reduces collective calls in the forward pass from 2 to 1

In #158716 I added the sharding rule for the backward pass but didn't add the forward pass as it didn't get dispatched. After #159324 this should get properly dispatched hence I am adding it now.

Pull Request resolved: #159692
Approved by: https://github.com/tianyu-l
chuanhaozhuge pushed a commit that referenced this pull request Aug 18, 2025
Reduces collective calls in the forward pass from 2 to 1

In #158716 I added the sharding rule for the backward pass but didn't add the forward pass as it didn't get dispatched. After #159324 this should get properly dispatched hence I am adding it now.

Pull Request resolved: #159692
Approved by: https://github.com/tianyu-l
can-gaa-hou pushed a commit to can-gaa-hou/pytorch that referenced this pull request Aug 22, 2025
Reduces collective calls in the forward pass from 2 to 1

In pytorch#158716 I added the sharding rule for the backward pass but didn't add the forward pass as it didn't get dispatched. After pytorch#159324 this should get properly dispatched hence I am adding it now.

Pull Request resolved: pytorch#159692
Approved by: https://github.com/tianyu-l
@github-actions github-actions bot deleted the gh/wconstab/432/head branch August 30, 2025 02:07
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
Reduces collective calls in the forward pass from 2 to 1

In pytorch#158716 I added the sharding rule for the backward pass but didn't add the forward pass as it didn't get dispatched. After pytorch#159324 this should get properly dispatched hence I am adding it now.

Pull Request resolved: pytorch#159692
Approved by: https://github.com/tianyu-l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (dtensor) release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants