-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[ARITH][BOUND] Fix bound inference to avoid allocating too much #3526
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
Conversation
caf931d to
4c9acac
Compare
src/op/compute_op.cc
Outdated
| Expr min_value = arg_interval->min_value; | ||
| Expr max_value = arg_interval->max_value; | ||
| // Prefer the shape bounds only when we can prove they are tighter. | ||
| arith::Analyzer an; |
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.
Perhaps we should propagate analyzer through the ProptoInputs, so that we can setup context information later.
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.
It is possible but we have to pass dom_map anyway because Analyzer currently doesn't support binding variables with IntSets.
2fb6e0e to
99fae32
Compare
|
Thanks @sgrechanik-h , this pr is now merged |
…he#3526) * [TVM] Fix bound inference to avoid allocating too much * [ARITH][BOUND] Pass analyzer to PropBoundToInputs
…he#3526) * [TVM] Fix bound inference to avoid allocating too much * [ARITH][BOUND] Pass analyzer to PropBoundToInputs
Another attempt to fix the problem of tensor bound expansion (described here). The previous attempt was #2104. This time, however, tests passed. The fix is to use the declared tensor bounds instead of the estimated bounds for the argument if it is possible to prove that the declared bounds are tighter. Note that this means that out-of-bounds access may really result in out-of-bounds access.
@tqchen @junrushao1994 please take a look
cc @grwlf @derisavi @jdavies-huawei @bulanova-huawei