[Mlir-commits] [mlir] aec73ea - [mlir][sparse] allow unknown ops in one-shot bufferization in mini-pipeline (#77688)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jan 10 13:36:24 PST 2024


Author: Aart Bik
Date: 2024-01-10T13:36:20-08:00
New Revision: aec73eade7af0e22c944714bec31570181bc1ad4

URL: https://github.com/llvm/llvm-project/commit/aec73eade7af0e22c944714bec31570181bc1ad4
DIFF: https://github.com/llvm/llvm-project/commit/aec73eade7af0e22c944714bec31570181bc1ad4.diff

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

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

This is part of enabling e2e testing for TORCH-MLIR tests using a
sparsifier backend

Added: 
    

Modified: 
    mlir/lib/Dialect/SparseTensor/Transforms/SparsificationAndBufferizationPass.cpp

Removed: 
    


################################################################################
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.
+  // 
diff erent 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