Issue 204582
Summary [mlir][xegpu](xegpu-blocking) mlir-opt crashes at VectorOps.cpp:1206 with assertion `lhsDimIndex >= 0' failed.
Labels mlir
Assignees
Reporter Aran-414
    git version: 08b557bf5139394194be22359268b7b88f81faae

MLIR Program:
```mlir
#map = affine_map<(d0, d1, d2) -> (d0, d2)>
#map1 = affine_map<(d0, d1, d2) -> (d2, d1)>
#map2 = affine_map<(d0, d1, d2) -> ()>
module {
  func.func @negative_accumulator_shape(%arg0: vector<8x16xf16>, %arg1: vector<16x16xf16>, %arg2: vector<f32>) -> vector<f32> {
    %0 = vector.contract {indexing_maps = [#map, #map1, #map2], iterator_types = ["reduction", "reduction", "reduction"], kind = #vector.kind<add>} %arg0, %arg1, %arg2 : vector<8x16xf16>, vector<16x16xf16> into vector<f32>
    return %0 : vector<f32>
 }
}
```

Reproduce Command: `mlir-opt -xegpu-blocking a.mlir`

StackTrace:
```
mlir-opt: /data2/dependency/dev/llvm-project/mlir/lib/Dialect/Vector/IR/VectorOps.cpp:1206: void mlir::vector::ContractionOp::getIterationBounds(llvm::SmallVectorImpl<long int>&): Assertion `lhsDimIndex >= 0' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.      Program arguments: /data2/dependency/dev/llvm-project/build/bin/mlir-opt -xegpu-blocking a.mlir
 #0 0x000055668ccb5f6f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25bbf6f)
 #1 0x000055668ccb273c llvm::sys::RunSignalHandlers() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25b873c)
 #2 0x000055668ccb28d7 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007fbaa70e5420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fbaa6bd000b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #5 0x00007fbaa6baf859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #6 0x00007fbaa6baf729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #7 0x00007fbaa6bc0fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #8 0x0000556694391dff mlir::vector::ContractionOp::getIterationBounds(llvm::SmallVectorImpl<long>&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x9c97dff)
 #9 0x00005566943da3e4 mlir::detail::VectorUnrollOpInterfaceInterfaceTraits::Model<mlir::vector::ContractionOp>::getShapeForUnroll(mlir::detail::VectorUnrollOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x9ce03e4)
#10 0x0000556694447fb9 mlir::VectorUnrollOpInterface::getShapeForUnroll() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x9d4dfb9)
#11 0x0000556693c6952b getTargetShape(mlir::vector::UnrollVectorOptions const&, mlir::Operation*) VectorUnroll.cpp:0:0
#12 0x0000556693c7837f (anonymous namespace)::UnrollContractionPattern::matchAndRewrite(mlir::vector::ContractionOp, mlir::PatternRewriter&) const VectorUnroll.cpp:0:0
#13 0x00005566916ea430 mlir::detail::OpOrInterfaceRewritePatternBase<mlir::vector::ContractionOp>::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x6ff0430)
#14 0x0000556695a50aa2 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::'lambda'()::operator()() const PatternApplicator.cpp:0:0
#15 0x0000556695a51f98 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb357f98)
#16 0x0000556695a1c167 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
#17 0x0000556695a20476 mlir::applyPatternsGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb326476)
#18 0x00005566918f4aff (anonymous namespace)::XeGPUBlockingPass::runOnOperation() XeGPUBlocking.cpp:0:0
#19 0x0000556695abcbf1 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb3c2bf1)
#20 0x0000556695abcf80 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb3c2f80)
#21 0x0000556695abf034 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb3c5034)
#22 0x0000556695ac00c1 mlir::PassManager::run(mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb3c60c1)
#23 0x000055668cd7b86b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#24 0x000055668cd7c313 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, mlir::SourceMgrDiagnosticVerifierHandler*, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#25 0x000055668cd7c59b llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, 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&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#26 0x0000556695e97b45 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::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb79db45)
#27 0x000055668cd726a4 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (.part.0) MlirOptMain.cpp:0:0
#28 0x000055668cd7cab7 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2682ab7)
#29 0x000055668cd7ccf3 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2682cf3)
#30 0x000055668cbe2aec main (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x24e8aec)
#31 0x00007fbaa6bb1083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#32 0x000055668cc9267e _start (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x259867e)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to