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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [Bug- FX] Matrix multiplication FX dynamo test failures #1827

Closed
apbose opened this issue Apr 14, 2023 · 2 comments
Closed

馃悰 [Bug- FX] Matrix multiplication FX dynamo test failures #1827

apbose opened this issue Apr 14, 2023 · 2 comments
Assignees
Labels
bug Something isn't working No Activity

Comments

@apbose
Copy link
Collaborator

apbose commented Apr 14, 2023

Issue:
Expand does not support symbolic shapes

Steps to reproduce:

class MatMul(nn.Module):
            def __init__(self):
                super().__init__()            
                self.input = nn.Parameter(torch.randn(3,1,3,2))
            def forward(self, other):
                return torch.matmul(self.input, other)
            
if __name__ == "__main__":
    inputs = torch.randn(2,3,3)
    matmul = MatMul()
    y = matmul(inputs)


Notes:
The above graph generates a trace like this

%arg0 : [#users=4] = placeholder[target=arg0]
   %sym_size : [#users=4] = call_function[target=torch.ops.aten.sym_size](args = (%arg0, 0), kwargs = {})
   %_param_constant0 : [#users=1] = get_attr[target=_param_constant0]
   %expand_default : [#users=1] = call_function[target=torch.ops.aten.expand.default](args = (%_param_constant0, [%sym_size, 2, 2, 3]), kwargs = {})
   %mul : [#users=2] = call_function[target=operator.mul](args = (%sym_size, 2), kwargs = {})
   %reshape : [#users=1] = call_function[target=torch.ops.aten.reshape](args = (%expand_default, [%mul, 2, 3]), kwargs = {})
   %sym_size_1 : [#users=2] = call_function[target=torch.ops.aten.sym_size](args = (%arg0, 2), kwargs = {})
   %sym_size_2 : [#users=3] = call_function[target=torch.ops.aten.sym_size](args = (%arg0, 3), kwargs = {})
   %expand_default_1 : [#users=1] = call_function[target=torch.ops.aten.expand.default](args = (%arg0, [%sym_size, 2, %sym_size_1, %sym_size_2]), kwargs = {}
)
   %reshape_1 : [#users=1] = call_function[target=torch.ops.aten.reshape](args = (%expand_default_1, [%mul, %sym_size_1, %sym_size_2]), kwargs = {})
   %bmm_default : [#users=1] = call_function[target=torch.ops.aten.bmm.default](args = (%reshape, %reshape_1), kwargs = {})
   %reshape_2 : [#users=1] = call_function[target=torch.ops.aten.reshape](args = (%bmm_default, [%sym_size, 2, 2, %sym_size_2]), kwargs = {})
   return [reshape_2]

The expand operation in the above gets input in the form which leads to the error (<tensorrt.tensorrt.ITensor object at 0x7fadb39eeb30>, 2, 2, 3)

@apbose apbose added the bug Something isn't working label Apr 14, 2023
@apbose apbose self-assigned this Apr 14, 2023
@apbose apbose changed the title 馃悰 [Bug- FX] Expand does not support symbolic shapes 馃悰 [Bug- FX] Matrix multiplication FX dynamo test failures Apr 14, 2023
@github-actions
Copy link

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

1 similar comment
@github-actions
Copy link

This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working No Activity
Projects
None yet
Development

No branches or pull requests

1 participant