Open john-kan-2 opened 8 months ago
I ran everything again, reinstalled things, ran into the same issue:
$ scalehls-opt resnet18.mlir > -hida-pytorch-p> -hida-pytorch-pipeline="top-func=forward loop-tile-size=8 loop-unroll-factor=4" | scalehls-translate -scalehls-emit-hlscpp > resnet18.cpp
scalehls-opt: /home/johnkan/scale_test2/scalehls-hida/lib/Dialect/HLS/Utils.cpp:514: mlir::LogicalResult mlir::scalehls::getEvenlyDistributedFactors(unsigned int, mlir::scalehls::FactorList &, const SmallVectorImpl
我再次运行了所有程序,重新安装了一些东西,遇到了同样的问题:
$ scalehls-opt resnet18.mlir > -hida-pytorch-p> -hida-pytorch-pipeline="top-func=forward loop-tile-size=8 loop-unroll-factor=4" | scalehls-translate -scalehls-emit-hlscpp > resnet18.cpp
scalehls-opt:/home/johnkan/scale_test2/scalehls-hida/lib/Dialect/HLS/Utils.cpp:514:mlir::LogicalResult mlir::scalehls::getEvenlyDistributedFactors(unsigned int, mlir::scalehls::FactorList &, const SmallVectorImplmlir::AffineForOp &, const SmallVectorImplmlir::scalehls::FactorList &, bool): 断言“tripCount.value() % constrFactors[loop.index()] == 0 &&“contraint factor isn't divisor of opposite of opposite trip count””失败。请向https://github.com/llvm/llvm-project/issues/ 提交错误报告并附上崩溃回溯。 堆栈转储: 0。程序参数:scalehls-opt resnet18.mlir“-hida-pytorch-pipeline=top-func=forward loop-tile-size=8 loop-unroll-factor=4” # 0 0x00005627f753ca4a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)/home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:569:11#1 0x00005627f753cbfb PrintStackTraceSignalHandler(void) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:636:1 #2 0x00005627f753b246 llvm::sys::RunSignalHandlers() /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Signals.cpp:104:5 #3 0x00005627f753d325 SignalHandler(int) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1 #4 0x00007f0400881520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)#5 0x00007f04008d59fc __pthread_kill_implementation./nptl/pthread_kill.c:44:76#6 0x00007f04008d59fc __pthread_kill_internal./nptl/pthread_kill.c:78:10#7 0x00007f04008d59fc pthread_kill./nptl/pthread_kill.c:89:10#8 0x00007f0400881476 gsignal./signal/../sysdeps/posix/raise.c:27:6#9 0x00007f04008677f3 中止./stdlib/abort.c:81:7 #10 0x00007f040086771b _nl_load_domain ./intl/loadmsgcat.c:1177:9 #11 0x00007f0400878e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96) #12 0x00005627f58a4cf1 mlir::scalehls::getEvenlyDistributedFactors(unsigned int, llvm::SmallVector<unsigned int, 8u>&, llvm::SmallVectorImplmlir::AffineForOp const&, llvm::SmallVectorImpl<llvm::SmallVector<unsigned int, 8u>> const&, bool) /home/johnkan/scale_test2/scalehls-hida/lib/Dialect/HLS/Utils.cpp:515:7 #13 0x00005627f63f03c6 (匿名命名空间)::ParallelizeDataflowNode::applyCorrelationAwareUnroll(mlir::func::FuncOp) /home/johnkan/scale_test2/scalehls-hida/lib/Transforms/Dataflow/ParallelizeDataflowNode.cpp:276:18 #14 0x00005627f63ef5f7 (匿名命名空间)::ParallelizeDataflowNode::runOnOperation() /home/johnkan/scale_test2/scalehls-hida/lib/Transforms/Dataflow/ParallelizeDataflowNode.cpp:325:7 #15 0x00005627f706924a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass、mlir::Operation、mlir::AnalysisManager、bool、无符号整数) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:462:21 #16 0x00005627f7069844 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&、mlir::Operation、mlir::AnalysisManager、bool、无符号整数、mlir::PassInstrumentor、mlir::PassInstrumentation::PipelineParentInfo const) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:525:16 #17 0x00005627f706ecf8 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:745:36 #18 0x00005627f706e969 mlir::LogicalResult mlir::failableParallelForEach<gnu_cxx::normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocatormlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext, gnu_cxx::normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocatormlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>, __gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocatormlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/include/mlir/IR/Threading.h:46:18 #19 0x00005627f706ab23 mlir::LogicalResult mlir::failableParallelForEach<std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocatormlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocatormlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/include/mlir/IR/Threading.h:92:10 #20 0x00005627f706a3c6 mlir::详细信息::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)/home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:755:14 #21 0x00005627f70694f7 mlir::detail::OpToOpPassAdaptor::runOnOperation(bool) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:646:5 #22 0x00005627f706923b mlir::detail::OpToOpPassAdaptor::run(mlir::Pass, mlir::Operation, mlir::AnalysisManager, bool, unsigned int) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:459:5 #23 0x00005627f7069844 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&、mlir::Operation、mlir::AnalysisManager、bool、无符号整数、mlir::PassInstrumentor、mlir::PassInstrumentation::PipelineParentInfo const)/home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:525:16 #24 0x00005627f706b10c mlir::PassManager::runPasses(mlir::Operation、mlir::AnalysisManager)/home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:828:10 #25 0x00005627f706b02c mlir::PassManager::run(mlir::Operation) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:808:60 #26 0x00005627f62b6a22 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:91:17 #27 0x00005627f62b6689 processBuffer(llvm::raw_ostream&,std::unique_ptr<llvm::MemoryBuffer,std::default_deletellvm::MemoryBuffer>,bool,bool,bool,bool,bool,bool,llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>,mlir::DialectRegistry&,llvm::ThreadPool)/home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:139:12 #28 0x00005627f62b6468 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::raw_ostream&) const /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:181:12 #29 0x00005627f62b635d mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::raw_ostream&) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12 #30 0x00005627f73b8819 llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::raw_ostream&)>::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::raw_ostream&) const /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12 #31 0x00005627f73b7df5 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, llvm::raw_ostream&)>, llvm::raw_ostream&,bool,bool)/home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Support/ToolUtilities.cpp:28:12 #32 0x00005627f62b53c3 mlir::MlirOptMain(llvm::raw_ostream&,std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>,llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>,mlir::DialectRegistry&,bool,bool,bool,bool,bool,bool,bool) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:186:10 #33 0x00005627f62b555f mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_deletellvm::MemoryBuffer>, mlir::PassPipelineCLParser const&, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool, bool) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:209:10 #34 0x00005627f62b6177 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) /home/johnkan/scale_test2/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:306:14 #35 0x00005627f3cbf1fc main /home/johnkan/scale_test2/scalehls-hida/tools/scalehls-opt/scalehls-opt.cpp:16:23 #36 0x00007f0400868d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #37 0x00007f0400868e40 call_init ./csu/../csu/libc-start.c:128:20 #38 0x00007f0400868e40 __libc_start_main ./csu/../csu/libc-start.c:379:5 #39 0x00005627f3cbf0c5 _start (/home/johnkan/scale_test2/scalehls-hida/build/bin/scalehls-opt+0x1ee00c5)
Is this issue resolved now?
I encountered almost the same issue as @john-kan-2 when I was trying to reproduce the C++ code. I noted that torch-mlir has been constantly updating and the API torch_mlir.compile()
has been deprecated in the recent releases. I suspect the error has to do with the version of torch-mlir used.
Ubuntu 24.04 LTS-Linux version 6.8.0-45-generic x86-64 clang version 18.1.3 clang++ version 18.1.3 lld 18.1.3 ninja 1.11.1 CMake 3.28.3
Option: -p ON -j 8
conda create -n mlir
conda activate mlir
conda install -c conda-forge python=3.11
pip install -r requirements.txt --no-deps
requirements.txt
certifi==2022.12.7
charset-normalizer==2.1.1
filelock==3.16.1
fsspec==2024.9.0
idna==3.4
Jinja2==3.1.4
MarkupSafe==3.0.1
mpmath==1.3.0
networkx==3.4.1
numpy==1.23.0
packaging==24.1
pillow==10.4.0
requests==2.28.1
sympy==1.13.3
typing_extensions==4.12.2
urllib3==1.26.13
-f https://llvm.github.io/torch-mlir/package-index/
torch==2.2.0.dev20231204+cpu
-f https://llvm.github.io/torch-mlir/package-index/
torch-mlir==20231229.1067
-f https://download.pytorch.org/whl/cpu
torchvision==0.16.2
Command:
python3 resnet18.py > resnet18.mlir
scalehls-opt resnet18.mlir -hida-pytorch-pipeline="top-func=forward loop-tile-size=8 loop-unroll-factor=4"|scalehls-translate -scalehls-emit-hlscpp > resnet18.cpp
scalehls-opt: /home/test/scalehls-hida/lib/Dialect/HLS/Utils.cpp:514: LogicalResult mlir::scalehls::getEvenlyDistributedFactors(unsigned int, FactorList &, const SmallVectorImpl<mlir::AffineForOp> &, const SmallVectorImpl<FactorList> &, bool): Assertion `tripCount.value() % constrFactors[loop.index()] == 0 && "contraint factor isn't divisor of corresponding trip count"' failed.
0. Program arguments: scalehls-opt resnet18.mlir "-hida-pytorch-pipeline=top-func=forward loop-tile-size=8 loop-unroll-factor=4"
#0 0x000064b6fab9230e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/test/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:569:11
#1 0x000064b6fab924cb PrintStackTraceSignalHandler(void*) /home/test/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:636:1
#2 0x000064b6fab90af6 llvm::sys::RunSignalHandlers() /home/test/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Signals.cpp:104:5
#3 0x000064b6fab92b95 SignalHandler(int) /home/test/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
#4 0x00007c809c645320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
#5 0x00007c809c69eb1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb1c)
#6 0x00007c809c64526e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4526e)
#7 0x00007c809c6288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#8 0x00007c809c62881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
#9 0x00007c809c63b507 (/lib/x86_64-linux-gnu/libc.so.6+0x3b507)
#10 0x000064b6f8fe6bb3 mlir::scalehls::getEvenlyDistributedFactors(unsigned int, llvm::SmallVector<unsigned int, 8u>&, llvm::SmallVectorImpl<mlir::AffineForOp> const&, llvm::SmallVectorImpl<llvm::SmallVector<unsigned int, 8u>> const&, bool) /home/test/scalehls-hida/lib/Dialect/HLS/Utils.cpp:515:24
#11 0x000064b6f9ac9dce (anonymous namespace)::ParallelizeDataflowNode::applyCorrelationAwareUnroll(mlir::func::FuncOp) /home/test/scalehls-hida/lib/Transforms/Dataflow/ParallelizeDataflowNode.cpp:276:18
#12 0x000064b6f9ac9047 (anonymous namespace)::ParallelizeDataflowNode::runOnOperation() /home/test/scalehls-hida/lib/Transforms/Dataflow/ParallelizeDataflowNode.cpp:325:7
#13 0x000064b6fa6f0b9a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:462:21
#14 0x000064b6fa6f1174 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:525:16
#15 0x000064b6fa6f61d5 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:745:36
#16 0x000064b6fa6f5ed1 mlir::LogicalResult mlir::failableParallelForEach<__gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0&>(mlir::MLIRContext*, __gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, __gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0&) /home/test/scalehls-hida/polygeist/llvm-project/mlir/include/mlir/IR/Threading.h:46:18
#17 0x000064b6fa6f24bb mlir::LogicalResult mlir::failableParallelForEach<std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0&>(mlir::MLIRContext*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0&) /home/test/scalehls-hida/polygeist/llvm-project/mlir/include/mlir/IR/Threading.h:92:10
#18 0x000064b6fa6f1d2e mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:755:14
#19 0x000064b6fa6f0e27 mlir::detail::OpToOpPassAdaptor::runOnOperation(bool) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:646:5
#20 0x000064b6fa6f0b8b mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:459:5
#21 0x000064b6fa6f1174 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:525:16
#22 0x000064b6fa6f2a98 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:828:10
#23 0x000064b6fa6f29cf mlir::PassManager::run(mlir::Operation*) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:808:60
#24 0x000064b6f99a30b2 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:91:17
#25 0x000064b6f99a2d18 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, bool, bool, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool*) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:139:12
#26 0x000064b6f99a2af9 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:181:12
#27 0x000064b6f99a2a06 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>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) /home/test/scalehls-hida/polygeist/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#28 0x000064b6faa1de42 llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /home/test/scalehls-hida/polygeist/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
#29 0x000064b6faa1d45d 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/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Support/ToolUtilities.cpp:28:12
#30 0x000064b6f99a1a8a mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:186:10
#31 0x000064b6f99a1c23 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::PassPipelineCLParser const&, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool, bool) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:209:10
#32 0x000064b6f99a282f mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) /home/test/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:306:14
#33 0x000064b6f746bd9c main /home/test/scalehls-hida/tools/scalehls-opt/scalehls-opt.cpp:16:23
#34 0x00007c809c62a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#35 0x00007c809c62a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#36 0x000064b6f746bc65 _start (/home/test/scalehls-hida/build/bin/scalehls-opt+0x1cb8c65)
Running:
$ scalehls-opt resnet18.mlir -hida-pytorch-pipeline="top-func=forward loop-tile-size=8 loop-unroll-factor=4" | scalehls-translate -scalehls-emit-hlscpp > resnet18.cpp
I am using Ubuntu-22.04 (WSL2), python3.8 with python binding for the build script. I had to lower the mpmath version (due to a compilation issue) to 1.3.0 from the current 1.4.*.
I am left this with this dump:
scalehls-opt: /home/johnkan/scale_test1/scalehls-hida/lib/Dialect/HLS/Utils.cpp:514: mlir::LogicalResult mlir::scalehls::getEvenlyDistributedFactors(unsigned int, mlir::scalehls::FactorList &, const SmallVectorImpl &, const SmallVectorImpl &, bool): Assertion `tripCount.value() % constrFactors[loop.index()] == 0 && "contraint factor isn't divisor of corresponding trip count"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0 0x0000560cbb638a4a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:569:11
1 0x0000560cbb638bfb PrintStackTraceSignalHandler(void*) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:636:1
2 0x0000560cbb637246 llvm::sys::RunSignalHandlers() /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Signals.cpp:104:5
3 0x0000560cbb639325 SignalHandler(int) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
4 0x00007fc33583e520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
5 0x00007fc3358929fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
6 0x00007fc3358929fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
7 0x00007fc3358929fc pthread_kill ./nptl/pthread_kill.c:89:10
8 0x00007fc33583e476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
9 0x00007fc3358247f3 abort ./stdlib/abort.c:81:7
10 0x00007fc33582471b _nl_load_domain ./intl/loadmsgcat.c:1177:9
11 0x00007fc335835e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
12 0x0000560cb99a0cf1 mlir::scalehls::getEvenlyDistributedFactors(unsigned int, llvm::SmallVector<unsigned int, 8u>&, llvm::SmallVectorImpl const&, llvm::SmallVectorImpl<llvm::SmallVector<unsigned int, 8u>> const&, bool) /home/johnkan/scale_test1/scalehls-hida/lib/Dialect/HLS/Utils.cpp:515:7
13 0x0000560cba4ec3c6 (anonymous namespace)::ParallelizeDataflowNode::applyCorrelationAwareUnroll(mlir::func::FuncOp) /home/johnkan/scale_test1/scalehls-hida/lib/Transforms/Dataflow/ParallelizeDataflowNode.cpp:276:18
14 0x0000560cba4eb5f7 (anonymous namespace)::ParallelizeDataflowNode::runOnOperation() /home/johnkan/scale_test1/scalehls-hida/lib/Transforms/Dataflow/ParallelizeDataflowNode.cpp:325:7
15 0x0000560cbb16524a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass, mlir::Operation, mlir::AnalysisManager, bool, unsigned int) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:462:21
16 0x0000560cbb165844 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor, mlir::PassInstrumentation::PipelineParentInfo const*) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:525:16
17 0x0000560cbb16acf8 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:745:36
18 0x0000560cbb16a969 mlir::LogicalResult mlir::failableParallelForEach<gnu_cxx::normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext, gnu_cxx::normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, __gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/include/mlir/IR/Threading.h:46:18
19 0x0000560cbb166b23 mlir::LogicalResult mlir::failableParallelForEach<std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/include/mlir/IR/Threading.h:92:10
20 0x0000560cbb1663c6 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:755:14
21 0x0000560cbb1654f7 mlir::detail::OpToOpPassAdaptor::runOnOperation(bool) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:646:5
22 0x0000560cbb16523b mlir::detail::OpToOpPassAdaptor::run(mlir::Pass, mlir::Operation, mlir::AnalysisManager, bool, unsigned int) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:459:5
23 0x0000560cbb165844 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor, mlir::PassInstrumentation::PipelineParentInfo const*) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:525:16
24 0x0000560cbb16710c mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:828:10
25 0x0000560cbb16702c mlir::PassManager::run(mlir::Operation*) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:808:60
26 0x0000560cba3b2a22 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:91:17
27 0x0000560cba3b2689 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, bool, bool, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool*) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:139:12
28 0x0000560cba3b2468 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::raw_ostream&) const /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:181:12
29 0x0000560cba3b235d mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::raw_ostream&) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
30 0x0000560cbb4b4819 llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::raw_ostream&)>::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::raw_ostream&) const /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
31 0x0000560cbb4b3df5 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Support/ToolUtilities.cpp:28:12
32 0x0000560cba3b13c3 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:186:10
33 0x0000560cba3b155f mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete>, mlir::PassPipelineCLParser const&, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool, bool) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:209:10
34 0x0000560cba3b2177 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) /home/johnkan/scale_test1/scalehls-hida/polygeist/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:306:14
35 0x0000560cb7dbb1fc main /home/johnkan/scale_test1/scalehls-hida/tools/scalehls-opt/scalehls-opt.cpp:16:23
36 0x00007fc335825d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
37 0x00007fc335825e40 call_init ./csu/../csu/libc-start.c:128:20
38 0x00007fc335825e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
39 0x0000560cb7dbb0c5 _start (/home/johnkan/scale_test1/scalehls-hida/build/bin/scalehls-opt+0x1ee00c5)