-
Notifications
You must be signed in to change notification settings - Fork 514
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
LowerToBackendContract: Explicitly error out on unimplemented operator #1947
Conversation
bb69a9f
to
e8b9d10
Compare
e8b9d10
to
bb80407
Compare
I'm a bit surprised by the CI failure. Turn out that (Same for LTC on ElementwiseClampMaxModule_basic, fails with I don't quite understand how it could be passing before when the operator is not implemented? |
That's very strange. Let me take a look and see what I find |
I think I know what's happening. The LTC reference backend in Torch-MLIR creates an MLIR graph that is expected to satisfy the backend contract, but then executes things using the TorchScript LTC backend. In other words, the MLIR graph is not compiled further down and executed. torch-mlir/python/torch_mlir/csrc/reference_lazy_backend/backend_impl.cpp Lines 102 to 103 in 3f3833d
This is why the tests were passing even though there is no ODS for In reality, the In the case of LTC, the clamp tests create the op
which does satisfy the backend contract. The check should be modified to use the |
…nvalid Otherwise it might be a custom op that the backend supports.
Thanks, that's it. I updated the PR and now it passes :-) |
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.
Great, thanks!
llvm#1947) * LowerToBackendContract: Explicitly error out on unimplemented operator But only reject torch.operator when results are invalid. Otherwise it might be a custom op that the backend supports.
As discussed on discord [0], this PR will emit more direct errors like
unsupported by backend contract: Unimplemented operator 'aten.clamp.Tensor'
instead of diagnosing unknown ranks or missing value conversion.[0] https://discordapp.com/channels/636084430946959380/742573221882364009/1083826291301679225