Issue |
130074
|
Summary |
[MLIR] Assertion `llvm::all_of(basis, [](int64_t s) { return s > 0; }) && "basis must be nonnegative"' failed.
|
Labels |
mlir
|
Assignees |
|
Reporter |
RiRi114
|
Test on commit: 0f9720a6
steps to reproduceļ¼
`mlir-opt temp.mlir -transform-interpreter
`
test case:
```mlir
module {
func.func @matrix_addition(%a: memref<2 x 2 x f32>, %b: memref<2 x 2 x f32>, %result: memref<2 x 2 x f32>, %stream: !gpu.async.token) -> memref<2 x 2 x f32> {
%zero = arith.constant 0 : index
%two = arith.constant 2 : index
%name = gpu.launch async[%stream] blocks(%arg3, %arg4, %arg5) in (%arg9 = %zero, %arg10 = %zero, %arg11 = %zero) threads(%arg6, %arg7, %arg8) in (%arg12 = %zero, %arg13 = %zero, %arg14 = %zero) {
scf.forall (%i, %j) in (%zero, %two) {
%valA = memref.load %a[%i, %j] : memref<2 x 2 x f32>
%valB = memref.load %b[%i, %j] : memref<2 x 2 x f32>
%sum = arith.addf %valA, %valB : f32
memref.store %sum, %result[%i, %j] : memref<2 x 2 x f32>
} { mapping = [#gpu.thread<y>, #gpu.thread<x>] }
gpu.terminator
}
return %result : memref<2 x 2 x f32>
}
module attributes {transform.with_named_sequence} {
transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {
%funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!transform.any_op) -> !transform.any_op
transform.gpu.map_nested_forall_to_threads %funcop block_dims = [2, 2, 1] : (!transform.any_op) -> !transform.any_op
transform.yield
}
}
}
```
crash trace:
```
mlir-opt: /home/llvm-project/mlir/lib/Dialect/Utils/IndexingUtils.cpp:93: int64_t mlir::computeProduct(ArrayRef<int64_t>): Assertion `llvm::all_of(basis, [](int64_t s) { return s > 0; }) && "basis must be nonnegative"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/fuzzing/llvm-project/build/bin/mlir-opt temp.mlir -transform-interpreter
#0 0x000000000113ce77 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x113ce77)
#1 0x000000000113aa0e llvm::sys::RunSignalHandlers() (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x113aa0e)
#2 0x000000000113d855 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x0000717cefc68520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x0000717cefcbc9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x0000717cefc68476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x0000717cefc4e7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x0000717cefc4e71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x0000717cefc5fe96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00000000069f9750 mlir::linearize(llvm::ArrayRef<long>, llvm::ArrayRef<long>) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x69f9750)
#10 0x000000000194df72 mlir::transform::gpu::mapOneForallToThreadsImpl(mlir::RewriterBase&, std::optional<mlir::transform::TransformOpInterface>, mlir::scf::ForallOp, llvm::ArrayRef<long>, long, bool) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x194df72)
#11 0x000000000195c321 mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<std::enable_if<(!(llvm::is_one_of<mlir::scf::ForallOp, mlir::Operation*, mlir::Region*, mlir::Block*>::value)) && (std::is_same<mlir::WalkResult, mlir::WalkResult>::value), mlir::WalkResult>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::ForwardIterator, mlir::transform::gpu::mapNestedForallToThreadsImpl(mlir::RewriterBase&, std::optional<mlir::transform::TransformOpInterface>, mlir::Operation*, llvm::ArrayRef<long>, long, bool)::$_8, mlir::scf::ForallOp, mlir::WalkResult>(mlir::Operation*, mlir::transform::gpu::mapNestedForallToThreadsImpl(mlir::RewriterBase&, std::optional<mlir::transform::TransformOpInterface>, mlir::Operation*, llvm::ArrayRef<long>, long, bool)::$_8&&)::'lambda'(mlir::Operation*)>(long, mlir::Operation*) GPUTransformOps.cpp:0:0
#12 0x00000000012714f7 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x12714f7)
#13 0x000000000194f413 mlir::transform::gpu::mapNestedForallToThreadsImpl(mlir::RewriterBase&, std::optional<mlir::transform::TransformOpInterface>, mlir::Operation*, llvm::ArrayRef<long>, long, bool) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x194f413)
#14 0x000000000194fe11 mlir::transform::MapNestedForallToThreads::applyToOne(mlir::transform::TransformRewriter&, mlir::Operation*, mlir::transform::ApplyToEachResultList&, mlir::transform::TransformState&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x194fe11)
#15 0x0000000001968962 mlir::DiagnosedSilenceableFailure mlir::transform::detail::applyTransformToEach<mlir::transform::MapNestedForallToThreads, llvm::iterator_range<llvm::filter_iterator_impl<mlir::Operation* const*, mlir::transform::TransformState::getPayloadOps(mlir::Value) const::'lambda'(mlir::Operation*), std::bidirectional_iterator_tag> >&>(mlir::transform::MapNestedForallToThreads, mlir::transform::TransformRewriter&, llvm::iterator_range<llvm::filter_iterator_impl<mlir::Operation* const*, mlir::transform::TransformState::getPayloadOps(mlir::Value) const::'lambda'(mlir::Operation*), std::bidirectional_iterator_tag> >&, llvm::SmallVectorImpl<mlir::transform::ApplyToEachResultList>&, mlir::transform::TransformState&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x1968962)
#16 0x00000000019683da mlir::transform::TransformEachOpTrait<mlir::transform::MapNestedForallToThreads>::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x19683da)
#17 0x0000000001968051 mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::MapNestedForallToThreads>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x1968051)
#18 0x00000000069e7466 mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x69e7466)
#19 0x0000000003a4fe30 applySequenceBlock(mlir::Block&, mlir::transform::FailurePropagationMode, mlir::transform::TransformState&, mlir::transform::TransformResults&) TransformOps.cpp:0:0
#20 0x0000000003a53ec6 mlir::transform::NamedSequenceOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x3a53ec6)
#21 0x00000000039fc621 mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::NamedSequenceOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x39fc621)
#22 0x00000000069e7466 mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x69e7466)
#23 0x00000000069f3211 mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value> > const&, mlir::transform::TransformOptions const&, bool, llvm::function_ref<void (mlir::transform::TransformState&)>, llvm::function_ref<llvm::LogicalResult (mlir::transform::TransformState&)>) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x69f3211)
#24 0x0000000003a86324 mlir::transform::applyTransformNamedSequence(mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value> >, mlir::transform::TransformOpInterface, mlir::ModuleOp, mlir::transform::TransformOptions const&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x3a86324)
#25 0x0000000003a81188 (anonymous namespace)::InterpreterPass::runOnOperation() InterpreterPass.cpp:0:0
#26 0x00000000042452f7 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x42452f7)
#27 0x0000000004245b61 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x4245b61)
#28 0x000000000424825b mlir::PassManager::run(mlir::Operation*) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x424825b)
#29 0x00000000042408af performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#30 0x0000000004240503 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&)::$_3>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#31 0x00000000042ec4e8 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) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x42ec4e8)
#32 0x000000000423a151 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x423a151)
#33 0x000000000423a403 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x423a403)
#34 0x000000000423a612 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x423a612)
#35 0x000000000111a8d7 main (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x111a8d7)
#36 0x0000717cefc4fd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#37 0x0000717cefc4fe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#38 0x000000000111a435 _start (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x111a435)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs