Skip to content

[PyTorch] IValue::toTensor can now return const Tensor&#48868

Closed
swolchok wants to merge 13 commits intogh/swolchok/33/basefrom
gh/swolchok/33/head
Closed

[PyTorch] IValue::toTensor can now return const Tensor&#48868
swolchok wants to merge 13 commits intogh/swolchok/33/basefrom
gh/swolchok/33/head

Conversation

@swolchok
Copy link
Contributor

@swolchok swolchok commented Dec 4, 2020

Stack from ghstack:

Building on the previous diff, we can make toTensor() return a
const Tensor&, which should make it easier to avoid reference
counting.

Differential Revision: D25325379

NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
@facebook-github-bot facebook-github-bot added cla signed oncall: jit Add this issue/PR to JIT oncall triage queue labels Dec 4, 2020
@dr-ci
Copy link

dr-ci bot commented Dec 4, 2020

💊 CI failures summary and remediations

As of commit 1325e5d (more details on the Dr. CI page):


  • 2/2 failures possibly* introduced in this PR
    • 1/2 non-CircleCI failure(s)

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_bionic_py3_8_gcc9_coverage_test1 (1/1)

Step: "Run tests" (full log | diagnosis details | 🔁 rerun)

Jan 05 01:22:24 [E request_callback_no_python.cpp:636] Received error while processing request type 258: RuntimeError: Can not pickle torch.futures.Future
Jan 05 01:22:24 At:
Jan 05 01:22:24   /opt/conda/lib/python3.8/site-packages/torch/distributed/rpc/internal.py(120): serialize
Jan 05 01:22:24   /opt/conda/lib/python3.8/site-packages/torch/distributed/rpc/internal.py(172): serialize
Jan 05 01:22:24 
Jan 05 01:22:24 [E request_callback_no_python.cpp:636] Received error while processing request type 258: RuntimeError: Can not pickle torch.futures.Future
Jan 05 01:22:24 
Jan 05 01:22:24 At:
Jan 05 01:22:24   /opt/conda/lib/python3.8/site-packages/torch/distributed/rpc/internal.py(120): serialize
Jan 05 01:22:24   /opt/conda/lib/python3.8/site-packages/torch/distributed/rpc/internal.py(172): serialize
Jan 05 01:22:24 
Jan 05 01:22:24 [E request_callback_no_python.cpp:636] Received error while processing request type 258: RuntimeError: Can not pickle torch.futures.Future
Jan 05 01:22:24 
Jan 05 01:22:24 At:
Jan 05 01:22:24   /opt/conda/lib/python3.8/site-packages/torch/distributed/rpc/internal.py(120): serialize
Jan 05 01:22:24   /opt/conda/lib/python3.8/site-packages/torch/distributed/rpc/internal.py(172): serialize
Jan 05 01:22:24 
Jan 05 01:22:24 [W tensorpipe_agent.cpp:547] RPC agent for worker0 encountered error when reading incoming request from worker3: EOF: end of file (this is expected to happen during shutdown)
Jan 05 01:22:24 [W tensorpipe_agent.cpp:547] RPC agent for worker0 encountered error when reading incoming request from worker2: EOF: end of file (this is expected to happen during shutdown)
Jan 05 01:22:25 ok (2.551s)
Jan 05 01:22:27   test_return_future_remote (__main__.TensorPipeRpcTestWithSpawn) ... [W tensorpipe_agent.cpp:547] RPC agent for worker1 encountered error when reading incoming request from worker0: EOF: end of file (this is expected to happen during shutdown)
Jan 05 01:22:27 ok (2.554s)

1 job timed out:

  • pytorch_linux_bionic_py3_8_gcc9_coverage_test1

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

This comment has been revised 92 times.

…eturn const Tensor&"

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 4, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 117914173

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 12, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 118468561

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 15, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 118658273

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
…nsor can now return const Tensor&"

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
…nsor can now return const Tensor&"

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 16, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 118718144

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 16, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 118754514

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
…eturn const Tensor&"

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 18, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 118936155

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
…turn const Tensor&"

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 19, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 118965482

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 22, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119023481

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
…can now return const Tensor&"

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 22, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119032050

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Dec 22, 2020
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119032050

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 4, 2021
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119327372

Differential Revision: [D25325379](https://our.internmc.facebook.com/intern/diff/D25325379/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25325379/)!
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a440491.

facebook-github-bot pushed a commit that referenced this pull request Jan 6, 2021
Summary:
Pull Request resolved: #48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119327372

Test Plan: internal benchmarks.

Reviewed By: bwasti

Differential Revision: D25325379

fbshipit-source-id: ca699632901691bcee432f595f75b0a4416d55dd
@facebook-github-bot facebook-github-bot deleted the gh/swolchok/33/head branch January 10, 2021 15:17
hwangdeyu pushed a commit to hwangdeyu/pytorch that referenced this pull request Jan 14, 2021
Summary:
Pull Request resolved: pytorch#48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119327372

Test Plan: internal benchmarks.

Reviewed By: bwasti

Differential Revision: D25325379

fbshipit-source-id: ca699632901691bcee432f595f75b0a4416d55dd
jjsjann123 pushed a commit to jjsjann123/nvfuser that referenced this pull request Oct 29, 2022
Summary:
Pull Request resolved: pytorch/pytorch#48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119327372

Test Plan: internal benchmarks.

Reviewed By: bwasti

Differential Revision: D25325379

fbshipit-source-id: ca699632901691bcee432f595f75b0a4416d55dd
jjsjann123 pushed a commit to jjsjann123/nvfuser that referenced this pull request Nov 10, 2022
Summary:
Pull Request resolved: pytorch/pytorch#48868

Building on the previous diff, we can make `toTensor()` return a
`const Tensor&`, which should make it easier to avoid reference
counting.
ghstack-source-id: 119327372

Test Plan: internal benchmarks.

Reviewed By: bwasti

Differential Revision: D25325379

fbshipit-source-id: ca699632901691bcee432f595f75b0a4416d55dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants