-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Relay] add ShapeFunc for tanh #6898
Conversation
lgtm. pls fix the test failure. cc @icemelon9 @kevinthesun |
I have a question. What do you mean "input's shape's second dim is unknown"? TVM is able to compile the kernel even though the dim is a sym var. |
This in_dim will be used by following AutoTVM template code which requires integer. |
@wweic @lixiaoquan thanks for the comment. @icemelon9
Hi, this is the case when I import static LSTM model from tensorflow with batch dim set to It fails because the data's second dim is inferred to |
python/tvm/topi/cuda/dense.py
Outdated
A, _ = C.op.input_tensors | ||
_, in_dim = get_const_tuple(A.shape) | ||
A, weights = C.op.input_tensors | ||
_, in_dim = get_const_tuple(weights.shape) |
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.
Probably we can extent the logic a bit here to check both in_dim
from data and weight. If both of them are symbolic, we can skip cfg define for in_dim
since autotvm doesn't support dynamic shape kernel in general.
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.
Okay, I will update 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.
@kevinthesun updated
@monklof any updates? Thanks in advance! |
updated, check the lastest commit |
a492115
to
ee1a749
Compare
@kevinthesun could you merge this pr? thanks. |
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
Thanks @monklof @junrushao1994 @kevinthesun @wweic |
* add ShapeFunc for tanh * _schedule_dense_small_batch turn autotvm off when dense's inner dim is unknown * fix CI pylint
* add ShapeFunc for tanh * _schedule_dense_small_batch turn autotvm off when dense's inner dim is unknown * fix CI pylint
Enable run static lstm on relay vm by dynamic batch:
_schedule_dense_small_batch
instead of input in case input's shape's second dim is unknown.@wweic