Skip to content

feat: if passes run fail, dump to a file#964

Merged
avik-pal merged 4 commits intomainfrom
mg/dump-ir
Mar 19, 2025
Merged

feat: if passes run fail, dump to a file#964
avik-pal merged 4 commits intomainfrom
mg/dump-ir

Conversation

@giordano
Copy link
Copy Markdown
Member

Comment thread src/mlir/IR/Pass.jl
show(io, mod)
end
@error "Dumped module to " * path
throw("failed to run pass manager on module")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continuing from https://github.com/EnzymeAD/Reactant.jl/pull/959/files#r2003996116, how do I print the name of the pass here? Can I just interpolate $(pm) here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right, no you can't (the code we have in compiler.jl run_pass_pipeline or whatnot does have that info)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm, PassManager doesn't seem to have a dedicate show method. So what you want to see (and how to print it)?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can show(IR.OpPassManager(passManager)) which should have the pipeline

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avik-pal avik-pal merged commit 375dce0 into main Mar 19, 2025
54 checks passed
@avik-pal avik-pal deleted the mg/dump-ir branch March 19, 2025 23:27
Comment thread src/mlir/IR/Pass.jl
API.mlirPassManagerRun(pm, mod)
end)
if isfailure(status)
dir = mktempdir()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory (with cleanup=true by default) isn't very useful: it'll disappear at julia exit, making the MLIR module unusable: PRONTOLab/GB-25#95 (comment). I'll address this in a follow up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants