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

[Relay] Fix VM compiler for while loop with free vars #4889

Merged
merged 2 commits into from
Feb 16, 2020

Conversation

masahi
Copy link
Member

@masahi masahi commented Feb 15, 2020

This is a fix to the issue reported in
https://discuss.tvm.ai/t/a-relay-vm-question-while-loop-and-free-vars/5541/

It seems if a recursive function contains free variables, the lambda lift pass (or others) generates nested call nodes, which is not handled by the VM compiler currently. See the test case for a concrete example (body_with_free_var triggers the bug).

Actually, the test case added in #4432 by @icemelon9 also triggers the same bug if I create the vm executor on the module in #4432.

please review @icemelon9 @wweic @zhiics @MarisaKirisame

Copy link
Member

@icemelon icemelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@icemelon icemelon merged commit 529ee1f into apache:master Feb 16, 2020
@icemelon
Copy link
Member

Thanks @masahi

alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 26, 2020
* add additional switch to handle nested call node

* Fix VM compiler for while loop with free var
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 28, 2020
* add additional switch to handle nested call node

* Fix VM compiler for while loop with free var
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2020
* add additional switch to handle nested call node

* Fix VM compiler for while loop with free var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants