torch-mlir
torch-mlir copied to clipboard
MLIR Python pass manager API will assert if the pass issues errors but does not signal failure
See Pass.cpp:
// Actually run the pass manager.
PyMlirContext::ErrorCapture errors(op.getOperation().getContext());
MlirLogicalResult status = mlirPassManagerRunOnOp(
passManager.get(), op.getOperation().get());
if (mlirLogicalResultIsFailure(status))
throw MLIRError("Failure while executing pass pipeline",
errors.take());
In a debug build, the ErrorCapture will assert if errors have not been taken/cleared.
Workaround is to set ctx.emit_error_diagnostics = True. This is being done to unblock but should be reverted once fixed upstream.