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

[ONNX][BugFix] Support If body with free variable from graph input #15602

Merged
merged 3 commits into from
Aug 26, 2023

Conversation

gangmul12
Copy link
Contributor

When graph inputs are used in an inner body of If node, the original TVM ONNX
frontend did not set the span properly. Because of the wrong or partial span,
new relay.Var is introduced and failed to match identical Var. Firstly, there
was an issue where the free variable of the inner body was updated in _node but
not applied to _input. Secondly, although the free variable of the then body
successfully updated to relay.Var in _node, but this was obscured by the update
of _node in the else body.

This commit fixes the ONNX importer and adds an ONNX import testcase for the
revised code.

When graph inputs are used in an inner body of If node, the original TVM ONNX
frontend did not set the span properly. Because of the wrong or partial span,
new relay.Var is introduced and failed to match identical Var. Firstly, there
was an issue where the free variable of the inner body was updated in _node but
not applied to _input. Secondly, although the free variable of the then body
successfully updated to relay.Var in _node, but this was obscured by the update
of _node in the else body.

This commit fixes the ONNX importer and adds an ONNX import testcase for the
revised code.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Aug 21, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@gangmul12
Copy link
Contributor Author

cc @Hzfengsy . Can you review this when you are free? I found you reviewed the most recent ONNX PR #15415 . I'm not sure who to cc..

@Hzfengsy Hzfengsy merged commit 344fd2d into apache:main Aug 26, 2023
@gangmul12 gangmul12 deleted the onnx_import_bugfix branch August 26, 2023 12:44
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

Successfully merging this pull request may close these issues.

3 participants