Assert that kernels are called with the right signature#38361
Assert that kernels are called with the right signature#38361smessmer wants to merge 24 commits intogh/smessmer/220/basefrom
Conversation
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) ghstack-source-id: 103966297 Pull Request resolved: #38361
💊 CI failures summary and remediationsAs of commit b04a010 (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. This comment has been revised 135 times. |
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Pull Request resolved: #38361 Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes D17485438 ghstack-source-id: 104070456 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/)
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Pull Request resolved: #38361 Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes D17485438 ghstack-source-id: 104189472 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/)
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Pull Request resolved: #38361 Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes D17485438 ghstack-source-id: 104222283 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/)
|
The test failures might be because in some situations, we have multiple binary compatible versions of the library which have different RTTI. I've noticed this previously in ASAN. Here is a relevant note from the CI: One way I know how to fix this problem is if we roll our own RTTI mechanism, manually assembling a type index. But that's a bunch of work. I'm not sure if there's any better option. Resolving the RTLD_GLOBAL problem will be quite challenging in general. |
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Pull Request resolved: #38361 Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes D17485438 ghstack-source-id: 104319639 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/)
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Pull Request resolved: #38361 Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes D17485438 ghstack-source-id: 104378396 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/)
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
CI on the PR is passing now. I'll try landing this and see what happens. If something breaks in the master-only test cases, we might have to revert this. |
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes #26482 Differential Revision: [D21534052](https://our.internmc.facebook.com/intern/diff/D21534052/) [ghstack-poisoned]
|
This pull request has been merged in 55cdd31. |
Summary: Pull Request resolved: pytorch#38361 Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel. This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly. supersedes D17485438 ghstack-source-id: 106178820 Test Plan: waitforsandcastle Differential Revision: D21534052 fbshipit-source-id: 6be436a3f20586277a051d764af29e21d5567da0
Stack from ghstack:
Rather than segfaulting, we should show a good error message when in op.call<Return, Args...>(...) the Return type or Args types mismatch the kernel.
This adds an assertion comparing two std::type_index to the call path, but that should be fast. Hashing the function signature is also in the call path and not strictly constexpr, but I checked on godbolt that GCC >=5 and Clang >=3.8 optimize it away and make it constexpr, i.e. it's not part of the assembly.
Update: It's not in the call path anymore but it's now in the path when you query an OperatorHandle.
supersedes #26482
Differential Revision: D21534052