Skip to content

[coor-slicing] extract _get_mesh_tensor_from_full_mesh#169550

Closed
aorenste wants to merge 10 commits intogh/aorenste/157/basefrom
gh/aorenste/157/head
Closed

[coor-slicing] extract _get_mesh_tensor_from_full_mesh#169550
aorenste wants to merge 10 commits intogh/aorenste/157/basefrom
gh/aorenste/157/head

Conversation

@aorenste
Copy link
Copy Markdown
Contributor

@aorenste aorenste commented Dec 4, 2025

For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out DeviceMesh._get_mesh_tensor_from_full_mesh() into a static method.

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Dec 4, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 91 Pending

As of commit 159b331 with merge base dc48fef (image):
💚 Looks good so far! There are no failures yet. 💚

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.

tiendatngcs pushed a commit to tiendatngcs/pytorch-Dec25 that referenced this pull request Dec 10, 2025
@aorenste aorenste added the topic: not user facing topic category label Dec 10, 2025
@aorenste aorenste changed the title WIP: extract _get_mesh_tensor_from_full_mesh [coor-slicing] extract _get_mesh_tensor_from_full_mesh Jan 6, 2026
For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out `DeviceMesh._get_mesh_tensor_from_full_mesh()` into a static method.




[ghstack-poisoned]
@aorenste aorenste marked this pull request as ready for review January 7, 2026 14:35
@aorenste aorenste requested a review from ezyang January 7, 2026 14:35
@ezyang ezyang requested a review from fduwjj January 8, 2026 15:13
For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out `DeviceMesh._get_mesh_tensor_from_full_mesh()` into a static method.




[ghstack-poisoned]
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #169551

@aorenste
Copy link
Copy Markdown
Contributor Author

aorenste commented Jan 9, 2026

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 9, 2026
@pytorchmergebot
Copy link
Copy Markdown
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

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out `DeviceMesh._get_mesh_tensor_from_full_mesh()` into a static method.




[ghstack-poisoned]
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #169551

pytorchmergebot pushed a commit that referenced this pull request Jan 10, 2026
`Placement._split_tensor()` computes and returns too much information - in general most callers call it and then throw away most of the results. Added `Placement._select_split_tensor()` which allows the caller to say which parts they want so we can compute only those bits - in essence it is the combination of `Placement._split_tensor()` and `Shard._select_shard()`.

Pull Request resolved: #169551
Approved by: https://github.com/ezyang
ghstack dependencies: #169549, #169550
@jeanschmidt
Copy link
Copy Markdown
Contributor

@pytorchbot revert -m "seems to be breaking internal signals, see D90448078" -c ghfirst

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@aorenste your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Jan 12, 2026
…)"

This reverts commit 649d9b3.

Reverted #169550 on behalf of https://github.com/jeanschmidt due to seems to be breaking internal signals, see D90448078 ([comment](#169550 (comment)))
@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Jan 12, 2026
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #169551

pytorchmergebot pushed a commit that referenced this pull request Jan 12, 2026
`Placement._split_tensor()` computes and returns too much information - in general most callers call it and then throw away most of the results. Added `Placement._select_split_tensor()` which allows the caller to say which parts they want so we can compute only those bits - in essence it is the combination of `Placement._split_tensor()` and `Shard._select_shard()`.

Pull Request resolved: #169551
Approved by: https://github.com/ezyang
ghstack dependencies: #169549, #169550
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Jan 12, 2026
For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out `DeviceMesh._get_mesh_tensor_from_full_mesh()` into a static method.

Pull Request resolved: pytorch#169550
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Jan 12, 2026
`Placement._split_tensor()` computes and returns too much information - in general most callers call it and then throw away most of the results. Added `Placement._select_split_tensor()` which allows the caller to say which parts they want so we can compute only those bits - in essence it is the combination of `Placement._split_tensor()` and `Shard._select_shard()`.

Pull Request resolved: pytorch#169551
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549, pytorch#169550
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Jan 12, 2026
…ch#169550)"

This reverts commit 649d9b3.

Reverted pytorch#169550 on behalf of https://github.com/jeanschmidt due to seems to be breaking internal signals, see D90448078 ([comment](pytorch#169550 (comment)))
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Jan 12, 2026
For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out `DeviceMesh._get_mesh_tensor_from_full_mesh()` into a static method.

Pull Request resolved: pytorch#169550
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Jan 12, 2026
`Placement._split_tensor()` computes and returns too much information - in general most callers call it and then throw away most of the results. Added `Placement._select_split_tensor()` which allows the caller to say which parts they want so we can compute only those bits - in essence it is the combination of `Placement._split_tensor()` and `Shard._select_shard()`.

Pull Request resolved: pytorch#169551
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549, pytorch#169550
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Jan 12, 2026
For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out `DeviceMesh._get_mesh_tensor_from_full_mesh()` into a static method.

Pull Request resolved: pytorch#169550
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Jan 12, 2026
`Placement._split_tensor()` computes and returns too much information - in general most callers call it and then throw away most of the results. Added `Placement._select_split_tensor()` which allows the caller to say which parts they want so we can compute only those bits - in essence it is the combination of `Placement._split_tensor()` and `Shard._select_shard()`.

Pull Request resolved: pytorch#169551
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549, pytorch#169550
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Jan 12, 2026
…ch#169550)"

This reverts commit 649d9b3.

Reverted pytorch#169550 on behalf of https://github.com/jeanschmidt due to seems to be breaking internal signals, see D90448078 ([comment](pytorch#169550 (comment)))
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Jan 12, 2026
For compile on one rank we need to be able to compute the DeviceMesh rank Tensor based on the raw Tensor and current rank. So this PR factors out `DeviceMesh._get_mesh_tensor_from_full_mesh()` into a static method.

Pull Request resolved: pytorch#169550
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Jan 12, 2026
`Placement._split_tensor()` computes and returns too much information - in general most callers call it and then throw away most of the results. Added `Placement._select_split_tensor()` which allows the caller to say which parts they want so we can compute only those bits - in essence it is the combination of `Placement._split_tensor()` and `Shard._select_shard()`.

Pull Request resolved: pytorch#169551
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#169549, pytorch#169550
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
@github-actions github-actions Bot deleted the gh/aorenste/157/head branch February 12, 2026 02:23
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/trunk Trigger trunk jobs on your pull request Merged Reverted topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants