Skip to content

Use TensorMethods.cpp#37639

Closed
ilia-cher wants to merge 84 commits intogh/ilia-cher/65/basefrom
gh/ilia-cher/65/head
Closed

Use TensorMethods.cpp#37639
ilia-cher wants to merge 84 commits intogh/ilia-cher/65/basefrom
gh/ilia-cher/65/head

Conversation

@ilia-cher
Copy link
Copy Markdown
Contributor

@ilia-cher ilia-cher commented May 1, 2020

Stack from ghstack:

Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

Differential Revision: D21374247

Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

[ghstack-poisoned]
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 1, 2020

💊 CI failures summary and remediations

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


💚 💚 Looks good so far! There are no failures yet. 💚 💚


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 on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 479 times.

ilia-cher added 2 commits May 1, 2020 02:05
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

[ghstack-poisoned]
@ilia-cher ilia-cher requested a review from apaszke as a code owner May 1, 2020 23:22
ilia-cher added 3 commits May 1, 2020 18:02
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
ilia-cher added 8 commits May 3, 2020 18:22
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
This was referenced May 4, 2020
ilia-cher added 3 commits May 4, 2020 12:37
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
@dzhulgakov
Copy link
Copy Markdown
Collaborator

Hm, any concerns with overhead due to moving away from the inline methods?

Comment thread aten/src/ATen/templates/TensorBody.h Outdated

template <typename T>
T * data_ptr() const;
TORCH_API T * data_ptr() const;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, that's weird. The API annotation on the class itself should have been sufficient. What's going on here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

err, will update; I was debugging a windows build error

Comment thread aten/src/ATen/templates/TensorBody.h Outdated
c10::intrusive_ptr<TensorImpl, UndefinedTensorImpl> impl_;
};

TORCH_API int64_t get_device(Tensor self);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pretty sure this should be CAFFE2_API

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

as I understand TORCH_API is defined as CAFFE2_API in WindowsTorchApiMacro.h

ilia-cher added 4 commits May 28, 2020 14:31
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
Summary:
Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

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

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 68e62b9.

@ezyang
Copy link
Copy Markdown
Contributor

ezyang commented Jun 1, 2020

This broke mobile code analysis. It will not be too easy to fix, we should talk about this with @ljk53 in composability.

@ilia-cher
Copy link
Copy Markdown
Contributor Author

This broke mobile code analysis. It will not be too easy to fix, we should talk about this with @ljk53 in composability.

@ezyang @ljk53 why was all of CI green? how can I repro?

@ljk53
Copy link
Copy Markdown
Contributor

ljk53 commented Jun 1, 2020

mobile

It didn't break because the CI only runs on landed PR. I made it so because there is another e2e CI also covering most part of mobile code analysis. There is only a small unit test that e2e CI doesn't run, which caused the failure.

This is the error message on failed CI job:

