Skip to content
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

Merged
merged 1 commit into from
Aug 23, 2019

Conversation

anijain2305
Copy link
Contributor

@anijain2305 anijain2305 commented Aug 15, 2019

Also, updated QNN requantize to read from out_types.

@anijain2305 anijain2305 changed the title [Legalize][QNN] WIP - Pass out_types to Legalize [Legalize][QNN] Pass out_types to Legalize Aug 16, 2019
@anijain2305
Copy link
Contributor Author

@yzhliu @shoubhik @vinx13 Please review

@@ -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"""
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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)

@yzhliu
Copy link
Member

yzhliu commented Aug 17, 2019

we can merge once @shoubhik approves.

@shoubhik
Copy link
Contributor

LGTM, i have approved the change.

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.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align <<?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

The args of the Relay expr to be legalized.
types : list of types
List of input and output types
F: symbol
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@anijain2305 anijain2305 force-pushed the legalize branch 3 times, most recently from 506d83d to f3c7491 Compare August 17, 2019 20:01
return topi.nn.conv2d_legalize(attrs, inputs, arg_dtypes, op)
def legalize_conv2d(attrs, inputs, types):
"""Legalize conv2d op.
Parameters
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Added.

@anijain2305
Copy link
Contributor Author

@tqchen Let me know if you have more comments.

@yzhliu yzhliu merged commit 1e4aea8 into apache:master Aug 23, 2019
@yzhliu
Copy link
Member

yzhliu commented Aug 23, 2019

Thanks @anijain2305 @shoubhik @tqchen @zhiics !

wweic pushed a commit to wweic/tvm that referenced this pull request Sep 16, 2019
wweic pushed a commit to wweic/tvm that referenced this pull request Sep 16, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Sep 16, 2019
@anijain2305 anijain2305 deleted the legalize branch November 13, 2019 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants