Include IR dump options on e2e failure report

pull/564/head
Yi Zhang 2022-02-08 21:14:14 -05:00
parent 6aa96f8c1e
commit e09e2cbe70
1 changed files with 2 additions and 0 deletions

View File

@ -45,12 +45,14 @@ def run_pipeline_with_repro_report(module,
filename = os.path.join(tempfile.gettempdir(), module_name + ".mlir")
with open(filename, 'w') as f:
f.write(asm_for_error_report)
debug_options="-print-ir-after-all -mlir-disable-threading"
raise Exception(f"""
{description} failed with the following diagnostics:
{sys.stderr.getvalue()}
Error can be reproduced with:
$ torch-mlir-opt -pass-pipeline='{pipeline}' {filename}
Add '{debug_options}' to get the IR dump for debugging purpose.
""") from None
finally:
sys.stderr = original_stderr