You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Show old kernel location when there are mismatches (pytorch#46850)
Summary:
Pull Request resolved: pytorch#46850
So far, in the error messages when kernel signatures mismatched, we showed the location where the second kernel came from,
but we didn't show the location of the first kernel. This PR now shows the location of both.
ghstack-source-id: 115468616
Test Plan: waitforsandcastle
Reviewed By: ezyang
Differential Revision: D24540368
fbshipit-source-id: 3b4474062879d17f9bb7870ad3814343edc1b755
auto& k = dispatch_key.has_value() ? kernels_[*dispatch_key] : kernels_[DispatchKey::Math];
104
106
105
107
if (k.size() > 0) {
106
-
TORCH_WARN("Registering a kernel (", debug, ") for operator ", name_, " for dispatch key ", toString(dispatch_key), " that overwrote a previously registered kernel with the same dispatch key for the same operator.");
108
+
TORCH_WARN("Registering a kernel (", debug, ") for operator ", name_, " (",
109
+
(this->schema_.has_value() ? this->schema_->debug : "no debug info"),
110
+
") for dispatch key ", toString(dispatch_key),
111
+
" that overwrote a previously registered kernel (",
112
+
(cpp_signature_.has_value() ? cpp_signature_->debug : "no debug info"),
113
+
") with the same dispatch key for the same operator.");
") 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."
168
170
);
169
171
}
@@ -230,12 +232,17 @@ class CAFFE2_API OperatorEntry final {
0 commit comments