[Mlir-commits] [mlir] [mlir][sparse] allow unknown ops in one-shot bufferization in sparse … (PR #77688)

Aart Bik llvmlistbot at llvm.org
Wed Jan 10 13:11:02 PST 2024


https://github.com/aartbik created https://github.com/llvm/llvm-project/pull/77688

…mini-pipeline

Rationale:
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).

>From d2cf4aaff1d62cd1d72174ebd90248e81f21b8e6 Mon Sep 17 00:00:00 2001
From: Aart Bik <ajcbik at google.com>
Date: Wed, 10 Jan 2024 13:05:21 -0800
Subject: [PATCH] [mlir][sparse] allow unknown ops in one-shot bufferization in
 sparse mini-pipeline

Rationale:
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).
---
 .../Transforms/SparsificationAndBufferizationPass.cpp       | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparsificationAndBufferizationPass.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparsificationAndBufferizationPass.cpp
index 6266c63064ffbd..f497be6e48eba1 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparsificationAndBufferizationPass.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparsificationAndBufferizationPass.cpp
@@ -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;
   return options;
 }
 



More information about the Mlir-commits mailing list