Skip to content

[Todo] Fix multi-input argument mapping #89

@whbldhwj

Description

@whbldhwj

For muliti-input model, when converting model to Relay graph, TVM may generate a different order of input arguments comapred to the original model.
For example, for the model below

class Q6Net(nn.Module):
    def __init__(self) -> None:
        super(Q6Net, self).__init__()

    def forward(self, data_discount, data_quantity, data_shipdate, data_extendedprice):
       ...

TVM-generated Relay graph takes the input arguments in the order of

[
Var(data_extendedprice, ty=TensorType([10], float32)), 
Var(data_discount, ty=TensorType([10], float32)), 
Var(data_quantity, ty=TensorType([10], float32)), 
Var(data_shipdate, ty=TensorType([10], float32))
]

This information can be extracted from:
https://github.com/apache/tvm/blob/2625878abef4bc78da65918a8a8c1db441638e8b/python/tvm/relay/frontend/pytorch.py#L4276

As a result, when executing the RAF model with the arguments in the original order
data_discount, data_quantity, data_shipdate, data_extendedprice
we will get the incorrect output due to the mismatch of arguments. This needs to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions