[Bug] pytorch to relay : the order of input nodes is not preserved. #14461
Labels
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type: bug
Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first 😸
Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
Expected behavior and Actual behavior
For pytorch modules that use multiple inputs,
There is an unexpected problem when converting a pytorch module into a relay graph using
relay.frontend.from_pytorch
.The problem is that the input nodes of the relay graph are not determined in the order of the input nodes specified in
input_infos
passed as arguments torelay.frontend.from_pytorch
.This means that the order of example inputs written to
torch.jit.trace
and the order of inputs used for set_input of tvm graph executor are different. This in turn results in incorrect output from running the model.Example code below.
Actual behavior
Environment
Ubuntu / miniconda python3.10
Steps to reproduce
Preferably a minimal script to cause the issue to occur.
Triage
Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).
The text was updated successfully, but these errors were encountered: