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

[TVMScript] Preserve LetStmt of constants #14531

Merged

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the bind_assign_value implementation for TIR would treat assignment of constants (e.g. j = 42) as meta-variables to be inserted at their point of use. This commit updates the parsing to treat j = 42 as a shorthand for the TIR LetStmt, similar to the update made in #14320. This behavior is more consistent with the other uses of bind_assign_value as assignment, with j = T.meta_var(42) used to represent meta-variables.

Prior to this commit, the `bind_assign_value` implementation for TIR
would treat assignment of constants (e.g. `j = 42`) as meta-variables
to be inserted at their point of use.  This commit updates the parsing
to treat `j = 42` as a shorthand for the TIR `LetStmt`, similar to the
update made in apache#14320.  This
behavior is more consistent with the other uses of `bind_assign_value`
as assignment, with `j = T.meta_var(42)` used to represent
meta-variables.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Apr 7, 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

@junrushao
Copy link
Member

The change makes sense to me! Originally we had to take care of this only for 100% backward compatibility reasons, but in fact this behavior is much better in terms of consistency. CC @wrongtest-intellif let me know what you think given you guys are heavily using TVMScript

@Lunderberg Lunderberg marked this pull request as ready for review April 10, 2023 13:41
@Lunderberg Lunderberg changed the title [Draft][TVMScript] Preserve LetStmt of constants [TVMScript] Preserve LetStmt of constants Apr 10, 2023
@Lunderberg
Copy link
Contributor Author

@junrushao That makes sense, especially when preparing the new parsing implementation to be a drop-in replacement for the older implementation. Thank you for pinging @wrongtest-intellif , and I've marked it as ready-for-review.

@tqchen tqchen merged commit ddd2e81 into apache:main May 5, 2023
@Lunderberg Lunderberg deleted the tvmscript_preserve_letstmt_of_constant branch May 5, 2023 16:02
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.

4 participants