[Mlir-commits] [mlir] [MLIR][XeGPU] Add unroll patterns and blocking pass for XeGPU (1/N) (PR #137010)
Chao Chen
llvmlistbot at llvm.org
Mon May 19 09:14:30 PDT 2025
chencha3 wrote:
> I'm seeing a regression on 32-bit platforms from this change:
>
> ```
> FAIL: MLIR :: Dialect/XeGPU/xegpu-unroll-patterns.mlir (1488 of 2894)
> ******************** TEST 'MLIR :: Dialect/XeGPU/xegpu-unroll-patterns.mlir' FAILED ********************
> Exit Code: 2
>
> Command Output (stdout):
> --
> # RUN: at line 1
> /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/mlir-opt --test-xegpu-unrolling-patterns -split-input-file /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir/test/Dialect/XeGPU/xegpu-unroll-patterns.mlir | /usr/lib/llvm/21/bin/FileCheck /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir/test/Dialect/XeGPU/xegpu-unroll-patterns.mlir
> # executed command: /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/mlir-opt --test-xegpu-unrolling-patterns -split-input-file /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir/test/Dialect/XeGPU/xegpu-unroll-patterns.mlir
> # .---command stderr------------
> # | mlir-opt: /usr/lib/llvm/21/include/llvm/ADT/SmallVector.h:291: T& llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::operator[](size_type) [with T = long long int; <template-parameter-1-2> = void; reference = long long int&; size_type = unsigned int]: 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: /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/mlir-opt --test-xegpu-unrolling-patterns -split-input-file /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir/test/Dialect/XeGPU/xegpu-unroll-patterns.mlir
> # | #0 0xffffffffe5e86ef0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/21/lib/libLLVM.so.21.0gitaaaae996+0xc45ef0)
> # | #1 0xffffffffe5e8747f (/usr/lib/llvm/21/lib/libLLVM.so.21.0gitaaaae996+0xc4647f)
> # | #2 0xffffffffe5e84095 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/21/lib/libLLVM.so.21.0gitaaaae996+0xc43095)
> # | #3 0xffffffffe5e8422b (/usr/lib/llvm/21/lib/libLLVM.so.21.0gitaaaae996+0xc4322b)
> # | #4 0xfffffffff7f8d5a0 (linux-gate.so.1+0x5a0)
> # | #5 0xfffffffff7f8d579 (linux-gate.so.1+0x579)
> # | #6 0xffffffffe4de7d07 (/usr/lib/libc.so.6+0x93d07)
> # | #7 0xffffffffe4d8c581 raise (/usr/lib/libc.so.6+0x38581)
> # | #8 0xffffffffe4d732d8 abort (/usr/lib/libc.so.6+0x1f2d8)
> # | #9 0xffffffffe4d731de (/usr/lib/libc.so.6+0x1f1de)
> # | #10 0xffffffffe4d8450b (/usr/lib/libc.so.6+0x3050b)
> # | #11 0xfffffffff58af00d mlir::computeSuffixProduct(llvm::ArrayRef<long long>) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x4c3200d)
> # | #12 0xfffffffff58b176c mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl(llvm::ArrayRef<long long>, llvm::ArrayRef<long long>, llvm::ArrayRef<long long>) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x4c3476c)
> # | #13 0xfffffffff2db29fc mlir::StaticTileOffsetRange::StaticTileOffsetRange(llvm::ArrayRef<long long>, llvm::ArrayRef<long long>) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x21359fc)
> # | #14 0xfffffffff5b7c52a (anonymous namespace)::UnrollPattern<mlir::xegpu::StoreNdOp>::pack(mlir::Value, mlir::TypeRange, llvm::ArrayRef<long long>, mlir::Location, mlir::PatternRewriter&) const XeGPUUnroll.cpp:0:0
> # | #15 0xfffffffff5b7ef4e (anonymous namespace)::UnrollStoreNdOp::matchAndRewrite(mlir::xegpu::StoreNdOp, mlir::PatternRewriter&) const XeGPUUnroll.cpp:0:0
> # | #16 0xfffffffff5b7b2ee mlir::detail::OpOrInterfaceRewritePatternBase<mlir::xegpu::StoreNdOp>::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x4efe2ee)
> # | #17 0xfffffffff5da80ba 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
> # | #18 0xfffffffff5da8f4e 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&)>) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x512bf4e)
> # | #19 0xfffffffff61ade63 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
> # | #20 0xfffffffff61b029e mlir::applyPatternsGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x553329e)
> # | #21 0x5700059d (anonymous namespace)::TestXeGPUUnrollingPatterns::runOnOperation() TestXeGPUTransforms.cpp:0:0
> # | #22 0xfffffffff5d6d371 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x50f0371)
> # | #23 0xfffffffff5d6d8b4 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x50f08b4)
> # | #24 0xfffffffff5d6dd8d mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::'lambda'(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&)::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
> # | #25 0xfffffffff5d6c3a4 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/
> work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x50ef3a4)
> # | #26 0xfffffffff5d6d094 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned in
> t) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x50f0094)
> # | #27 0xfffffffff5d6d8b4 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager,
> bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/var/tmp/portage/llvm-core/mlir-21.
> 0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x50f08b4)
> # | #28 0xfffffffff5d6ed93 mlir::PassManager::run(mlir::Operation*) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x50f1d93)
> # | #29 0xfffffffff613a8e6 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
> # | #30 0xfffffffff613b1d0 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&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(int, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
> # | #31 0xfffffffff5df3ceb 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)::'lambda'(llvm::StringRef)::operator()(llvm::StringRef) const ToolUtilities.cpp:0:0
> # | #32 0xfffffffff5df4425 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) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x5177425)
> # | #33 0xfffffffff6132e39 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x54b5e39)
> # | #34 0xfffffffff613b516 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x54be516)
> # | #35 0xfffffffff613ba51 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/../lib/libMLIR.so.21.0gitaaaae996+0x54bea51)
> # | #36 0x568ff7ac main (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/mlir-opt+0x3237ac)
> # | #37 0xffffffffe4d74f83 (/usr/lib/libc.so.6+0x20f83)
> # | #38 0xffffffffe4d75048 __libc_start_main (/usr/lib/libc.so.6+0x21048)
> # | #39 0x568fff97 _start (/var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir_build-abi_x86_32.x86/bin/mlir-opt+0x323f97)
> # `-----------------------------
> # error: command failed with exit status: -6
> # executed command: /usr/lib/llvm/21/bin/FileCheck /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir/test/Dialect/XeGPU/xegpu-unroll-patterns.mlir
> # .---command stderr------------
> # | FileCheck error: '<stdin>' is empty.
> # | FileCheck command line: /usr/lib/llvm/21/bin/FileCheck /var/tmp/portage/llvm-core/mlir-21.0.0.9999/work/mlir/test/Dialect/XeGPU/xegpu-unroll-patterns.mlir
> # `-----------------------------
> # error: command failed with exit status: 2
>
> --
>
> ********************
> ```
Hi @mgorny, it is fixed here: https://github.com/llvm/llvm-project/pull/140567
https://github.com/llvm/llvm-project/pull/137010
More information about the Mlir-commits
mailing list