Skip to content

move all external kernels into a class for better compiler error messages#59839

Closed
bdhirsh wants to merge 17 commits intogh/bdhirsh/124/basefrom
gh/bdhirsh/124/head
Closed

move all external kernels into a class for better compiler error messages#59839
bdhirsh wants to merge 17 commits intogh/bdhirsh/124/basefrom
gh/bdhirsh/124/head

Conversation

@bdhirsh
Copy link
Copy Markdown
Collaborator

@bdhirsh bdhirsh commented Jun 10, 2021

Turns external backend kernels into class methods, so they get helpful compiler errors instead of linker errors whenever they're a schema mismatch.

I took a stab at trying to do the same for in-tree kernels, but gave up after a while. It would probably make sense to come back to it with @wenleix 's nice set of regex calls, to automatically pick up all of the native kernels in the aten/src/ATen/native folder.

Corresponding xla PR: pytorch/xla#3012

Stack from ghstack:

Differential Revision: D29047680

@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Jun 10, 2021

💊 CI failures summary and remediations

As of commit 47c1960 (more details on the Dr. CI page and at hud.pytorch.org/pr/59839):


  • 2/3 failures possibly* introduced in this PR
    • 1/2 non-scanned failure(s)
  • 1/3 broken upstream at merge base 0d6f291 from Jun 09 until Jun 11

🕵️ 1 new failure recognized by patterns

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

See CircleCI build pytorch_xla_linux_bionic_py3_6_clang9_build (1/1)

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

Jul 06 19:40:58 /var/lib/jenkins/workspace/xla/...any arguments to function call, expected 2, have 3
Jul 06 19:40:58 clang++-9 -MMD -MF /var/lib/jenkins/workspace/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type.o.d -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c -c /var/lib/jenkins/workspace/xla/torch_xla/csrc/aten_xla_type.cpp -o /var/lib/jenkins/workspace/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jul 06 19:40:58 /var/lib/jenkins/workspace/xla/torch_xla/csrc/aten_xla_type.cpp:395:21: error: no member named 'index_put_' in namespace 'torch_xla'
Jul 06 19:40:58   return torch_xla::index_put_(self, indices, values, accumulate);
Jul 06 19:40:58          ~~~~~~~~~~~^
Jul 06 19:40:58 /var/lib/jenkins/workspace/xla/torch_xla/csrc/aten_xla_type.cpp:455:10: error: use of undeclared identifier 'view'; did you mean 'View'?
Jul 06 19:40:58   return view(self, size);
Jul 06 19:40:58          ^
Jul 06 19:40:58 /var/lib/jenkins/workspace/xla/torch_xla/csrc/view.h:128:7: note: 'View' declared here
Jul 06 19:40:58 class View {
Jul 06 19:40:58       ^
Jul 06 19:40:58 /var/lib/jenkins/workspace/xla/torch_xla/csrc/aten_xla_type.cpp:1091:56: error: too many arguments to function call, expected 2, have 3
Jul 06 19:40:58   return torch_xla::div(self, other, /*rounding_mode=*/c10::nullopt);
Jul 06 19:40:58          ~~~~~~~~~~~~~~                                ^~~~~~~~~~~~
Jul 06 19:40:58 /var/lib/jenkins/workspace/xla/torch_xla/csrc/aten_xla_type.cpp:1090:1: note: 'div' declared here
Jul 06 19:40:58 at::Tensor div(const at::Tensor& self, const at::Tensor& other) {
Jul 06 19:40:58 ^
Jul 06 19:40:58 3 errors generated.
Jul 06 19:41:00 [19/171] clang++-9 -MMD -MF /var/lib/jenkins/workspace/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/init_python_bindings.o.d -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/var/lib/jenkins/workspace/xla -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-bin -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/var/lib/jenkins/workspace/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/torch/csrc -I/var/lib/jenkins/workspace/torch/lib/tmp_install/include -I/opt/conda/lib/python3.6/site-packages/torch/include -I/opt/conda/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.6/site-packages/torch/include/TH -I/opt/conda/lib/python3.6/site-packages/torch/include/THC -I/opt/conda/include/python3.6m -c -c /var/lib/jenkins/workspace/xla/torch_xla/csrc/init_python_bindings.cpp -o /var/lib/jenkins/workspace/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/init_python_bindings.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=1
Jul 06 19:41:00 In file included from /var/lib/jenkins/workspace/xla/torch_xla/csrc/init_python_bindings.cpp:35:
Jul 06 19:41:00 In file included from /var/lib/jenkins/workspace/torch/csrc/jit/python/pybind.h:8:
Jul 06 19:41:00 In file included from /var/lib/jenkins/workspace/torch/csrc/THP.h:42:

🚧 1 fixed upstream failure:

These were probably caused by upstream breakages that were already fixed.

Please rebase on the viable/strict branch (expand for instructions)

If your commit is older than viable/strict, run these commands:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

Preview docs built from this PR

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.

Click here to manually regenerate this comment.

@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 10, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 11, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

bdhirsh added a commit that referenced this pull request Jun 11, 2021
…ages

Pull Request resolved: #59839

Differential Revision: [D29047615](https://our.internmc.facebook.com/intern/diff/D29047615/)
ghstack-source-id: 131148089
bdhirsh added a commit that referenced this pull request Jun 11, 2021
@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 11, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

bdhirsh added a commit that referenced this pull request Jun 11, 2021
@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 11, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 14, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 14, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

bdhirsh added a commit that referenced this pull request Jun 14, 2021
@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 14, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

bdhirsh added a commit that referenced this pull request Jun 15, 2021
…ages

Pull Request resolved: #59839

Differential Revision: [D29047680](https://our.internmc.facebook.com/intern/diff/D29047680/)
ghstack-source-id: 131502432
bdhirsh added a commit that referenced this pull request Jun 16, 2021
…ages

Pull Request resolved: #59839

Differential Revision: [D29047680](https://our.internmc.facebook.com/intern/diff/D29047680/)
ghstack-source-id: 131628623
bdhirsh added a commit that referenced this pull request Jun 17, 2021
…ages

Pull Request resolved: #59839

Differential Revision: [D29047680](https://our.internmc.facebook.com/intern/diff/D29047680/)
ghstack-source-id: 131703206
@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 25, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jun 29, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

… error messages"

Turns external backend kernels into class methods, so they get helpful compiler errors instead of linker errors whenever they're a schema mismatch.

I took a stab at trying to do the same for in-tree kernels, but gave up after a while. It would probably make sense to come back to it with @wenleix 's nice set of regex calls, to automatically pick up all of the native kernels in the `aten/src/ATen/native` folder.

Corresponding xla PR: pytorch/xla#3012


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

[ghstack-poisoned]
@bdhirsh
Copy link
Copy Markdown
Collaborator Author

bdhirsh commented Jul 6, 2021

@bdhirsh has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

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

Thanks @bdhirsh !

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@bdhirsh merged this pull request in 7318747.

@facebook-github-bot facebook-github-bot deleted the gh/bdhirsh/124/head branch July 12, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants