Skip to content

Conversation

sgrechanik-h
Copy link
Contributor

@sgrechanik-h sgrechanik-h commented Jul 10, 2019

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

@sgrechanik-h sgrechanik-h marked this pull request as ready for review July 10, 2019 16:06
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;
Copy link
Member

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.

Copy link
Contributor Author

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.

@tqchen tqchen changed the title [TVM] Fix bound inference to avoid allocating too much [ARITH][BOUND] Fix bound inference to avoid allocating too much Jul 10, 2019
@tqchen tqchen merged commit 9fad94c into apache:master Jul 14, 2019
@tqchen
Copy link
Member

tqchen commented Jul 14, 2019

Thanks @sgrechanik-h , this pr is now merged

wweic pushed a commit to wweic/tvm that referenced this pull request Aug 9, 2019
…he#3526)

* [TVM] Fix bound inference to avoid allocating too much

* [ARITH][BOUND] Pass analyzer to PropBoundToInputs
wweic pushed a commit to neo-ai/tvm that referenced this pull request Sep 6, 2019
…he#3526)

* [TVM] Fix bound inference to avoid allocating too much

* [ARITH][BOUND] Pass analyzer to PropBoundToInputs
@sgrechanik-h sgrechanik-h deleted the pr-boundfix branch November 3, 2019 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants