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

[TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass #8506

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

rohanmukh
Copy link
Contributor

This commit handles a corner case in TRT RemoveDropout pass. This avoids an error like below

File "/home/ubuntu/workspace/tvm/python/tvm/runtime/object.py", line 65, in __getattr__
    raise AttributeError("%s has no attribute %s" % (str(type(self)), name))
AttributeError: relay.Let object has no attributed name
During handling of the above exception, another exception occurred:
AttributeError: <class 'tvm.relay.expr.Let'> has no attribute name 

@rohanmukh
Copy link
Contributor Author

@trevor-m @comaniac

Comment on lines 1036 to 1037
if isinstance(visit.tuple_value, Call) and isinstance(visit.tuple_value.op, Let):
return visit
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks a bit ad-hoc to me. Suggest as follows. Note that I'm not sure if isinstance(visit.tuple_value.op, Op) is the correct expression but you should know what I meant.

if isinstance(visit.tuple_value, Call):
  if isinstance(visit.tuple_value.op, Op) and visit.tuple_value.op.name == "nn.dropout" and visit.index == 0:
    return visit.tuple_value.args[0]
return visit

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 @comaniac . Changed the logic as appropriate.

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM

zxy844288792 pushed a commit to neo-ai/tvm that referenced this pull request Jul 26, 2021
* [TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass

* refactor the logic
@tqchen tqchen merged commit 8d9df2d into apache:main Jul 28, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
…ache#8506)

* [TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass

* changing visit logic
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…ache#8506)

* [TensorRT, BYOC] Handling a corner case in TRT RemoveDropout pass

* changing visit logic
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.

3 participants