-
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
[Frontend][Relay][Keras] fix a wrong assertion about the kernal_layout of DepthwiseConv2D #15124
base: main
Are you sure you want to change the base?
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 |
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!
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.
Sorry, I took a look a bit more carefully to the change, and it looks like it might break some scenarios. In this test, HWIO layout is used. Also, in the description of compute function is written that kernel layout should be in format HWIO: https://github.com/apache/tvm/blob/main/python/tvm/topi/nn/conv2d.py#L295-L296
Could you please double-check if your fix is correct?
@echuraev Thanks for your careful review. Indeed, this pr will lead to some test failure. I will correct the pr sooner. |
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.
Is there a possible error in the keras.py? Since in TensorFlow depthwise_kernel_shape is defined as (H, W, I, O).
@tvm-bot rerun |
This PR fixed a wrong assertion.
The assertion is conflicted with the related code in Line 377-379 of the file python/tvm/relay/frontend/keras.py
For the DepthwiseConv2D operator, if the input_layout = "NHWC", the kernal layout should be "HWOI" rather than "HWIO".
This PR fixed it and add a bug-triggering test case.
Steps to reproduce
Crash Traceback
cc @echuraev @Hzfengsy @tqchen