Skip to content
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

lower if #1693

Merged
merged 3 commits into from
Sep 19, 2022
Merged

lower if #1693

merged 3 commits into from
Sep 19, 2022

Conversation

sorenlassen
Copy link
Member

added lit tests and backend test

updated SupportedONNXOps-cpu.md

Signed-off-by: Soren Lassen [email protected]

@AlexandreEichenberger
Copy link
Collaborator

@chentong319 can you review this PR as it is closely related to the LOOP and sequence work you have done, big thanks

added lit tests and backend test

updated SupportedONNXOps-cpu.md

Signed-off-by: Soren Lassen <[email protected]>
rewriter, loc, ifOp.then_branch(), scfIfOp.getThenRegion());
graphToScfBranch(
rewriter, loc, ifOp.else_branch(), scfIfOp.getElseRegion());
UnrealizedConversionCastOp castOp =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding, this statement converts the result of scf.if back to tensor types. But the lit test case shows the return is memref. Can you tell me the reason?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, the cast was unnecessary

removed

Signed-off-by: Soren Lassen <[email protected]>
Copy link
Collaborator

@chentong319 chentong319 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@chentong319 chentong319 merged commit b6a17f6 into onnx:main Sep 19, 2022
@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #7632 [push] lower if (#1693) * lowe... started at 18:34

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #7647 [push] lower if (#1693) * lowe... started at 19:35

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #6696 [push] lower if (#1693) * lowe... started at 19:37

@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #7632 [push] lower if (#1693) * lowe... passed after 54 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #7647 [push] lower if (#1693) * lowe... passed after 1 hr 22 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #6696 [push] lower if (#1693) * lowe... passed after 1 hr 29 min

@sstamenova
Copy link
Collaborator

I noticed that after this change the lit tests no longer pass on Windows in Debug. Windows Debug is often special in that it explicitly sets everything to null if it's not initialized, pads structures with known patterns (and other similar things) to more explicitly guard against bugs. In this case, there is an access violation in the new test for lowering if. I've added the log from the test run so you can have a look and hopefully figure out the issue quickly.

$ ":" "RUN: at line 1"
$ "d:\a\_work\1\b\onnx-mlir\debug\debug\bin\onnx-mlir-opt.exe" "-O3" "--shape-inference" "--convert-onnx-to-krnl" "D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir" "-split-input-file"
# command stderr:
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

Stack dump:

0.	Program arguments: d:\\a\\_work\\1\\b\\onnx-mlir\\debug\\debug\\bin\\onnx-mlir-opt.exe -O3 --shape-inference --convert-onnx-to-krnl D:\\a\\_work\\1\\s\\onnx-mlir\\test\\mlir\\onnx\\onnx_lowering.mlir -split-input-file
Exception Code: 0xC0000005

#0 0x00007ff6f62b0b7b mlir::Region::getParentOp(void) D:\a\_work\1\s\llvm-project\mlir\include\mlir\IR\Region.h:200:0
#1 0x00007ff6f8c56e2b mlir::Block::getParentOp(void) D:\a\_work\1\s\llvm-project\mlir\lib\IR\Block.cpp:31:0
#2 0x00007ff6f7164fed `anonymous namespace'::OperationLegalizer::legalizePatternBlockActions D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2065:0
#3 0x00007ff6f7164d83 `anonymous namespace'::OperationLegalizer::legalizePatternResult D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2040:0
#4 0x00007ff6f7166c29 ``anonymous namespace'::OperationLegalizer::legalizeWithPattern'::`2'::<lambda_3>::operator() D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:1977:0
#5 0x00007ff6f718af80 llvm::function_ref<mlir::LogicalResult __cdecl(mlir::Pattern const &)>::callback_fn<``anonymous namespace'::OperationLegalizer::legalizeWithPattern'::`2'::<lambda_3> > D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:45:0
#6 0x00007ff6f7213ab1 llvm::function_ref<(class mlir::Pattern const &)>::operator()(class mlir::Pattern const &) const D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:68:0
#7 0x00007ff6f72098ec mlir::PatternApplicator::matchAndRewrite(class mlir::Operation *, class mlir::PatternRewriter &, class llvm::function_ref<(class mlir::Pattern const &)>, class llvm::function_ref<(class mlir::Pattern const &)>, class llvm::function_ref<(class mlir::Pattern const &)>) D:\a\_work\1\s\llvm-project\mlir\lib\Rewrite\PatternApplicator.cpp:205:0
#8 0x00007ff6f7164919 `anonymous namespace'::OperationLegalizer::legalizeWithPattern D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:1984:0
#9 0x00007ff6f7163f07 `anonymous namespace'::OperationLegalizer::legalize D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:1892:0
#10 0x00007ff6f7167ec1 `anonymous namespace'::OperationConverter::convert D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2405:0
#11 0x00007ff6f7167c3a `anonymous namespace'::OperationConverter::convertOperations D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2454:0
#12 0x00007ff6f715564c mlir::applyPartialConversion(class llvm::ArrayRef<class mlir::Operation *>, class mlir::ConversionTarget &, class mlir::FrozenRewritePatternSet const &, class llvm::DenseSet<class mlir::Operation *, struct llvm::DenseMapInfo<class mlir::Operation *, void>> *) D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:3266:0
#13 0x00007ff6f7155707 mlir::applyPartialConversion(class mlir::Operation *, class mlir::ConversionTarget &, class mlir::FrozenRewritePatternSet const &, class llvm::DenseSet<class mlir::Operation *, struct llvm::DenseMapInfo<class mlir::Operation *, void>> *) D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:3272:0
#14 0x00007ff6f5823498 onnx_mlir::FrontendToKrnlLoweringPass::runOnOperation(void) D:\a\_work\1\s\onnx-mlir\src\Conversion\ONNXToKrnl\ConvertONNXToKrnl.cpp:413:0
#15 0x00007ff6f8961c31 mlir::detail::OpToOpPassAdaptor::run(class mlir::Pass *, class mlir::Operation *, class mlir::AnalysisManager, bool, unsigned int) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:471:0
#16 0x00007ff6f8961fb8 mlir::detail::OpToOpPassAdaptor::runPipeline(class mlir::OpPassManager &, class mlir::Operation *, class mlir::AnalysisManager, bool, unsigned int, class mlir::PassInstrumentor *, struct mlir::PassInstrumentation::PipelineParentInfo const *) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:534:0
#17 0x00007ff6f89607f7 mlir::PassManager::runPasses(class mlir::Operation *, class mlir::AnalysisManager) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:837:0
#18 0x00007ff6f89605d2 mlir::PassManager::run(class mlir::Operation *) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:816:0
#19 0x00007ff6f5fa08a0 performActions D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:86:0
#20 0x00007ff6f5fa0d34 processBuffer D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:130:0
#21 0x00007ff6f5fa10e1 `mlir::MlirOptMain'::`2'::<lambda_1>::operator() D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:171:0
#22 0x00007ff6f5fa3f17 llvm::function_ref<mlir::LogicalResult __cdecl(std::unique_ptr<llvm::MemoryBuffer,std::default_delete<llvm::MemoryBuffer> >,llvm::raw_ostream &)>::callback_fn<`mlir::MlirOptMain'::`2'::<lambda_1> > D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:45:0
#23 0x00007ff6f8dcc251 llvm::function_ref<(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::raw_ostream &)>::operator()(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::raw_ostream &) const D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:68:0
#24 0x00007ff6f8dcbac9 `mlir::splitAndProcessBuffer'::`2'::<lambda_1>::operator() D:\a\_work\1\s\llvm-project\mlir\lib\Support\ToolUtilities.cpp:88:0
#25 0x00007ff6f8dcbfd2 llvm::interleave<llvm::StringRef const *,`mlir::splitAndProcessBuffer'::`2'::<lambda_1>,`llvm::interleave<llvm::SmallVector<llvm::StringRef,8>,`mlir::splitAndProcessBuffer'::`2'::<lambda_1>,llvm::raw_ostream,llvm::StringRef>'::`2'::<lambda_1>,void> D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLExtras.h:1859:0
#26 0x00007ff6f8dcc161 llvm::interleave<llvm::SmallVector<llvm::StringRef,8>,`mlir::splitAndProcessBuffer'::`2'::<lambda_1>,llvm::raw_ostream,llvm::StringRef> D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLExtras.h:1877:0
#27 0x00007ff6f8dcb7d5 mlir::splitAndProcessBuffer(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::function_ref<(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::raw_ostream &)>, class llvm::raw_ostream &, bool, bool) D:\a\_work\1\s\llvm-project\mlir\lib\Support\ToolUtilities.cpp:95:0
#28 0x00007ff6f5f9f4c9 mlir::MlirOptMain(class llvm::raw_ostream &, class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::function_ref<(class mlir::PassManager &)>, class mlir::DialectRegistry &, bool, bool, bool, bool, bool, bool) D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:176:0
#29 0x00007ff6f5f9f2ee mlir::MlirOptMain(class llvm::raw_ostream &, class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class mlir::PassPipelineCLParser const &, class mlir::DialectRegistry &, bool, bool, bool, bool, bool, bool) D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:195:0
#30 0x00007ff6f4edd6a1 main D:\a\_work\1\s\onnx-mlir\src\Tools\onnx-mlir-opt\onnx-mlir-opt.cpp:191:0
#31 0x00007ff6f8fb5829 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79:0
#32 0x00007ff6f8fb570e __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#33 0x00007ff6f8fb55ce __scrt_common_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0
#34 0x00007ff6f8fb58be mainCRTStartup D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#35 0x00007ffb17d24ed0 (C:\Windows\System32\KERNEL32.DLL+0x14ed0)
#36 0x00007ffb18a3e39b (C:\Windows\SYSTEM32\ntdll.dll+0x7e39b)

error: command failed with exit status: 3221225477
$ "d:\a\_work\1\a\llvm\bin\filecheck.exe" "D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir"
# command stderr:
D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir:2353:17: error: CHECK-LABEL: expected string not found in input
// CHECK-LABEL: @test_if_simple

@sorenlassen sorenlassen deleted the sorenlassen/lower-if branch September 21, 2022 05:45
@sorenlassen
Copy link
Member Author

after this change the lit tests no longer pass on Windows in Debug

I only have a Mac and can only test on Mac and Linux so I can't reproduce the failure

thanks for sharing the backtrace, I can't conclusively say what the issue is but my hunch is that it has to do with the way the returnOp's block was erased so I wrote PR #1717 as an experiment - are you able to run that change to see if it fixes the issue? or can you recommend how I can troubleshoot this?

@AlexandreEichenberger
Copy link
Collaborator

I noticed that after this change the lit tests no longer pass on Windows in Debug.

@sstamenova can you clarify for my education why this was not picked up by the normal CIs? Window does not test in Debug? Tx

@sstamenova
Copy link
Collaborator

I noticed that after this change the lit tests no longer pass on Windows in Debug.

@sstamenova can you clarify for my education why this was not picked up by the normal CIs? Window does not test in Debug? Tx

Right now we don't run a debug build in the Windows CI. They are longer and use more memory, so it may or may not work on the available machines. We can try it out and see what happens.

@sstamenova
Copy link
Collaborator

@sorenlassen : The new changes fail on Windows and Ubuntu both.

The callstack for Ubuntu:

******************** TEST 'Open Neural Network Frontend :: onnx/onnx_lowering.mlir' FAILED ********************
Script:
--
: 'RUN: at line 1';   /__w/1/b/onnx-mlir/Debug/Debug/bin/onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl /__w/1/s/onnx-mlir/test/mlir/onnx/onnx_lowering.mlir -split-input-file | /__w/1/a/llvm/bin/FileCheck /__w/1/s/onnx-mlir/test/mlir/onnx/onnx_lowering.mlir
--
Exit Code: 1

Command Output (stderr):
--
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /__w/1/b/onnx-mlir/Debug/Debug/bin/onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl /__w/1/s/onnx-mlir/test/mlir/onnx/onnx_lowering.mlir -split-input-file
 #0 0x0000000002e8818a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /__w/1/s/llvm-project/llvm/lib/Support/Unix/Signals.inc:569:11
 #1 0x0000000002e8833b PrintStackTraceSignalHandler(void*) /__w/1/s/llvm-project/llvm/lib/Support/Unix/Signals.inc:636:1
 #2 0x0000000002e86986 llvm::sys::RunSignalHandlers() /__w/1/s/llvm-project/llvm/lib/Support/Signals.cpp:103:5
 #3 0x0000000002e88a65 SignalHandler(int) /__w/1/s/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
 #4 0x00007f982c5e0420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #5 0x0000000002defee8 llvm::djbHash(llvm::StringRef, unsigned int) /__w/1/s/llvm-project/llvm/include/llvm/Support/DJB.h:22:24
 #6 0x0000000002def9a7 llvm::StringMapImpl::FindKey(llvm::StringRef) const /__w/1/s/llvm-project/llvm/lib/Support/StringMap.cpp:142:28
 #7 0x0000000001b81ef9 llvm::StringMap<mlir::ConversionTarget::LegalizationAction, llvm::MallocAllocator>::find(llvm::StringRef) const /__w/1/s/llvm-project/llvm/include/llvm/ADT/StringMap.h:225:9
 #8 0x0000000001b652ba mlir::ConversionTarget::getOpInfo(mlir::OperationName) const /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3236:34
 #9 0x0000000001b654ef mlir::ConversionTarget::isLegal(mlir::Operation*) const /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3126:8
#10 0x0000000001b6dbf9 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:1854:34
#11 0x0000000001b70a49 (anonymous namespace)::OperationLegalizer::legalizePatternBlockActions(mlir::Operation*, mlir::ConversionPatternRewriter&, mlir::detail::ConversionPatternRewriterImpl&, (anonymous namespace)::RewriterState&, (anonymous namespace)::RewriterState&) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2093:16
#12 0x0000000001b7054c (anonymous namespace)::OperationLegalizer::legalizePatternResult(mlir::Operation*, mlir::Pattern const&, mlir::ConversionPatternRewriter&, (anonymous namespace)::RewriterState&) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2038:14
#13 0x0000000001b70347 (anonymous namespace)::OperationLegalizer::legalizeWithPattern(mlir::Operation*, mlir::ConversionPatternRewriter&)::$_16::operator()(mlir::Pattern const&) const /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:1976:19
#14 0x0000000001b702fd mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>::callback_fn<(anonymous namespace)::OperationLegalizer::legalizeWithPattern(mlir::Operation*, mlir::ConversionPatternRewriter&)::$_16>(long, mlir::Pattern const&) /__w/1/s/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#15 0x0000000001bdd1b9 llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>::operator()(mlir::Pattern const&) const /__w/1/s/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
#16 0x0000000001bda431 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&)>) /__w/1/s/llvm-project/mlir/lib/Rewrite/PatternApplicator.cpp:205:52
#17 0x0000000001b6e760 (anonymous namespace)::OperationLegalizer::legalizeWithPattern(mlir::Operation*, mlir::ConversionPatternRewriter&) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:1984:21
#18 0x0000000001b6de7b (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:1892:17
#19 0x0000000001b6d3bf (anonymous namespace)::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2405:26
#20 0x0000000001b662eb (anonymous namespace)::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>, llvm::function_ref<void (mlir::Diagnostic&)>) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2454:16
#21 0x0000000001b65fb7 mlir::applyPartialConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget&, mlir::FrozenRewritePatternSet const&, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>*) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3266:22
#22 0x0000000001b66532 mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget&, mlir::FrozenRewritePatternSet const&, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>*) /__w/1/s/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3272:10
#23 0x0000000000a76989 onnx_mlir::FrontendToKrnlLoweringPass::runOnOperation() /__w/1/s/onnx-mlir/src/Conversion/ONNXToKrnl/ConvertONNXToKrnl.cpp:413:14
#24 0x0000000002a57a6a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /__w/1/s/llvm-project/mlir/lib/Pass/Pass.cpp:471:21
#25 0x0000000002a58064 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /__w/1/s/llvm-project/mlir/lib/Pass/Pass.cpp:534:16
#26 0x0000000002a5992c mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /__w/1/s/llvm-project/mlir/lib/Pass/Pass.cpp:837:10
#27 0x0000000002a5984c mlir::PassManager::run(mlir::Operation*) /__w/1/s/llvm-project/mlir/lib/Pass/Pass.cpp:817:60
#28 0x0000000000fc3582 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool) /__w/1/s/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:86:17
#29 0x0000000000fc329b processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, bool, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool*) /__w/1/s/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:130:12

The callstack for Windows:

FAIL: Open Neural Network Frontend :: onnx/onnx_lowering.mlir (166 of 166)
******************** TEST 'Open Neural Network Frontend :: onnx/onnx_lowering.mlir' FAILED ********************
Script:
--
: 'RUN: at line 1';   d:\a\_work\1\b\onnx-mlir\debug\debug\bin\onnx-mlir-opt.exe -O3 --shape-inference --convert-onnx-to-krnl D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir -split-input-file | d:\a\_work\1\a\llvm\bin\filecheck.exe D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "d:\a\_work\1\b\onnx-mlir\debug\debug\bin\onnx-mlir-opt.exe" "-O3" "--shape-inference" "--convert-onnx-to-krnl" "D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir" "-split-input-file"
# command stderr:
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

Stack dump:

0.	Program arguments: d:\\a\\_work\\1\\b\\onnx-mlir\\debug\\debug\\bin\\onnx-mlir-opt.exe -O3 --shape-inference --convert-onnx-to-krnl D:\\a\\_work\\1\\s\\onnx-mlir\\test\\mlir\\onnx\\onnx_lowering.mlir -split-input-file

Exception Code: 0xC0000005

 #0 0x00007ff69afe093b mlir::Region::getParentOp(void) D:\a\_work\1\s\llvm-project\mlir\include\mlir\IR\Region.h:200:0

 #1 0x00007ff69d986beb mlir::Block::getParentOp(void) D:\a\_work\1\s\llvm-project\mlir\lib\IR\Block.cpp:31:0

 #2 0x00007ff69be94dad `anonymous namespace'::OperationLegalizer::legalizePatternBlockActions D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2065:0

 #3 0x00007ff69be94b43 `anonymous namespace'::OperationLegalizer::legalizePatternResult D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2040:0

 #4 0x00007ff69be969e9 ``anonymous namespace'::OperationLegalizer::legalizeWithPattern'::`2'::<lambda_3>::operator() D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:1977:0

 #5 0x00007ff69bebad40 llvm::function_ref<mlir::LogicalResult __cdecl(mlir::Pattern const &)>::callback_fn<``anonymous namespace'::OperationLegalizer::legalizeWithPattern'::`2'::<lambda_3> > D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:45:0

 #6 0x00007ff69bf43871 llvm::function_ref<(class mlir::Pattern const &)>::operator()(class mlir::Pattern const &) const D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:68:0

 #7 0x00007ff69bf396ac mlir::PatternApplicator::matchAndRewrite(class mlir::Operation *, class mlir::PatternRewriter &, class llvm::function_ref<(class mlir::Pattern const &)>, class llvm::function_ref<(class mlir::Pattern const &)>, class llvm::function_ref<(class mlir::Pattern const &)>) D:\a\_work\1\s\llvm-project\mlir\lib\Rewrite\PatternApplicator.cpp:205:0

 #8 0x00007ff69be946d9 `anonymous namespace'::OperationLegalizer::legalizeWithPattern D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:1984:0

 #9 0x00007ff69be93cc7 `anonymous namespace'::OperationLegalizer::legalize D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:1892:0

#10 0x00007ff69be97c81 `anonymous namespace'::OperationConverter::convert D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2405:0

#11 0x00007ff69be979fa `anonymous namespace'::OperationConverter::convertOperations D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:2454:0

#12 0x00007ff69be8540c mlir::applyPartialConversion(class llvm::ArrayRef<class mlir::Operation *>, class mlir::ConversionTarget &, class mlir::FrozenRewritePatternSet const &, class llvm::DenseSet<class mlir::Operation *, struct llvm::DenseMapInfo<class mlir::Operation *, void>> *) D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:3266:0

#13 0x00007ff69be854c7 mlir::applyPartialConversion(class mlir::Operation *, class mlir::ConversionTarget &, class mlir::FrozenRewritePatternSet const &, class llvm::DenseSet<class mlir::Operation *, struct llvm::DenseMapInfo<class mlir::Operation *, void>> *) D:\a\_work\1\s\llvm-project\mlir\lib\Transforms\Utils\DialectConversion.cpp:3272:0

#14 0x00007ff69a553498 onnx_mlir::FrontendToKrnlLoweringPass::runOnOperation(void) D:\a\_work\1\s\onnx-mlir\src\Conversion\ONNXToKrnl\ConvertONNXToKrnl.cpp:413:0

#15 0x00007ff69d6919f1 mlir::detail::OpToOpPassAdaptor::run(class mlir::Pass *, class mlir::Operation *, class mlir::AnalysisManager, bool, unsigned int) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:471:0

#16 0x00007ff69d691d78 mlir::detail::OpToOpPassAdaptor::runPipeline(class mlir::OpPassManager &, class mlir::Operation *, class mlir::AnalysisManager, bool, unsigned int, class mlir::PassInstrumentor *, struct mlir::PassInstrumentation::PipelineParentInfo const *) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:534:0

#17 0x00007ff69d6905b7 mlir::PassManager::runPasses(class mlir::Operation *, class mlir::AnalysisManager) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:837:0

#18 0x00007ff69d690392 mlir::PassManager::run(class mlir::Operation *) D:\a\_work\1\s\llvm-project\mlir\lib\Pass\Pass.cpp:816:0

#19 0x00007ff69acd0660 performActions D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:86:0

#20 0x00007ff69acd0af4 processBuffer D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:130:0

#21 0x00007ff69acd0ea1 `mlir::MlirOptMain'::`2'::<lambda_1>::operator() D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:171:0

#22 0x00007ff69acd3cd7 llvm::function_ref<mlir::LogicalResult __cdecl(std::unique_ptr<llvm::MemoryBuffer,std::default_delete<llvm::MemoryBuffer> >,llvm::raw_ostream &)>::callback_fn<`mlir::MlirOptMain'::`2'::<lambda_1> > D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:45:0

#23 0x00007ff69dafc011 llvm::function_ref<(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::raw_ostream &)>::operator()(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::raw_ostream &) const D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLFunctionalExtras.h:68:0

#24 0x00007ff69dafb889 `mlir::splitAndProcessBuffer'::`2'::<lambda_1>::operator() D:\a\_work\1\s\llvm-project\mlir\lib\Support\ToolUtilities.cpp:88:0

#25 0x00007ff69dafbd92 llvm::interleave<llvm::StringRef const *,`mlir::splitAndProcessBuffer'::`2'::<lambda_1>,`llvm::interleave<llvm::SmallVector<llvm::StringRef,8>,`mlir::splitAndProcessBuffer'::`2'::<lambda_1>,llvm::raw_ostream,llvm::StringRef>'::`2'::<lambda_1>,void> D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLExtras.h:1859:0

#26 0x00007ff69dafbf21 llvm::interleave<llvm::SmallVector<llvm::StringRef,8>,`mlir::splitAndProcessBuffer'::`2'::<lambda_1>,llvm::raw_ostream,llvm::StringRef> D:\a\_work\1\s\llvm-project\llvm\include\llvm\ADT\STLExtras.h:1877:0

#27 0x00007ff69dafb595 mlir::splitAndProcessBuffer(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::function_ref<(class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::raw_ostream &)>, class llvm::raw_ostream &, bool, bool) D:\a\_work\1\s\llvm-project\mlir\lib\Support\ToolUtilities.cpp:95:0

#28 0x00007ff69accf289 mlir::MlirOptMain(class llvm::raw_ostream &, class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class llvm::function_ref<(class mlir::PassManager &)>, class mlir::DialectRegistry &, bool, bool, bool, bool, bool, bool) D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:176:0

#29 0x00007ff69accf0ae mlir::MlirOptMain(class llvm::raw_ostream &, class std::unique_ptr<class llvm::MemoryBuffer, struct std::default_delete<class llvm::MemoryBuffer>>, class mlir::PassPipelineCLParser const &, class mlir::DialectRegistry &, bool, bool, bool, bool, bool, bool) D:\a\_work\1\s\llvm-project\mlir\lib\Tools\mlir-opt\MlirOptMain.cpp:195:0

#30 0x00007ff699c0d6a1 main D:\a\_work\1\s\onnx-mlir\src\Tools\onnx-mlir-opt\onnx-mlir-opt.cpp:191:0

#31 0x00007ff69dce55e9 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79:0

#32 0x00007ff69dce54ce __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0

#33 0x00007ff69dce538e __scrt_common_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0

#34 0x00007ff69dce567e mainCRTStartup D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0

#35 0x00007ffd241f4ed0 (C:\Windows\System32\KERNEL32.DLL+0x14ed0)

#36 0x00007ffd24bde39b (C:\Windows\SYSTEM32\ntdll.dll+0x7e39b)


error: command failed with exit status: 3221225477
$ "d:\a\_work\1\a\llvm\bin\filecheck.exe" "D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir"
# command stderr:
D:\a\_work\1\s\onnx-mlir\test\mlir\onnx\onnx_lowering.mlir:2353:17: error: CHECK-LABEL: expected string not found in input
// CHECK-LABEL: @test_if_simple

sstamenova pushed a commit to sstamenova/onnx-mlir that referenced this pull request Sep 21, 2022
* lower if

added lit tests and backend test

updated SupportedONNXOps-cpu.md

Signed-off-by: Soren Lassen <[email protected]>

* remove unnecessary cast

Signed-off-by: Soren Lassen <[email protected]>

Signed-off-by: Soren Lassen <[email protected]>
Co-authored-by: chentong319 <[email protected]>
Signed-off-by: Stella Stamenova <[email protected]>
@sorenlassen
Copy link
Member Author

@sstamenova I updated my attempted fix in PR #1717, can you please try to run the Windows Debug lit tests with that PR again?

@sstamenova
Copy link
Collaborator

@sstamenova I updated my attempted fix in PR #1717, can you please try to run the Windows Debug lit tests with that PR again?

All green now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants