-
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
[Legalize][QNN] Pass out_types to Legalize #3782
Conversation
python/tvm/relay/op/nn/_nn.py
Outdated
@@ -205,10 +205,10 @@ def alter_op_layout_conv2d(attrs, inputs, tinfos): | |||
return topi.nn.conv2d_alter_layout(attrs, inputs, tinfos, op) | |||
|
|||
@reg.register_legalize("nn.conv2d") | |||
def legalize_conv2d(attrs, inputs, arg_dtypes): | |||
def legalize_conv2d(attrs, inputs, types): | |||
"""Legalize conv2d""" |
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.
can you also add the doc string here.
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.
Good idea. Let me do it.
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.
I understand that this method inherits params from def conv2d_legalize(attrs, inputs, types, F):
. for convenience, we can add that the doc string comes from def conv2d_legalize(attrs, inputs, types, F)
we can merge once @shoubhik approves. |
LGTM, i have approved the change. |
src/relay/qnn/op/requantize.cc
Outdated
auto out_type = types[1]; | ||
auto out_tensor_type = out_type.as<TensorTypeNode>(); | ||
CHECK(out_tensor_type != nullptr) << "Type information missing." | ||
<< " Please run infer_type pass."; |
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.
Align <<
?
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.
Done
python/tvm/relay/op/nn/_nn.py
Outdated
The args of the Relay expr to be legalized. | ||
types : list of types | ||
List of input and output types | ||
F: symbol |
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.
Do we have F
as an argument?
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.
Removed
506d83d
to
f3c7491
Compare
return topi.nn.conv2d_legalize(attrs, inputs, arg_dtypes, op) | ||
def legalize_conv2d(attrs, inputs, types): | ||
"""Legalize conv2d op. | ||
Parameters |
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.
need a blank line before Parameters
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! Added.
@tqchen Let me know if you have more comments. |
…read from out_types.
Thanks @anijain2305 @shoubhik @tqchen @zhiics ! |
…read from out_types. (apache#3782)
…read from out_types. (apache#3782)
…read from out_types. (apache#3782)
Also, updated QNN requantize to read from out_types.