iree-org / iree-org/iree

Does iree-compile support llvm dialect as input?

Open
#22,285 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.9k
Forks
1k
Avg merge
4d 16h
Merged PRs (30d)
47

Description

Instruction:
```
iree-compile \
/workdir/mppo/torch-mlir-pass/IR/llvm/resnet18.mlir \
--iree-hal-target-device=local \
--iree-hal-local-target-device-backends=llvm-cpu \
--iree-llvmcpu-target-cpu=host \
-o ./vmfb/resnet18.vmfb
```

error:
```
(torch-mlir) root@30622e2c2282:/workdir/mppo/torch-mlir-pass# iree-compile \
/workdir/mppo/torch-mlir-pass/IR/llvm/mlp.mlir \
--iree-hal-target-device=local \
--iree-hal-local-target-device-backends=llvm-cpu \
--iree-llvmcpu-target-cpu=host \
-o ./vmfb/mlp.vmfb
Please report issues to https://github.com/iree-org/iree/issues and include the crash backtrace.
Stack dump:
0. Program arguments: /root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/tools/../_mlir_libs/iree-compile /workdir/mppo/torch-mlir-pass/IR/llvm/mlp.mlir --iree-hal-target-device=local --iree-hal-local-target-device-backends=llvm-cpu --iree-llvmcpu-target-cpu=host -o ./vmfb/mlp.vmfb
#0 0x00007e9e6477b8a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0x63b48a8)
#1 0x00007e9e6477921e llvm::sys::RunSignalHandlers() (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0x63b221e)
#2 0x00007e9e6477c736 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007e9e5e1db520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007e9e64851d43 mlir::MLIRContext::isMultithreadingEnabled() (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0x648ad43)
#5 0x00007e9e6a0a63f2 mlir::TypeConverter::convertType(mlir::Type, llvm::SmallVectorImpl&) const (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0xbcdf3f2)
#6 0x00007e9e6a0a6b0f mlir::TypeConverter::isLegal(mlir::Type) const (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0xbcdfb0f)
#7 0x00007e9e66a8aeb8 llvm::detail::indexed_accessor_range_base, mlir::Type, mlir::Type, mlir::Type>::iterator std::__find_if, mlir::Type, mlir::Type, mlir::Type>::iterator, __gnu_cxx::__ops::_Iter_negate>(llvm::detail::indexed_accessor_range_base, mlir::Type, mlir::Type, mlir::Type>::iterator, llvm::detail::indexed_accessor_range_base, mlir::Type, mlir::Type, mlir::Type>::iterator, __gnu_cxx::__ops::_Iter_negate, std::random_access_iterator_tag) Patterns.cpp:0:0
#8 0x00007e9e6a0a6cf5 mlir::TypeConverter::isSignatureLegal(mlir::FunctionType) const (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0xbcdfcf5)
#9 0x00007e9e664141f2 mlir::iree_compiler::InputConversion::(anonymous namespace)::ConvertTypesPass, mlir::iree_compiler::InputConversion::(anonymous namespace)::DemoteF64ToF32Converter>::runOnOperation() ConvertPrimitiveType.cpp:0:0
#10 0x00007e9e64aebadb mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0x6724adb)
#11 0x00007e9e64aeeeeb mlir::PassManager::run(mlir::Operation*) (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0x6727eeb)
#12 0x00007e9e646c85f2 ireeCompilerInvocationPipeline (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/_mlir_libs/libIREECompiler.so+0x63015f2)
#13 0x00007e9e648f453d mlir::iree_compiler::runIreecMain(int, char**)::$_2::operator()(iree_compiler_source_t*) const iree_compile_lib.cc:0:0
#14 0x00007e9e648f3da0 mlir::iree_compiler::runIreecMain(int, char**) iree_compile_lib.cc:0:0
#15 0x00007e9e5e1c2d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#16 0x00007e9e5e1c2e40 call_init ./csu/../csu/libc-start.c:128:20
#17 0x00007e9e5e1c2e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#18 0x00000000002016ae _start (/root/miniconda3/envs/torch-mlir/lib/python3.11/site-packages/iree/compiler/tools/../_mlir_libs/iree-compile+0x2016ae)
(torch-mlir) root@30622e2c2282:/workdir/mppo/torch-mlir-pass#
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash with the provided iree-compile command and MLIR input, then inspect the input-conversion path around ConvertPrimitiveType.cpp and the entry point in iree_compile_lib.cc. Determine whether LLVM dialect input is supported and what behavior is expected when it is not; done means a non-crashing, verified result for the reported command.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.