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
[Fix] Fix flaky test of #9952 #9958
[Fix] Fix flaky test of #9952 #9958
Conversation
66852ba
to
a67f850
Compare
Thanks @wrongtest for the fix! If you can make sure the indeterminism doesn't happen again, please also kindly revert this hot fix PR (#9956) by removing the "skip" mark and the pytest import. |
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. Please take a look at my comment, thanks!
src/tir/transforms/ir_utils.cc
Outdated
for (const Var& var : cand_vars) { | ||
if (!var_set.count(var)) { | ||
vars.push_back(var); | ||
var_set.insert(var); | ||
} | ||
} |
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.
Personally I recommend using std::find(vars.begin(), vars.end(), var) != vars.end()
instead of using a var_set
for looking up, because usually we don't have few variables and the map doesn't bring performance improvement :-)
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.
std::find(vars.begin(), vars.end(), var) != vars.end()
Thanks for the advice~ I would change to O(n) search and commit to retrigger CI again.
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 fixing this!
* fix to stablize the var orders when solve bounds in region analysis * change to std::find_if since num of vars is generally small
* fix to stablize the var orders when solve bounds in region analysis * change to std::find_if since num of vars is generally small
* fix to stablize the var orders when solve bounds in region analysis * change to std::find_if since num of vars is generally small
fix #9952