| Issue |
208902
|
| Summary |
[mlir](convert-xegpu-to-xevm) mlir-opt crashes at XeGPUToXeVM.cpp:722 with assertion `llvm::count_if(vecType.getShape(), [](int64_t d) { return d != 1; }) <= 1 && "Expected either 1D vector or nD with unit dimensions"' failed.
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
Aran-414
|
git version: e2223e665eccd0580c3f1c9d4d31b2262a8ca823
MLIR Program:
```mlir
module {
func.func @m(%arg0: index) {
%alloca = memref.alloca() : memref<4x8xf32, 3>
%0 = xegpu.create_mem_desc %alloca : memref<4x8xf32, 3> -> !xegpu.mem_desc<4x8xf32>
%1 = xegpu.load_matrix %0[0, 0] : !xegpu.mem_desc<4x8xf32> -> vector<4x8xf32>
return
}
}
```
Reproduce Command: `mlir-opt -convert-xegpu-to-xevm a.mlir`
StackTrace:
```
mlir-opt: /data2/dependency/dev/llvm-project/mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp:722: llvm::LogicalResult {anonymous}::LoadStoreMatrixToXeVMPattern<OpType, <template-parameter-1-2> >::matchAndRewrite(OpType, typename OpType::Adaptor, mlir::ConversionPatternRewriter&) const [with OpType = mlir::xegpu::LoadMatrixOp; <template-parameter-1-2> = void; typename OpType::Adaptor = mlir::xegpu::LoadMatrixOpAdaptor]: Assertion `llvm::count_if(vecType.getShape(), [](int64_t d) { return d != 1; }) <= 1 && "Expected either 1D vector or nD with unit dimensions"' 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 -convert-xegpu-to-xevm a.mlir
#0 0x00005618caed07ef llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1fc57ef)
#1 0x00005618caeccf8c llvm::sys::RunSignalHandlers() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1fc1f8c)
#2 0x00005618caecd12f SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f5f2d4b3420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f5f2cf9e00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f5f2cf7d859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f5f2cf7d729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f5f2cf8efd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x00005618cfaa3a5d (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x6b98a5d)
#9 0x00005618cfa97c95 llvm::LogicalResult mlir::ConversionPattern::dispatchTo1To1<mlir::OpConversionPattern<mlir::xegpu::LoadMatrixOp>, mlir::xegpu::LoadMatrixOp>(mlir::OpConversionPattern<mlir::xegpu::LoadMatrixOp> const&, mlir::xegpu::LoadMatrixOp, mlir::xegpu::LoadMatrixOp::GenericAdaptor<llvm::ArrayRef<mlir::ValueRange>>, mlir::ConversionPatternRewriter&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x6b8cc95)
#10 0x00005618cfa97e05 mlir::OpConversionPattern<mlir::xegpu::LoadMatrixOp>::matchAndRewrite(mlir::Operation*, llvm::ArrayRef<mlir::ValueRange>, mlir::ConversionPatternRewriter&) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x6b8ce05)
#11 0x00005618d3d64d28 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xae59d28)
#12 0x00005618d3dabc02 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
#13 0x00005618d3dad168 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+0xaea2168)
#14 0x00005618d3d5f86b (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*) DialectConversion.cpp:0:0
#15 0x00005618d3d5fd56 mlir::OperationConverter::convert(mlir::Operation*, bool) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xae54d56)
#16 0x00005618d3d6ad2a mlir::OperationConverter::applyConversion(llvm::ArrayRef<mlir::Operation*>) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xae5fd2a)
#17 0x00005618d3d6c5e8 applyConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig, (anonymous namespace)::OpConversionMode) DialectConversion.cpp:0:0
#18 0x00005618d3d6c7c6 mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xae617c6)
#19 0x00005618cfa951d9 (anonymous namespace)::ConvertXeGPUToXeVMPass::runOnOperation() XeGPUToXeVM.cpp:0:0
#20 0x00005618d3e17721 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf0c721)
#21 0x00005618d3e17ab0 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+0xaf0cab0)
#22 0x00005618d3e19b64 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf0eb64)
#23 0x00005618d3e1abe1 mlir::PassManager::run(mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf0fbe1)
#24 0x00005618caf966db performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#25 0x00005618caf9721f 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
#26 0x00005618caf9744b 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
#27 0x00005618d41e7015 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+0xb2dc015)
#28 0x00005618caf8d494 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
#29 0x00005618caf97967 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x208c967)
#30 0x00005618caf97ba3 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x208cba3)
#31 0x00005618cae158ac main (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1f0a8ac)
#32 0x00007f5f2cf7f083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#33 0x00005618caeacdbe _start (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x1fa1dbe)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs