Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
[mlir][sparse] minor comment edits in sparsifier pipeline (#77000)
Browse files Browse the repository at this point in the history
  • Loading branch information
aartbik committed Jan 4, 2024
1 parent cb7fe9a commit 4241e84
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
void mlir::sparse_tensor::buildSparsifier(OpPassManager &pm,
const SparsifierOptions &options) {
// Rewrite named linalg ops into generic ops.

pm.addNestedPass<func::FuncOp>(createLinalgGeneralizationPass());

// Sparsification and bufferization mini-pipeline.
Expand Down Expand Up @@ -65,6 +64,8 @@ void mlir::sparse_tensor::buildSparsifier(OpPassManager &pm,
pm.addNestedPass<gpu::GPUModuleOp>(createConvertGpuOpsToNVVMOps());
}

// Progressively lower to LLVM. Note that the convert-vector-to-llvm
// pass is repeated on purpose.
// TODO(springerm): Add sparse support to the BufferDeallocation pass and add
// it to this pipeline.
pm.addNestedPass<func::FuncOp>(createConvertLinalgToLoopsPass());
Expand All @@ -80,10 +81,7 @@ void mlir::sparse_tensor::buildSparsifier(OpPassManager &pm,
pm.addNestedPass<func::FuncOp>(createConvertMathToLLVMPass());
pm.addPass(createConvertMathToLibmPass());
pm.addPass(createConvertComplexToLibmPass());

// Repeat convert-vector-to-llvm.
pm.addPass(createConvertVectorToLLVMPass(options.lowerVectorToLLVMOptions()));

pm.addPass(createConvertComplexToLLVMPass());
pm.addPass(createConvertVectorToLLVMPass(options.lowerVectorToLLVMOptions()));
pm.addPass(createConvertFuncToLLVMPass());
Expand All @@ -101,6 +99,7 @@ void mlir::sparse_tensor::buildSparsifier(OpPassManager &pm,
pm.addPass(createGpuModuleToBinaryPass(gpuModuleToBinaryPassOptions));
}

// Ensure all casts are realized.
pm.addPass(createReconcileUnrealizedCastsPass());
}

Expand Down

0 comments on commit 4241e84

Please sign in to comment.