Skip to content
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

Add support for .to() for NestedTensor backends #87146

Closed
wants to merge 1 commit into from

Conversation

ani300
Copy link
Collaborator

@ani300 ani300 commented Oct 17, 2022

Summary: This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Differential Revision: D40437585

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 17, 2022

🔗 Helpful Links

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

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

✅ No Failures, 1 Pending

As of commit 54edfa1:
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40437585

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40437585

ani300 pushed a commit to ani300/pytorch that referenced this pull request Oct 17, 2022
Summary:
Pull Request resolved: pytorch#87146

This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Differential Revision: D40437585

fbshipit-source-id: 6f42b1dffa53d0945c19a92b0e087ea6abc978f0
ani300 pushed a commit to ani300/pytorch that referenced this pull request Oct 17, 2022
Summary:
Pull Request resolved: pytorch#87146

This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Differential Revision: D40437585

fbshipit-source-id: c15c94cbddad67224f3d133fa0bd4b653a66fb1e
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40437585

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40437585

ani300 pushed a commit to ani300/pytorch that referenced this pull request Oct 18, 2022
Summary:
Pull Request resolved: pytorch#87146

This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Differential Revision: D40437585

fbshipit-source-id: 827ab5a96ce91a2b7b442607bc039d1a95e6c0b1
ani300 pushed a commit to ani300/pytorch that referenced this pull request Oct 18, 2022
Summary:
Pull Request resolved: pytorch#87146

This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Differential Revision: D40437585

fbshipit-source-id: d59e0d83e04304033289a0fda099d157588c9e7d
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40437585

@ani300 ani300 requested a review from drisspg October 18, 2022 20:24
test/test_nestedtensor.py Outdated Show resolved Hide resolved
test/test_nestedtensor.py Outdated Show resolved Hide resolved
test/test_nestedtensor.py Outdated Show resolved Hide resolved
Copy link
Contributor

@drisspg drisspg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small comments but otherwise I think this is very close, great job

ani300 pushed a commit to ani300/pytorch that referenced this pull request Oct 19, 2022
Summary:
Pull Request resolved: pytorch#87146

This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Differential Revision: D40437585

fbshipit-source-id: b54894943c605a619d900bc9cabebf5c0925e37b
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40437585

@@ -1,5 +1,7 @@
#include <ATen/native/nested/NestedTensorMath.h>

#include <c10/util/Optional.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: do we need to add these headers? maybe we should have had the optional.h , but do we need the Copy.h header

Copy link
Contributor

@drisspg drisspg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 19, 2022
Summary:
Pull Request resolved: pytorch#87146

This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Reviewed By: drisspg

Differential Revision: D40437585

fbshipit-source-id: b2b70ba4852c3b4ba4ae5d9ce796a37a902fb80a
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40437585

@ani300
Copy link
Collaborator Author

ani300 commented Oct 19, 2022

@pytorchbot merge

@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

@github-actions
Copy link

Hey @ani300.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

sgrigory pushed a commit to sgrigory/pytorch that referenced this pull request Oct 28, 2022
Summary: This commit adds support for moving NestedTensors from CPU to GPU and back. The implementation includes requires implementing empty_like(), which is based on PR#83140.

Test Plan: Added a new unit test based on the unit test for the main .to() implementation. All unit tests must pass, as well as every sandcastle job.

Differential Revision: D40437585

Pull Request resolved: pytorch#87146
Approved by: https://github.com/drisspg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants