torch-mlir icon indicating copy to clipboard operation
torch-mlir copied to clipboard

MLIR Python pass manager API will assert if the pass issues errors but does not signal failure

Open stellaraccident opened this issue 1 year ago • 0 comments

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.

stellaraccident avatar Jun 28 '24 02:06 stellaraccident