Jun 01 15:31:43 In file included from /var/lib/jenkins/workspace/test/mobile/op_deps/simple_ops.cpp:1:
Jun 01 15:31:43 /var/lib/jenkins/workspace/test/mobile/op_deps/simple_ops.h:22:52: error: no member named 'singleton' in 'c10::DispatchKey'
Jun 01 15:31:43   static c10::OperatorHandle op = c10::Dispatcher::singleton()
Jun 01 15:31:43                                   ~~~~~~~~~~~~~~~~~^
Jun 01 15:31:43 /var/lib/jenkins/workspace/test/mobile/op_deps/simple_ops.h:24:15: error: no member named 'Dispatcher' in namespace 'c10'; did you mean 'DispatchKey'?
Jun 01 15:31:43   return c10::Dispatcher::singleton().call<Tensor, const Tensor&>(
Jun 01 15:31:43          ~~~~~^~~~~~~~~~
Jun 01 15:31:43               DispatchKey

I think we need change it accordingly: https://github.com/pytorch/pytorch/blob/master/test/mobile/op_deps/simple_ops.h

You can repeat the test locally using:

https://github.com/pytorch/pytorch/blob/master/tools/code_analyzer/build.sh#L12

@ezyang
Copy link
Copy Markdown
Contributor

ezyang commented Jun 1, 2020

You can force all of master ci to run by pushing to ci-all/blah branch on pytorch/pytorch

ilia-cher pushed a commit that referenced this pull request Jun 2, 2020
Summary:
see #37639

Test Plan:
#37639

[ghstack-poisoned]
ilia-cher pushed a commit that referenced this pull request Jun 2, 2020
Summary:
see #37639

Test Plan:
#37639

ghstack-source-id: d19b4cb
Pull Request resolved: #39385
ilia-cher pushed a commit that referenced this pull request Jun 2, 2020
Summary:
see #37639

Test Plan:
#37639

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

[ghstack-poisoned]
ilia-cher pushed a commit that referenced this pull request Jun 2, 2020
Summary:
see #37639

Test Plan:
#37639

ghstack-source-id: 5971b33
Pull Request resolved: #39385
ilia-cher pushed a commit that referenced this pull request Jun 2, 2020
Summary:
see #37639

Test Plan:
#37639

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

[ghstack-poisoned]
ilia-cher pushed a commit that referenced this pull request Jun 2, 2020
Summary:
see #37639

Test Plan:
#37639

ghstack-source-id: 561293e
Pull Request resolved: #39385
facebook-github-bot pushed a commit that referenced this pull request Jun 3, 2020
Summary:
Pull Request resolved: #39385

see #37639

Test Plan:
#37639

Imported from OSS

Differential Revision: D21833287

fbshipit-source-id: 9928d3f4122903d0de67ad312e349352d5f5c19c
@facebook-github-bot facebook-github-bot deleted the gh/ilia-cher/65/head branch June 4, 2020 14:16
jjsjann123 pushed a commit to jjsjann123/nvfuser that referenced this pull request Oct 29, 2022
Summary:
Pull Request resolved: pytorch/pytorch#37639

Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

Imported from OSS

checked mobile size, no change, small reduction in size in fbios
fbios: Succeeded
Change in Download Size for arm64 + 3x assets variation: -18.2 KiB
Change in Uncompressed Size for arm64 + 3x assets variation: -8.8 KiB

reran benchmark, no stat. significant difference

buck run mode/opt caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads:benchmark_torchscript_model -- --model_file caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt --num_runs 3

╷ @  68592d0d  41 minutes ago  iliacher  D21374247
╭─╯  Use TensorMethods.cpp

Created 3 benchmark runs on aibench for caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt.
Links to the results:

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/1729113760

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/3867976782

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/2782186766

hg prev

@  7f501b42  Thursday at 14:26  bvaughan  D21764704
╷  short-circuit pow for complex 1 and 0 exponents

Created 3 benchmark runs on aibench for caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt.
Links to the results:

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/2155256332

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/1802057074

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/4119590830

Differential Revision: D21374247

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

see pytorch/pytorch#37639

Test Plan:
pytorch/pytorch#37639

Imported from OSS

Differential Revision: D21833287

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

Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

Imported from OSS

checked mobile size, no change, small reduction in size in fbios
fbios: Succeeded
Change in Download Size for arm64 + 3x assets variation: -18.2 KiB
Change in Uncompressed Size for arm64 + 3x assets variation: -8.8 KiB

reran benchmark, no stat. significant difference

buck run mode/opt caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads:benchmark_torchscript_model -- --model_file caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt --num_runs 3

╷ @  68592d0d  41 minutes ago  iliacher  D21374247
╭─╯  Use TensorMethods.cpp

Created 3 benchmark runs on aibench for caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt.
Links to the results:

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/1729113760

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/3867976782

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/2782186766

hg prev

@  7f501b42  Thursday at 14:26  bvaughan  D21764704
╷  short-circuit pow for complex 1 and 0 exponents

Created 3 benchmark runs on aibench for caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt.
Links to the results:

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/2155256332

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/1802057074

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/4119590830

Differential Revision: D21374247

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

see pytorch/pytorch#37639

Test Plan:
pytorch/pytorch#37639

Imported from OSS

Differential Revision: D21833287

fbshipit-source-id: 9928d3f4122903d0de67ad312e349352d5f5c19c
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#37639

Changing TensorMethods.h to .cpp
Necessary to avoid incomplete types in dispatcher

Test Plan:
CI

Imported from OSS

checked mobile size, no change, small reduction in size in fbios
fbios: Succeeded
Change in Download Size for arm64 + 3x assets variation: -18.2 KiB
Change in Uncompressed Size for arm64 + 3x assets variation: -8.8 KiB

reran benchmark, no stat. significant difference

buck run mode/opt caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads:benchmark_torchscript_model -- --model_file caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt --num_runs 3

╷ @  68592d0d  41 minutes ago  iliacher  D21374247
╭─╯  Use TensorMethods.cpp

Created 3 benchmark runs on aibench for caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt.
Links to the results:

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/1729113760

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/3867976782

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/2782186766

hg prev

@  7f501b42  Thursday at 14:26  bvaughan  D21764704
╷  short-circuit pow for complex 1 and 0 exponents

Created 3 benchmark runs on aibench for caffe2/caffe2/fb/high_perf_models/pytorch/benchmark_framework_overheads/addmodule.pt.
Links to the results:

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/2155256332

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/1802057074

* Adhoc run: https://our.intern.facebook.com/intern/aibench/details/4119590830

Differential Revision: D21374247

fbshipit-source-id: 076964415079cf84fb57f1f7b43d087afed86e1d
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#39385

see pytorch#37639

Test Plan:
pytorch#37639

Imported from OSS

Differential Revision: D21833287

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants