-
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
[Unity] Update relax_dynamo #15962
[Unity] Update relax_dynamo #15962
Conversation
@tvm-bot rerun |
Failed to re-run CI in https://github.com/apache/tvm/actions/runs/6602009999
with response
|
@@ -35,6 +35,28 @@ def device_from_inputs(example_inputs): | |||
return None | |||
|
|||
|
|||
def get_fake_inputs(graph_module, example_inputs): |
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.
Please write type annotations and docstring for this function
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 for your comment. Regarding these type annotations from Torch, I don't think it is appropriate to import torch
at the file header solely for adding annotations, as shown below.
tvm/python/tvm/relax/frontend/torch/dynamo.py
Lines 52 to 55 in 1ba11f6
def _relax_backend(graph_module, example_inputs): | |
import torch # type: ignore[import] | |
assert isinstance(graph_module, torch.fx.GraphModule) |
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 see. Would you be able to make it a private function? i.e. put it inside the function relax_dynamo
?
result = input1[ | ||
torch.arange(1), | ||
] | ||
result = input1[torch.arange(1),] |
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.
style. Keep it remain unchanged or
result = input1[torch.arange(1),] | |
result = input1[torch.arange(1)] |
af9d2a8
to
6fee5ff
Compare
@tvm-bot rerun |
Failed to re-run CI in https://github.com/apache/tvm/actions/runs/6607831952
with response
|
Thanks @liquanfeng |
PyTorch 2.1.0 has switched the calling convention to real tensors (pytorch/pytorch#99320), consequently prompting an update of the
relax_dynamo
with real tensors.Additionally, there is a new dynamic dynamo test from Pytorch Docs that generates dead code in the fx graph, requiring the application of
eliminate_dead_code
.cc @Hzfengsy @MasterJH5574