You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Lunderberg (via GitHub)" <gi...@apache.org> on 2023/03/16 17:36:39 UTC
[GitHub] [tvm] Lunderberg commented on pull request #14318: [Bugfix][TVMScript] Preserve foldable constants while parsing
Lunderberg commented on PR #14318:
URL: https://github.com/apache/tvm/pull/14318#issuecomment-1472424342
Thank you, and that makes sense to use `T.Add(1,2)` when printing integers, so that it can correctly round-trip from TIR -> TVMScript -> TIR.
That said, I think this dispatch still makes sense to keep, at least for `PrimExpr` argument types, so that it also handles hand-written TVMScript as expected. Writing TVMScript by hand has been very useful, both when debugging and developing new passes, as a human-readable mapping with TIR. (This has also been a huge benefit as compared to using the Python API directly, because `0 < x` in Python gets translated as `tir.GT(x, 0)` due to a limitation in Python's operator overloading, whereas TVMScript correctly generates `tir.LT(0, x)`.)
While the changes to printing could be replicated in the hand-written TVMScript, it's an unexpected change that needs to be remembered, especially when `i + offset` could have structurally different TIR depending on whether `offset` is defined within the TVMScript or as a dynamic parameter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org