-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Allow dynamic shapes for DTensor slice #157953
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157953
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 f2ce7fb with merge base 1f57e0e ( 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. |
| for t in torch.tensor_split(x, 2) | ||
| ] | ||
|
|
||
| x = DTensor.from_local(torch.rand(4, 4), mesh, [Shard(0)], run_check=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did we ensure these particular tensor dims were treated as dynamic? should we explicitly mark them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally manually marked the dimensions, but I removed that because torch.compile(..., dynamic=True) was enough to reproduce the error, so it shouldn't be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea i was mostly asking for my edification, what does dynamic=True mean, assume all dims are dynamic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! All dimensions are marked dynamic this way.
|
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / before-test / target-determination Details for Dev Infra teamRaised by workflow job |
4a196e6 to
f2ce7fb
Compare
|
@pytorchbot merge |
Merge startedYour 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 |
This PR allows for symints in
gen_slice_strategywhich is the strategy foraten.slice.Tensor. Previously, using dynamic shapes with slicing would result inQuestions before merge:
dimis still asserted to be int. Is this fine, or is this potentially dynamic as well?normalize_dim. Should I instead change types fornormalize_dimand further dependency to beIntLikeas well?cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k