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
Improve error messages for operator registration API #47636
Conversation
Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":92, please report a bug to PyTorch. Tried to register a kernel (registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847) for operator aten::div.out (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541) for dispatch key Tracer, but the C++ function signature at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) mismatched with a previous kernel (registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166) that had the signature at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":96, please report a bug to PyTorch. Mismatch in kernel C++ signatures operator: aten::div.out(Tensor self, Tensor other, *, Tensor(a!) out) -> (Tensor(a!)) registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541 kernel 1: at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) dispatch key: CPU registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166 kernel 2: at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) dispatch key: Tracer registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847 ``` Previously: ``` W1109 13:38:52.464170 1644302 OperatorEntry.cpp:117] Warning: Registering a kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) for operator aten::_backward (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549) for dispatch key Autograd that overwrote a previously registered kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) with the same dispatch key for the same operator. (function registerKernel) ``` Now: ``` W1109 13:49:40.501817 1698959 OperatorEntry.cpp:118] Warning: Overriding a previously registered kernel for the same operator and the same dispatch key operator: aten::_backward(Tensor self, Tensor[] inputs, Tensor? gradient=None, bool? retain_graph=None, bool create_graph=False) -> () registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549 dispatch key: Autograd previous kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 new kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 (function registerKernel) ``` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): In registration for dummy_library::dummy_op: expected schema of operator to be "dummy_library::dummy_op(Tensor a) -> (Tensor)" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298), but got inferred schema "(Tensor _0) -> ()" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298). The number of returns is different. 1 vs 0 ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): Inferred operator schema for a C++ kernel function doesn't match the expected function schema. operator: dummy_library::dummy_op expected schema: dummy_library::dummy_op(Tensor a) -> (Tensor) registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 inferred schema: (Tensor _0) -> () registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 reason: The number of returns is different. 1 vs 0 ```` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":170, please report a bug to PyTorch. Tried to access operator _test::dummy with a wrong signature. Accessed with void (at::Tensor, long) but the operator was registered with void (at::Tensor) (schema: registered by RegisterOperators, kernel: registered by RegisterOperators) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":169, please report a bug to PyTorch. Tried to access or call an operator with a wrong signature. operator: _test::dummy(Tensor dummy) -> () registered by RegisterOperators correct signature: void (at::Tensor) registered by RegisterOperators accessed/called as: void (at::Tensor, long) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Differential Revision: [D24846523](https://our.internmc.facebook.com/intern/diff/D24846523/) [ghstack-poisoned]
Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":92, please report a bug to PyTorch. Tried to register a kernel (registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847) for operator aten::div.out (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541) for dispatch key Tracer, but the C++ function signature at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) mismatched with a previous kernel (registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166) that had the signature at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":96, please report a bug to PyTorch. Mismatch in kernel C++ signatures operator: aten::div.out(Tensor self, Tensor other, *, Tensor(a!) out) -> (Tensor(a!)) registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541 kernel 1: at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) dispatch key: CPU registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166 kernel 2: at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) dispatch key: Tracer registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847 ``` Previously: ``` W1109 13:38:52.464170 1644302 OperatorEntry.cpp:117] Warning: Registering a kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) for operator aten::_backward (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549) for dispatch key Autograd that overwrote a previously registered kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) with the same dispatch key for the same operator. (function registerKernel) ``` Now: ``` W1109 13:49:40.501817 1698959 OperatorEntry.cpp:118] Warning: Overriding a previously registered kernel for the same operator and the same dispatch key operator: aten::_backward(Tensor self, Tensor[] inputs, Tensor? gradient=None, bool? retain_graph=None, bool create_graph=False) -> () registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549 dispatch key: Autograd previous kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 new kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 (function registerKernel) ``` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): In registration for dummy_library::dummy_op: expected schema of operator to be "dummy_library::dummy_op(Tensor a) -> (Tensor)" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298), but got inferred schema "(Tensor _0) -> ()" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298). The number of returns is different. 1 vs 0 ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): Inferred operator schema for a C++ kernel function doesn't match the expected function schema. operator: dummy_library::dummy_op expected schema: dummy_library::dummy_op(Tensor a) -> (Tensor) registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 inferred schema: (Tensor _0) -> () registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 reason: The number of returns is different. 1 vs 0 ```` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":170, please report a bug to PyTorch. Tried to access operator _test::dummy with a wrong signature. Accessed with void (at::Tensor, long) but the operator was registered with void (at::Tensor) (schema: registered by RegisterOperators, kernel: registered by RegisterOperators) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":169, please report a bug to PyTorch. Tried to access or call an operator with a wrong signature. operator: _test::dummy(Tensor dummy) -> () registered by RegisterOperators correct signature: void (at::Tensor) registered by RegisterOperators accessed/called as: void (at::Tensor, long) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Differential Revision: [D24846523](https://our.internmc.facebook.com/intern/diff/D24846523/) ghstack-source-id: 116245731 Pull Request resolved: #47636
💊 CI failures summary and remediationsAs of commit ff3eb77 (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
🚧 3 fixed upstream failures:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
@@ -84,14 +88,18 @@ std::list<AnnotatedKernel>::iterator OperatorEntry::registerKernel( | |||
if (cpp_signature.has_value()) { | |||
if (cpp_signature_.has_value()) { | |||
TORCH_INTERNAL_ASSERT(*cpp_signature == cpp_signature_->signature, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a TORCH_CHECK
then?
@@ -158,15 +158,14 @@ class CAFFE2_API OperatorEntry final { | |||
template<class FuncType> | |||
void assertSignatureIsCorrect() { | |||
TORCH_INTERNAL_ASSERT(!cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":92, please report a bug to PyTorch. Tried to register a kernel (registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847) for operator aten::div.out (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541) for dispatch key Tracer, but the C++ function signature at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) mismatched with a previous kernel (registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166) that had the signature at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":96, please report a bug to PyTorch. Mismatch in kernel C++ signatures operator: aten::div.out(Tensor self, Tensor other, *, Tensor(a!) out) -> (Tensor(a!)) registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541 kernel 1: at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) dispatch key: CPU registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166 kernel 2: at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) dispatch key: Tracer registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847 ``` Previously: ``` W1109 13:38:52.464170 1644302 OperatorEntry.cpp:117] Warning: Registering a kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) for operator aten::_backward (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549) for dispatch key Autograd that overwrote a previously registered kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) with the same dispatch key for the same operator. (function registerKernel) ``` Now: ``` W1109 13:49:40.501817 1698959 OperatorEntry.cpp:118] Warning: Overriding a previously registered kernel for the same operator and the same dispatch key operator: aten::_backward(Tensor self, Tensor[] inputs, Tensor? gradient=None, bool? retain_graph=None, bool create_graph=False) -> () registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549 dispatch key: Autograd previous kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 new kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 (function registerKernel) ``` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): In registration for dummy_library::dummy_op: expected schema of operator to be "dummy_library::dummy_op(Tensor a) -> (Tensor)" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298), but got inferred schema "(Tensor _0) -> ()" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298). The number of returns is different. 1 vs 0 ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): Inferred operator schema for a C++ kernel function doesn't match the expected function schema. operator: dummy_library::dummy_op expected schema: dummy_library::dummy_op(Tensor a) -> (Tensor) registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 inferred schema: (Tensor _0) -> () registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 reason: The number of returns is different. 1 vs 0 ```` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":170, please report a bug to PyTorch. Tried to access operator _test::dummy with a wrong signature. Accessed with void (at::Tensor, long) but the operator was registered with void (at::Tensor) (schema: registered by RegisterOperators, kernel: registered by RegisterOperators) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":169, please report a bug to PyTorch. Tried to access or call an operator with a wrong signature. operator: _test::dummy(Tensor dummy) -> () registered by RegisterOperators correct signature: void (at::Tensor) registered by RegisterOperators accessed/called as: void (at::Tensor, long) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Differential Revision: [D24846523](https://our.internmc.facebook.com/intern/diff/D24846523/) [ghstack-poisoned]
Pull Request resolved: #47636 Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":92, please report a bug to PyTorch. Tried to register a kernel (registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847) for operator aten::div.out (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541) for dispatch key Tracer, but the C++ function signature at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) mismatched with a previous kernel (registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166) that had the signature at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":96, please report a bug to PyTorch. Mismatch in kernel C++ signatures operator: aten::div.out(Tensor self, Tensor other, *, Tensor(a!) out) -> (Tensor(a!)) registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541 kernel 1: at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) dispatch key: CPU registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166 kernel 2: at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) dispatch key: Tracer registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847 ``` Previously: ``` W1109 13:38:52.464170 1644302 OperatorEntry.cpp:117] Warning: Registering a kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) for operator aten::_backward (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549) for dispatch key Autograd that overwrote a previously registered kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) with the same dispatch key for the same operator. (function registerKernel) ``` Now: ``` W1109 13:49:40.501817 1698959 OperatorEntry.cpp:118] Warning: Overriding a previously registered kernel for the same operator and the same dispatch key operator: aten::_backward(Tensor self, Tensor[] inputs, Tensor? gradient=None, bool? retain_graph=None, bool create_graph=False) -> () registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549 dispatch key: Autograd previous kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 new kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 (function registerKernel) ``` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): In registration for dummy_library::dummy_op: expected schema of operator to be "dummy_library::dummy_op(Tensor a) -> (Tensor)" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298), but got inferred schema "(Tensor _0) -> ()" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298). The number of returns is different. 1 vs 0 ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): Inferred operator schema for a C++ kernel function doesn't match the expected function schema. operator: dummy_library::dummy_op expected schema: dummy_library::dummy_op(Tensor a) -> (Tensor) registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 inferred schema: (Tensor _0) -> () registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 reason: The number of returns is different. 1 vs 0 ```` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":170, please report a bug to PyTorch. Tried to access operator _test::dummy with a wrong signature. Accessed with void (at::Tensor, long) but the operator was registered with void (at::Tensor) (schema: registered by RegisterOperators, kernel: registered by RegisterOperators) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":169, please report a bug to PyTorch. Tried to access or call an operator with a wrong signature. operator: _test::dummy(Tensor dummy) -> () registered by RegisterOperators correct signature: void (at::Tensor) registered by RegisterOperators accessed/called as: void (at::Tensor, long) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` ghstack-source-id: 116330790 Differential Revision: [D24846523](https://our.internmc.facebook.com/intern/diff/D24846523/)
Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":92, please report a bug to PyTorch. Tried to register a kernel (registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847) for operator aten::div.out (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541) for dispatch key Tracer, but the C++ function signature at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) mismatched with a previous kernel (registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166) that had the signature at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): *cpp_signature == cpp_signature_->signature INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.cpp":96, please report a bug to PyTorch. Mismatch in kernel C++ signatures operator: aten::div.out(Tensor self, Tensor other, *, Tensor(a!) out) -> (Tensor(a!)) registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3541 kernel 1: at::Tensor& (at::Tensor&, at::Tensor const&, at::Tensor const&) dispatch key: CPU registered at buck-out/dev/gen/caffe2/aten/gen_aten=CPUType.cpp/CPUType.cpp:2166 kernel 2: at::Tensor& (at::Tensor const&, at::Tensor const&, at::Tensor&) dispatch key: Tracer registered at buck-out/dev/gen/caffe2/generate-code/autograd/generated/TraceType_2.cpp:9847 ``` Previously: ``` W1109 13:38:52.464170 1644302 OperatorEntry.cpp:117] Warning: Registering a kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) for operator aten::_backward (registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549) for dispatch key Autograd that overwrote a previously registered kernel (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310) with the same dispatch key for the same operator. (function registerKernel) ``` Now: ``` W1109 13:49:40.501817 1698959 OperatorEntry.cpp:118] Warning: Overriding a previously registered kernel for the same operator and the same dispatch key operator: aten::_backward(Tensor self, Tensor[] inputs, Tensor? gradient=None, bool? retain_graph=None, bool create_graph=False) -> () registered at buck-out/dev/gen/caffe2/aten/gen_aten=TypeDefault.cpp/TypeDefault.cpp:3549 dispatch key: Autograd previous kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 new kernel: registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:310 (function registerKernel) ``` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): In registration for dummy_library::dummy_op: expected schema of operator to be "dummy_library::dummy_op(Tensor a) -> (Tensor)" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298), but got inferred schema "(Tensor _0) -> ()" (registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298). The number of returns is different. 1 vs 0 ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): Inferred operator schema for a C++ kernel function doesn't match the expected function schema. operator: dummy_library::dummy_op expected schema: dummy_library::dummy_op(Tensor a) -> (Tensor) registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 inferred schema: (Tensor _0) -> () registered at caffe2/torch/csrc/autograd/VariableTypeManual.cpp:298 reason: The number of returns is different. 1 vs 0 ```` Previously: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":170, please report a bug to PyTorch. Tried to access operator _test::dummy with a wrong signature. Accessed with void (at::Tensor, long) but the operator was registered with void (at::Tensor) (schema: registered by RegisterOperators, kernel: registered by RegisterOperators) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Now: ``` terminate called after throwing an instance of 'c10::Error' what(): !cpp_signature_.has_value() || (CppSignature::make<FuncType>() == cpp_signature_->signature) INTERNAL ASSERT FAILED at "caffe2/aten/src/ATen/core/dispatch/OperatorEntry.h":169, please report a bug to PyTorch. Tried to access or call an operator with a wrong signature. operator: _test::dummy(Tensor dummy) -> () registered by RegisterOperators correct signature: void (at::Tensor) registered by RegisterOperators accessed/called as: void (at::Tensor, long) This likely happened in a call to OperatorHandle::typed<Return (Args...)>(). Please make sure that the function signature matches the signature in the operator registration call. ``` Differential Revision: [D24846523](https://our.internmc.facebook.com/intern/diff/D24846523/) [ghstack-poisoned]
This pull request has been merged in 7864ae9. |
Stack from ghstack:
Previously:
Now:
Previously:
Now:
Previously:
Now:
Previously:
Now:
Differential Revision: D24846523