-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add torch._lazy_clone
to create COW tensors
#113397
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113397
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 f4cd5b4 with merge base 6f8fc42 ( 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. |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
ghstack-source-id: 41444ca Pull Request resolved: pytorch#113397
[ghstack-poisoned]
The failure in cuda12.1-py3.10-gcc9-sm86 / test (inductor, 1, 1, linux.g5.4xlarge.nvidia.gpu) is real. Running I just found #114012, which skips the inductor test. I'll add that change to this PR instead. I'm not sure why the inductor tests are failing. I think it probably makes sense to fix it in a follow up |
Part of #109833 Differential Revision: [D51466281](https://our.internmc.facebook.com/intern/diff/D51466281) [ghstack-poisoned]
ghstack-source-id: 5d715f0 Pull Request resolved: pytorch#113397
Part of #109833 Differential Revision: [D51466281](https://our.internmc.facebook.com/intern/diff/D51466281) [ghstack-poisoned]
t = torch.tensor((), device=device) | ||
self.assertEqual(t.dtype, t.storage().dtype) | ||
|
||
# Note [lazy_clone_ tests with inductor enabled] |
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 was able to split the test up into multiple tests to get them to pass when inductor is enabled. This note explains what went wrong and the strategy I used to fix it
Related idea on copy-on-write/move-semantics: #106584 (comment) And expressing that clone is not always needed for currently always-copy functions, such as torch.cat with a single-tensor argument |
Part of #109833 Differential Revision: [D51466281](https://our.internmc.facebook.com/intern/diff/D51466281) [ghstack-poisoned]
@pytorchbot merge |
Merge failedReason: This PR has internal changes and must be landed via Phabricator Details for Dev Infra teamRaised by workflow job |
@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: .github/workflows/periodic.yml / win-vs2019-cuda11.8-py3 / test (default, 1, 4, windows.g5.4xlarge.nvidia.gpu) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge -f "trunk flakiness only" |
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 |
Part of #109833
Stack from ghstack (oldest at bottom):
torch._lazy_clone
to create COW tensors #113397