-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: encountered operand produced by an unsupported operation "arith.extsi" #125
Comments
I used [16:48:00] colawithsauce@SPQR /home/colawithsauce/Projects/Triton/triton_shared
> triton-opt ~/playground/test.mlir| triton-shared-opt --triton-to-linalg-experimental
PtrAnalysis: encountered addptr operand produced by an unsupported operation
%27 = arith.extsi %26 : tensor<64xi32> to tensor<64xi64>
<stdin>:77:13: remark: PtrAnalysis: Failed to rewrite AddPtrOp
%90 = tt.addptr %23, %89 : tensor<64x32x!tt.ptr<f16, 1>>, tensor<64x32xi64>
^
<stdin>:77:13: note: see current operation: %92 = tt.addptr %24, %91 : tensor<64x32x!tt.ptr<f16, 1>>, tensor<64x32xi64>
<stdin>:83:13: remark: PtrAnalysis: pointer is not replace with tts.make_tptr so loadOp cannot be rewritten
%96 = tt.load %90, %95 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<64x32xf16>
^
<stdin>:83:13: note: see current operation: %98 = tt.load %92, %97 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<64x32xf16>
<stdin>:83:13: remark: PtrAnalysis: Failed to rewrite LoadOp
%96 = tt.load %90, %95 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<64x32xf16>
^
<stdin>:83:13: note: see current operation: %98 = tt.load %92, %97 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<64x32xf16>
PtrAnalysis: encountered addptr operand produced by an unsupported operation
%34 = arith.extsi %33 : tensor<32xi32> to tensor<32xi64>
<stdin>:90:14: remark: PtrAnalysis: Failed to rewrite AddPtrOp
%103 = tt.addptr %40, %102 : tensor<32x128x!tt.ptr<f16, 1>>, tensor<32x128xi64>
^
<stdin>:90:14: note: see current operation: %106 = tt.addptr %41, %104 : tensor<32x128x!tt.ptr<f16, 1>>, tensor<32x128xi64>
<stdin>:96:14: remark: PtrAnalysis: pointer is not replace with tts.make_tptr so loadOp cannot be rewritten
%109 = tt.load %103, %108 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<32x128xf16>
^
<stdin>:96:14: note: see current operation: %112 = tt.load %106, %111 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<32x128xf16>
<stdin>:96:14: remark: PtrAnalysis: Failed to rewrite LoadOp
%109 = tt.load %103, %108 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<32x128xf16>
^
<stdin>:96:14: note: see current operation: %112 = tt.load %106, %111 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<32x128xf16>
PtrAnalysis: encountered addptr operand produced by an unsupported operation
%62 = arith.extsi %61 : tensor<64xi32> to tensor<64xi64>
<stdin>:120:11: remark: PtrAnalysis: Failed to rewrite AddPtrOp
%73 = tt.addptr %57, %72 : tensor<64x128x!tt.ptr<f16, 1>>, tensor<64x128xi64>
^
<stdin>:120:11: note: see current operation: %75 = tt.addptr %59, %74 : tensor<64x128x!tt.ptr<f16, 1>>, tensor<64x128xi64>
<stdin>:132:5: remark: PtrAnalysis: pointer is not replace with tts.make_tptr so storeOp cannot be rewritten
tt.store %73, %55, %84 {cache = 1 : i32, evict = 1 : i32} : tensor<64x128xf16>
^
<stdin>:132:5: note: see current operation: tt.store %75, %57, %86 {cache = 1 : i32, evict = 1 : i32} : tensor<64x128xf16>
<stdin>:132:5: remark: PtrAnalysis: Failed to rewrite StoreOp
tt.store %73, %55, %84 {cache = 1 : i32, evict = 1 : i32} : tensor<64x128xf16>
^
<stdin>:132:5: note: see current operation: tt.store %75, %57, %86 {cache = 1 : i32, evict = 1 : i32} : tensor<64x128xf16>
LLVM ERROR: Failed to infer result type(s).
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: triton-shared-opt --triton-to-linalg-experimental
#0 0x00006282cf875087 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x242a087)
#1 0x00006282cf872bae llvm::sys::RunSignalHandlers() (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x2427bae)
#2 0x00006282cf87573f SignalHandler(int) Signals.cpp:0:0
#3 0x000077b037e54eb0 __restore_rt (/nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6+0x3deb0)
#4 0x000077b037ea407c __pthread_kill_implementation (/nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6+0x8d07c)
#5 0x000077b037e54e06 gsignal (/nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6+0x3de06)
#6 0x000077b037e3d8f5 abort (/nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6+0x268f5)
#7 0x00006282cf836d00 llvm::report_fatal_error(llvm::Twine const&, bool) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x23ebd00)
#8 0x00006282cf836b18 (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x23ebb18)
#9 0x00006282ce3f05b1 (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0xfa55b1)
#10 0x00006282cd97a18f mlir::memref::ExtractStridedMetadataOp mlir::OpBuilder::create<mlir::memref::ExtractStridedMetadataOp, mlir::Value&>(mlir::Location, mlir::Value&) /home/colawithsauce/.triton/llvm/llvm-4017f04e-ubuntu-x64/include/mlir/IR/Builders.h:509:16
#11 0x00006282cd978648 (anonymous namespace)::ScalarAddptrConverter::matchAndRewrite(mlir::triton::AddPtrOp, mlir::triton::AddPtrOpAdaptor, mlir::ConversionPatternRewriter&) const /home/colawithsauce/Projects/Triton/triton_shared/lib/Conversion/StructuredToMemref/StructuredToMemref.cpp:766:18
#12 0x00006282cd8ce5af mlir::OpConversionPattern<mlir::triton::AddPtrOp>::matchAndRewrite(mlir::Operation*, llvm::ArrayRef<mlir::Value>, mlir::ConversionPatternRewriter&) const /home/colawithsauce/.triton/llvm/llvm-4017f04e-ubuntu-x64/include/mlir/Transforms/DialectConversion.h:538:3
#13 0x00006282cf44ed50 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x2003d50)
#14 0x00006282cf488194 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>)::$_2::operator()() const PatternApplicator.cpp:0:0
#15 0x00006282cf484caf mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x2039caf)
#16 0x00006282cf45c315 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) DialectConversion.cpp:0:0
#17 0x00006282cf451f44 (anonymous namespace)::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>, llvm::function_ref<void (mlir::Diagnostic&)>) DialectConversion.cpp:0:0
#18 0x00006282cf4551e0 mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>*) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x200a1e0)
#19 0x00006282cd97b2d3 (anonymous namespace)::StructuredToMemrefPass::runOnOperation() /home/colawithsauce/Projects/Triton/triton_shared/lib/Conversion/StructuredToMemref/StructuredToMemrefPass.cpp:141:16
#20 0x00006282ced366a6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18eb6a6)
#21 0x00006282ced36e41 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18ebe41)
#22 0x00006282ced3b4e8 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (mlir::OpPassManager&, mlir::Operation*)>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_6>(long, mlir::OpPassManager&, mlir::Operation*) Pass.cpp:0:0
#23 0x00006282cd961389 mlir::LogicalResult::failed() const /home/colawithsauce/.triton/llvm/llvm-4017f04e-ubuntu-x64/include/mlir/Support/LogicalResult.h:44:33
#24 0x00006282cd961389 mlir::failed(mlir::LogicalResult) /home/colawithsauce/.triton/llvm/llvm-4017f04e-ubuntu-x64/include/mlir/Support/LogicalResult.h:72:58
#25 0x00006282cd961389 (anonymous namespace)::TritonToLinalgExperimentalPass::runOnOperation() /home/colawithsauce/Projects/Triton/triton_shared/lib/Conversion/TritonToLinalgExperimental/TritonToLinalgExperimentalPass.cpp:55:9
#26 0x00006282ced366a6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18eb6a6)
#27 0x00006282ced36e41 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18ebe41)
#28 0x00006282ced3927b mlir::PassManager::run(mlir::Operation*) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18ee27b)
#29 0x00006282ced3359f performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#30 0x00006282ced327bd mlir::LogicalResult llvm::function_ref<mlir::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&)::$_2>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#31 0x00006282cf803f89 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x23b8f89)
#32 0x00006282ced2dbfa mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18e2bfa)
#33 0x00006282ced2dd96 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18e2d96)
#34 0x00006282ced2e146 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x18e3146)
#35 0x00006282cd9e3bcb main /home/colawithsauce/Projects/Triton/triton_shared/tools/triton-shared-opt/triton-shared-opt.cpp:16:33
#36 0x000077b037e3f0ce __libc_start_call_main (/nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6+0x280ce)
#37 0x000077b037e3f189 __libc_start_main@GLIBC_2.2.5 (/nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6+0x28189)
#38 0x00006282cd717c75 _start (/home/colawithsauce/Projects/Triton/triton/python/build/cmake.linux-x86_64-cpython-3.11/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt+0x2ccc75)
fish: Process 424253, 'triton-shared-opt' from job 1, 'triton-opt ~/playground/test.ml…' terminated by signal SIGABRT (Abort) |
Thank you for the report for both the legacy and experimental passes! This looks like a matmul kernel -- perhaps from the official triton tutorial? I will take a closer look. It has been a while since we last updated the tutorial kernel tests. But if this is the official one, it's definitely important that we fix it. |
@nhat-nguyen yes, it is indeed from triton tutorial, I only did some changes on the kernel's caller, and left the kernel un-modified. |
@nhat-nguyen, this code is from triton's tutorial I search block pointer on triton's issue page, I found this comment from its contributor: triton-lang/triton#1946 (comment) I guess Thanks for your attention! |
Triton python code
Triton IR
Crash log
Additional information
The text was updated successfully, but these errors were encountered: