Skip to content

[mlir][sparse] Disassemble doesn't work with SortedCOO + SOA in libgen path #84074

Open
@yinying-lisa-li

Description

@yinying-lisa-li

Example IR for sparse_tensor.disassemble of SortedCOO + SOA:
%ret_values, %ret_levels:3, %val_len, %lvl_lens:3 = sparse_tensor.disassemble %1 : tensor<64x64xf32, #SortedCOO_SOA> outs(%arg4, %arg5, %arg6, %arg7 : tensor<?xf32>, tensor<?xindex>, tensor<?xindex>, tensor<?xindex>) -> tensor<?xf32>, (tensor<?xindex>, tensor<?xindex>, tensor<?xindex>), index, (index, index, index)

The number of results should be 8, but currently there are only 3 push_backs for retVal and retLen in here. Therefore, there'll always be a mismatch that causes the error below:

# executed command: /usr/local/google/home/yinyingli/llvm-project/build/bin/mlir-opt /usr/local/google/home/yinyingli/llvm-project/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_pack.mlir --sparsifier=enable-runtime-library=true
# .---command stderr------------
# | mlir-opt: /usr/local/google/home/yinyingli/llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp:822: virtual LogicalResult (anonymous namespace)::SparseTensorDisassembleConverter::matchAndRewrite(DisassembleOp, OpAdaptor, ConversionPatternRewriter &) const: Assertion `retVal.size() + retLen.size() == op.getNumResults()' failed.
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
# | Stack dump:
# | 0.	Program arguments: /usr/local/google/home/yinyingli/llvm-project/build/bin/mlir-opt /usr/local/google/home/yinyingli/llvm-project/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_pack.mlir --sparsifier=enable-runtime-library=true
# | Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
# | 0  mlir-opt  0x000055ade2b1d551 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 65
# | 1  mlir-opt  0x000055ade2b1da4b
# | 2  mlir-opt  0x000055ade2b1ba46 llvm::sys::RunSignalHandlers() + 134
# | 3  mlir-opt  0x000055ade2b1e1e5
# | 4  libc.so.6 0x00007f7c08c5a510
# | 5  libc.so.6 0x00007f7c08ca80fc
# | 6  libc.so.6 0x00007f7c08c5a472 gsignal + 18
# | 7  libc.so.6 0x00007f7c08c444b2 abort + 211
# | 8  libc.so.6 0x00007f7c08c443d5
# | 9  libc.so.6 0x00007f7c08c533a2
# | 10 mlir-opt  0x000055ade5b71894
# | 11 mlir-opt  0x000055ade5b4fd5f
# | 12 mlir-opt  0x000055ade7e16e58 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const + 440
# | 13 mlir-opt  0x000055adebd7ba36
# | 14 mlir-opt  0x000055adebd7b875
# | 15 mlir-opt  0x000055ade2b43a29
# | 16 mlir-opt  0x000055adebd7d285
# | 17 mlir-opt  0x000055adebd79df7 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1463
# | 18 mlir-opt  0x000055ade7e1f164
# | 19 mlir-opt  0x000055ade7e1754a
# | 20 mlir-opt  0x000055ade7e16ebf mlir::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) + 47
# | 21 mlir-opt  0x000055ade7e17862 mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) + 402
# | 22 mlir-opt  0x000055ade7e1c479 mlir::applyPartialConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) + 105
# | 23 mlir-opt  0x000055ade7e1c5aa mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) + 138
# | 24 mlir-opt  0x000055ade5a4984e
# | 25 mlir-opt  0x000055ade7d43fbb
# | 26 mlir-opt  0x000055ade7d43f55
# | 27 mlir-opt  0x000055ade2b43a29
# | 28 mlir-opt  0x000055ade7d46ca5
# | 29 mlir-opt  0x000055ade7d3f683 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 851
# | 30 mlir-opt  0x000055ade7d3fc04 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 388
# | 31 mlir-opt  0x000055ade7d43f31
# | 32 mlir-opt  0x000055ade7d43ca5
# | 33 mlir-opt  0x000055ade5aa38a9
# | 34 mlir-opt  0x000055ade5aa3705
# | 35 mlir-opt  0x000055ade5aa3518
# | 36 mlir-opt  0x000055ade7d43fbb
# | 37 mlir-opt  0x000055ade7d43f55
# | 38 mlir-opt  0x000055ade2b43a29
# | 39 mlir-opt  0x000055ade7d46ca5
# | 40 mlir-opt  0x000055ade7d3f683 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 851
# | 41 mlir-opt  0x000055ade7d3fc04 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 388
# | 42 mlir-opt  0x000055ade7d41759 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) + 105
# | 43 mlir-opt  0x000055ade7d41682 mlir::PassManager::run(mlir::Operation*) + 1138
# | 44 mlir-opt  0x000055ade7d35f62
# | 45 mlir-opt  0x000055ade7d35ba1
# | 46 mlir-opt  0x000055ade7d35998
# | 47 mlir-opt  0x000055ade7d35932
# | 48 mlir-opt  0x000055ade7eaf53e
# | 49 mlir-opt  0x000055ade7eaeb5d mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 141
# | 50 mlir-opt  0x000055ade7d32861 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) + 337
# | 51 mlir-opt  0x000055ade7d32b05 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) + 581
# | 52 mlir-opt  0x000055ade7d32cd8 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) + 264
# | 53 mlir-opt  0x000055ade2a958e1 main + 161
# | 54 libc.so.6 0x00007f7c08c456ca
# | 55 libc.so.6 0x00007f7c08c45785 __libc_start_main + 133
# | 56 mlir-opt  0x000055ade2a95531 _start + 33
# `-----------------------------

Metadata

Metadata

Assignees

Labels

mlir:sparseSparse compiler in MLIR

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions