Skip to content

[mlir][sparse] allow unknown ops in one-shot bufferization in mini-pipeline #77688

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

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ mlir::getBufferizationOptionsForSparsification(bool analysisOnly) {
options.testAnalysisOnly = true;
options.printConflicts = true;
}
// Since this mini-pipeline may be used in alternative pipelines (viz.
// different from the default "sparsifier" pipeline) where unknown ops
// are handled by alternative bufferization methods that are downstream
// of this mini-pipeline, we allow unknown ops by default (failure to
// bufferize is eventually apparent by failing to convert to LLVM IR).
options.allowUnknownOps = true;
Copy link
Member

Choose a reason for hiding this comment

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

just fyi: From a correctness perspective, setting allowUnknownOps = true is always safe. The main benefit of setting allowUnknownOps = false is that we get more descriptive error messages in case there are ops that cannot be bufferized (and are not lowered by subsequent passes). Bufferizing the entire IR with One-Shot Bufferize is generally more efficient. If an op is bufferized later, a buffer copy will likely be inserted by that pass (when buffering an op that writes to memory).

return options;
}

Expand Down