-
Notifications
You must be signed in to change notification settings - Fork 621
Enable VerifyBackendContract in LTC backend #1798
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
Enable VerifyBackendContract in LTC backend #1798
Conversation
ade8674 to
d7ce401
Compare
|
@ramiro050 I just realized that you've added parameterization for I also found that in generated CAPI there is no way to specify arguments. All arguments are just embedded to the cpp file. For example in MlirPass mlirCreateLowerToBackendContract(void) {
return wrap(
mlir::torch::Torch::createLowerToBackendContractPass(
/*maxIterations=*/10, /*decompose=*/true, /*backendLegalOps=*/{})
.release());
}all parameters were set, and As a workaround we can have two separate passes for |
|
LGTM pending Ramiro's response on the options. |
The parameters were added to be consistent with the definition of the backend contract, which includes decompositions. However, the |
5ac95d1 to
8248863
Compare
|
@ramiro050 I renamed the pass. Could you please take a look? If everything is okay we can get it merged. |
ramiro050
left a comment
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.
Just a small nit
|
Thanks for pushing this through @GlebKazantaev !! |
* Enable VerifyBackendContract in LTC backend * Update VerifyBackendContract pass * Move convert_scalar_implicit to jit_utils * Rename VerifyBackendContract to VerifyBackendContractNoDecompositions * Update verify-backend-contract-error.mlir test
Description
In this PR I enable
VerifyBackendContractpass as a part of LTC backend contract to check that MLIR satisfies backend requirements. See #1460 for more details.Changes
TorchMlirLoweringContext::BuildwithVerifyBackendContractpass execution.TorchMlirComputationto acceptMlirModule.VerifyBackendContractpass parametrization.This PR depends on changes in PyTorch pytorch/pytorch#92095 so once they land I will mark this PR as ready for review.