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

cannot import and then export #16

Closed
stevenabreu7 opened this issue Oct 13, 2023 · 1 comment
Closed

cannot import and then export #16

stevenabreu7 opened this issue Oct 13, 2023 · 1 comment

Comments

@stevenabreu7
Copy link
Contributor

when importing a NIR graph through NIRTorch, and then exporting that back to NIR, it messes up the edges of the NIR graph:

original NIR edges [('input', '0'), ('0', '1'), ('1', 'output')]
converted NIR edges [('input', '0'), ('0', 'output'), ('1', '1')]

in a simple sequential network with two nodes, it never connects them:

Tensor_0(1, 1) (Tensor)
	-> 0 (Linear) [torch.Size([1, 1])]
0 (Linear)
	-> Tensor_1(1, 1) (Tensor) [torch.Size([1, 1])]
Tensor_1(1, 1) (Tensor)
Tensor_2(1, 1) (Tensor)
	-> 1 (Leaky) [torch.Size([1, 1])]
1 (Leaky)
	-> Tensor_3(1, 1) (Tensor) [torch.Size([1, 1])]
Tensor_3(1, 1) (Tensor)

in the new forward pass inside the graphexecutor, we are creating a new input based on the graph executor state (potentially summing together multiple inputs). pytorch then sees this input tensor as a new tensor, and the comparison with the old output tensor (which may be the same) fails.

stevenabreu7 added a commit that referenced this issue Oct 13, 2023
@stevenabreu7
Copy link
Contributor Author

fixed, but not merged yet, in #13, closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant