-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[TIR][FIX] Fix crash when using 'if' without 'else' in TVMScript #13054
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
[TIR][FIX] Fix crash when using 'if' without 'else' in TVMScript #13054
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
shingjan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sending this! Looks fine to me. Would that be possible that some tests can be added to this PR so we will know if future changes will break this?
junrushao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
13ff8eb to
0127232
Compare
Yes, a test has been added in test_tir_analysis_estimate_tir_flops.py |
shingjan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test!
0127232 to
5370454
Compare
|
@tvm-bot rerun |
5370454 to
b98a87c
Compare
|
I am not sure but it seem's like the CI is failed by the other ramdom reason, should I continue to try to rerun it? |
This commit fix the tvm's crash during TVMScript's auto-tune when having a 'if' statement which doesn't have a 'else' part. It's cause in tvm's tir processing (tvm.tir.analysis.estimate_flops), in VisitStmt_() for IfThenElseNode it trying to visit the 'else' part whether it is exist. So in this commit, an if logic is added in VisitStmt_() for IfThenElseNode, it will not visit the 'else' part if it is not exist.
b98a87c to
5f95c0f
Compare
…che#13054) This commit fix the tvm's crash during TVMScript's auto-tune when having a 'if' statement which doesn't have a 'else' part. It's cause in tvm's tir processing (tvm.tir.analysis.estimate_flops), in VisitStmt_() for IfThenElseNode it trying to visit the 'else' part whether it is exist. So in this commit, an if logic is added in VisitStmt_() for IfThenElseNode, it will not visit the 'else' part if it is not exist. Co-authored-by: SiYu Wu <wusiyu@buaa.edu.cn>
…che#13054) This commit fix the tvm's crash during TVMScript's auto-tune when having a 'if' statement which doesn't have a 'else' part. It's cause in tvm's tir processing (tvm.tir.analysis.estimate_flops), in VisitStmt_() for IfThenElseNode it trying to visit the 'else' part whether it is exist. So in this commit, an if logic is added in VisitStmt_() for IfThenElseNode, it will not visit the 'else' part if it is not exist. Co-authored-by: SiYu Wu <wusiyu@buaa.edu.cn>
This commit fix the tvm's crash during auto-tune when having a 'if' statement which doesn't have a 'else' part in TVMScript.
It's cause in tvm's tir processing, in
VisitStmt_()for IfThenElseNode its trying to visit the 'else' part (in TVMScript) whether it is exist.So in this commit, an if logic is added in
VisitStmt_()for IfThenElseNode, it will not visit the 'else' part if it is not exist.