Issue 107804
Summary [mlir] [tosa] -tosa-infer-shapes crashes in reference llvm::SmallVectorTemplateCommon<long>::operator[](size_type) [T = long]: Assertion `idx < size()' failed
Labels mlir
Assignees
Reporter axeabc
    
git version: 0f5033053a3d4

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -tosa-infer-shapes a.mlir`

a.mlir:
``` 
module {
  func.func @transpose_conv2d_dyn_input(%arg0: memref<2x16x14 x3xf32>, %arg1: memref<3x1x1x3xf32>, %arg2 : memref<3xf32>) {
    %0 = bufferization.to_tensor %arg2 : memref<3xf32>
    %1 = bufferization.to_tensor %arg1 : memref<3x1x1x3xf32>
    %2 = bufferization.to_tensor %arg0 : memref<2x16x14 x3xf32>
    %3 = tosa.transpose_conv2d %2, %1, %0 {out_pad = array<i64: 0, 0, 0, 0>, out_shape = array<i64: -1, -1>, stride = array<i64: 1, 1>} : (tensor<2x16x14 x3xf32>, tensor<3x1x1x3xf32>, tensor<3xf32>) -> tensor<2x?x?x3xf32>
    return
 }
} 
``` 
stack trace:

``` 
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/llvm/include/llvm/ADT/SmallVector.h:291: reference llvm::SmallVectorTemplateCommon<long>::operator[](size_type) [T = long]: Assertion `idx < size()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -tosa-infer-shapes /data/szy/MLIR/seed/seed29/tmp.vLgGpXsySf.mlir
 #0 0x0000560251e96ff8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10d3ff8)
 #1 0x0000560251e94b0e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10d1b0e)
 #2 0x0000560251e9798d SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fa1a8888420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fa1a7ec500b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007fa1a7ea4859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007fa1a7ea4729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007fa1a7ea4729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007fa1a7eb5fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x00005602541d5b52 mlir::tosa::TransposeConv2DOp::inferReturnTypeComponents(mlir::MLIRContext*, std::optional<mlir::Location>, mlir::tosa::TransposeConv2DOpAdaptor, llvm::SmallVectorImpl<mlir::ShapedTypeComponents>&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x3412b52)
#10 0x00005602542a13d3 mlir::detail::InferShapedTypeOpInterfaceInterfaceTraits::Model<mlir::tosa::TransposeConv2DOp>::inferReturnTypeComponents(mlir::MLIRContext*, std::optional<mlir::Location>, mlir::ValueShapeRange, mlir::DictionaryAttr, mlir::OpaqueProperties, mlir::RegionRange, llvm::SmallVectorImpl<mlir::ShapedTypeComponents>&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x34de3d3)
#11 0x00005602542decd3 (anonymous namespace)::propagateShapesInRegion(mlir::Region&, (anonymous namespace)::TypeModificationState&) TosaInferShapes.cpp:0:0
#12 0x00005602542dcb25 (anonymous namespace)::TosaInferShapes::runOnOperation() TosaInferShapes.cpp:0:0
#13 0x0000560254f83e26 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c0e26)
#14 0x0000560254f84790 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c1790)
#15 0x0000560254f89b4e mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
#16 0x0000560254f85e6b mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c2e6b)
#17 0x0000560254f83f78 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c0f78)
#18 0x0000560254f84790 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c1790)
#19 0x0000560254f86dd2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c3dd2)
#20 0x0000560254f7f601 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#21 0x0000560254f7f25b llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#22 0x000056025502bef5 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4268ef5)
#23 0x0000560254f7a685 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41b7685)
#24 0x0000560254f7a92f mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41b792f)
#25 0x0000560254f7ac5e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41b7c5e)
#26 0x0000560251e77c37 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10b4c37)
#27 0x00007fa1a7ea6083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#28 0x0000560251e777be _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10b47be)
``` 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to