Skip to content

[DTensor] Add single-dim registration infra#170359

Closed
wconstab wants to merge 8 commits intogh/wconstab/475/basefrom
gh/wconstab/475/head
Closed

[DTensor] Add single-dim registration infra#170359
wconstab wants to merge 8 commits intogh/wconstab/475/basefrom
gh/wconstab/475/head

Conversation

@wconstab
Copy link
Contributor

@wconstab wconstab commented Dec 13, 2025

Stack from ghstack (oldest at bottom):

This PR adds the register_single_dim_strategy util, and hooks it up to sharding_propagator. It also tests the registration.

Notes:

  • I didn't yet decide how multiple registrations should be handled. I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
  • I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case. I may have to change this later when integrating find_min_cost

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 13, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 7212664 with merge base 1984725 (image):

NEW FAILURE - The following job has failed:

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

[ghstack-poisoned]
wconstab added a commit that referenced this pull request Dec 17, 2025
ghstack-source-id: a25f465
Pull Request resolved: #170359
wconstab added a commit that referenced this pull request Dec 18, 2025
ghstack-source-id: ded0a40
Pull Request resolved: #170359
@wconstab wconstab added the release notes: distributed (dtensor) release notes category label Dec 18, 2025

This PR adds the register_single_dim_strategy util,  and hooks it up to sharding_propagator.  It also tests the registration.

Notes:
* I didn't yet decide how multiple registrations should be handled.  I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
* I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case.  I may have to change this later when integrating find_min_cost 



[ghstack-poisoned]
wconstab added a commit that referenced this pull request Dec 18, 2025
ghstack-source-id: a35cfe9
Pull Request resolved: #170359

This PR adds the register_single_dim_strategy util,  and hooks it up to sharding_propagator.  It also tests the registration.

Notes:
* I didn't yet decide how multiple registrations should be handled.  I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
* I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case.  I may have to change this later when integrating find_min_cost 



[ghstack-poisoned]
@wconstab
Copy link
Contributor Author

@pytorchbot merge

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

majing921201 pushed a commit to majing921201/pytorch that referenced this pull request Dec 19, 2025
This PR adds the register_single_dim_strategy util,  and hooks it up to sharding_propagator.  It also tests the registration.

Notes:
* I didn't yet decide how multiple registrations should be handled.  I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
* I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case.  I may have to change this later when integrating find_min_cost

Pull Request resolved: pytorch#170359
Approved by: https://github.com/weifengpy
ghstack dependencies: pytorch#170615, pytorch#167677

Co-authored-by: Pian Pawakapan <pianpwk@meta.com>
pytorchmergebot pushed a commit that referenced this pull request Dec 19, 2025
Enforce tensor_meta is not none for new single-dim rules.

Allow tensor_meta to continue to be None for existing rules for now. We
should consider in the future asserting tensor_meta is required in
DTensorSpec, but for now we just try to limit the bleeding.
Pull Request resolved: #170827
Approved by: https://github.com/dolpm
ghstack dependencies: #170615, #167677, #170359
xgz2 pushed a commit that referenced this pull request Dec 22, 2025
This PR adds the register_single_dim_strategy util,  and hooks it up to sharding_propagator.  It also tests the registration.

Notes:
* I didn't yet decide how multiple registrations should be handled.  I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
* I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case.  I may have to change this later when integrating find_min_cost

Pull Request resolved: #170359
Approved by: https://github.com/weifengpy

Co-authored-by: Pian Pawakapan <pianpwk@meta.com>
xgz2 pushed a commit that referenced this pull request Dec 22, 2025
This reverts commit 32d0782.

Reverted #170359 on behalf of https://github.com/jeanschmidt due to Required to revert #167677 that is required to revert #170615 that is required to revert #170030 ([comment](#170359 (comment)))
xgz2 pushed a commit that referenced this pull request Dec 22, 2025
This PR adds the register_single_dim_strategy util,  and hooks it up to sharding_propagator.  It also tests the registration.

Notes:
* I didn't yet decide how multiple registrations should be handled.  I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
* I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case.  I may have to change this later when integrating find_min_cost

Pull Request resolved: #170359
Approved by: https://github.com/weifengpy
ghstack dependencies: #170615, #167677

Co-authored-by: Pian Pawakapan <pianpwk@meta.com>
xgz2 pushed a commit that referenced this pull request Dec 22, 2025
Enforce tensor_meta is not none for new single-dim rules.

Allow tensor_meta to continue to be None for existing rules for now. We
should consider in the future asserting tensor_meta is required in
DTensorSpec, but for now we just try to limit the bleeding.
Pull Request resolved: #170827
Approved by: https://github.com/dolpm
ghstack dependencies: #170615, #167677, #170359
krastogi-in pushed a commit to krastogi-in/pytorch that referenced this pull request Jan 9, 2026
This PR adds the register_single_dim_strategy util,  and hooks it up to sharding_propagator.  It also tests the registration.

Notes:
* I didn't yet decide how multiple registrations should be handled.  I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
* I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case.  I may have to change this later when integrating find_min_cost

Pull Request resolved: pytorch#170359
Approved by: https://github.com/weifengpy

Co-authored-by: Pian Pawakapan <pianpwk@meta.com>
krastogi-in pushed a commit to krastogi-in/pytorch that referenced this pull request Jan 9, 2026
This reverts commit 32d0782.

Reverted pytorch#170359 on behalf of https://github.com/jeanschmidt due to Required to revert pytorch#167677 that is required to revert pytorch#170615 that is required to revert pytorch#170030 ([comment](pytorch#170359 (comment)))
krastogi-in pushed a commit to krastogi-in/pytorch that referenced this pull request Jan 9, 2026
This PR adds the register_single_dim_strategy util,  and hooks it up to sharding_propagator.  It also tests the registration.

Notes:
* I didn't yet decide how multiple registrations should be handled.  I was planning to make it an error if you register twice for the same op for either single_dim or regular strategies.
* I took the cleanest path of integration for now in sharding_prop, reusing as much code as possible with the existing 'op_strategy' case.  I may have to change this later when integrating find_min_cost

Pull Request resolved: pytorch#170359
Approved by: https://github.com/weifengpy
ghstack dependencies: pytorch#170615, pytorch#167677

Co-authored-by: Pian Pawakapan <pianpwk@meta.com>
krastogi-in pushed a commit to krastogi-in/pytorch that referenced this pull request Jan 9, 2026
Enforce tensor_meta is not none for new single-dim rules.

Allow tensor_meta to continue to be None for existing rules for now. We
should consider in the future asserting tensor_meta is required in
DTensorSpec, but for now we just try to limit the bleeding.
Pull Request resolved: pytorch#170827
Approved by: https://github.com/dolpm
ghstack dependencies: pytorch#170615, pytorch#167677, pytorch#170359
weifengpy added a commit that referenced this pull request Jan 13, 2026
… for matmul single dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 13, 2026
…le dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 13, 2026
… for matmul single dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 13, 2026
…le dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 13, 2026
… for matmul single dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 13, 2026
…le dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 13, 2026
… for matmul single dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 13, 2026
…le dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 14, 2026
… for matmul single dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 14, 2026
…le dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 14, 2026
… for matmul single dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 14, 2026
…le dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Jan 14, 2026
…2150)

gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359
Pull Request resolved: #172150
Approved by: https://github.com/wconstab
weifengpy added a commit that referenced this pull request Jan 14, 2026
… for matmul single dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
weifengpy added a commit that referenced this pull request Jan 14, 2026
…le dim"


gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy #170359

[ghstack-poisoned]
mattteochen pushed a commit to mattteochen/pytorch that referenced this pull request Jan 15, 2026
…orch#172150)

gen_einsum_strategies inserts replicate strategy first:
https://github.com/pytorch/pytorch/blob/74b6a0efa359722def4b585d9d91fbc3a4bfa530/torch/distributed/tensor/_ops/_einsum_strategy.py#L121-L122

_select_min_cost_strategy choose Replicate at equal cost

This PR makes sure consistent matmul results after switching to single dim strategy pytorch#170359
Pull Request resolved: pytorch#172150
Approved by: https://github.com/wconstab
@github-actions github-actions bot deleted the gh/wconstab/475/head branch January 18, 2026 02:21
SergeyTyshkevich pushed a commit to SergeyTyshkevich/chart2 that referenced this pull request Jan 19, 2026
SergeyTyshkevich pushed a commit to SergeyTyshkevich/chart2 that referenced this pull request Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: distributed (dtensor) release notes category Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants