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
[DTensor][2/N][forward fix] extend util function normalize_to_torch_size to accept single int size #113244
Conversation
…ize to accept single int size [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113244
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 4230f93 with merge base 56e514a (): FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…ize to accept single int size ghstack-source-id: 68c8b9a884419cbc948c918b74c25c2c26b8bac2 Pull Request resolved: #113244
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.
cool, looks good!
@pytorchbot merge -f "unrelated periodic CI failure - macos build" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ize to accept single int size (pytorch#113244) **Summary**: In pytorch#113105 I used the util function `normalize_to_torch_size` to unify the `size` argument that may be in multiple formats. However the use of that function would only handle input of `Sequence[int]` therefore I submit this forward fix to have `normalize_to_torch_size` also able to handle the size argument of type `int` and `torch.Size`. A side product of this fix is it also enables 3 dtensor op tests (check `test_dtensor_ops.py`). **Test**: `pytest test/distributed/_tensor/test_dtensor_ops.py` Pull Request resolved: pytorch#113244 Approved by: https://github.com/wanchaol ghstack dependencies: pytorch#113105
Stack from ghstack (oldest at bottom):
Summary:
In #113105 I used the util function
normalize_to_torch_size
to unify thesize
argument that may be in multiple formats. However the use of that function would only handle input ofSequence[int]
therefore I submit this forward fix to havenormalize_to_torch_size
also able to handle the size argument of typeint
andtorch.Size
. A side product of this fix is it also enables 3 dtensor op tests (checktest_dtensor_ops.py
).Test:
pytest test/distributed/_tensor/test_dtensor_ops.py
cc @wanchaol