-
Notifications
You must be signed in to change notification settings - Fork 58
Conversation
43628e5
to
9165dd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if ready to review yet but I left some initial comments & questions
this->VisitBindingBlock(block); | ||
} | ||
// find the function return value and emit the output | ||
auto ret_reg = this->var_register_map_.find(Downcast<Var>(op->body)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noting that we need to validate/normalize IR to full SSA (currently the parser doesn't do this) in order to make sure this works (e.g. if someone writes return add(x, y)
then this will fail)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should write a pass to do the normalization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few more comments/nits, overall I would like if we had more TODO comments in the code to note what is missing/not supported yet since I think it's pretty easy to miss. Also could you double check running linter on all the files just in case? thx 🙏
Thanks @altanh for the great suggestion, we should always add TODOs to prevent us from forgetting something during the set of milestone landings! I fixed linting issues for the files changed in this PR, but there are quite a few more in other files. I think we could submit a separate PR to fix those ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with super minor nits, merge when ready 💪
LGTM! Thanks @YuchenJin |
Thank you so much @altanh @ZihengJiang for the review! :) |
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
In this PR, I introduce a StmtFunctor `RenewDefs` for deep copy all definition nodes in PrimFunc (including Var, Buffer, and IterVar). This functor can create a new PrimFunc with the same behavior as the old one but contains different Nodes. This Functor may help TIR fusion or inline multiple PrimFuncs (cherry picked from commit 445d36e63b4e10be7c4fa7f159c55c20bb1ad06e)
In this PR, I introduce a StmtFunctor `RenewDefs` for deep copy all definition nodes in PrimFunc (including Var, Buffer, and IterVar). This functor can create a new PrimFunc with the same behavior as the old one but contains different Nodes. This Functor may help TIR fusion or inline multiple PrimFuncs (cherry picked from commit 445d36e63b4e10be7c4fa7f159c55c20bb1ad06e)
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* relax.cumsum * Legalizer for expand_dims * relax.trilu * relax.cast * Legalizer for batch_norm and flatten * relax.take * relax.full * relax.split * relax.broadcast_to * relax.strided_slice * relax.image.resize2d * relax.nn.max_pool2d * relax.nn.adaptive_avg_pool2d
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* relax.cumsum * Legalizer for expand_dims * relax.trilu * relax.cast * Legalizer for batch_norm and flatten * relax.take * relax.full * relax.split * relax.broadcast_to * relax.strided_slice * relax.image.resize2d * relax.nn.max_pool2d * relax.nn.adaptive_avg_pool2d
* relax.cumsum * Legalizer for expand_dims * relax.trilu * relax.cast * Legalizer for batch_norm and flatten * relax.take * relax.full * relax.split * relax.broadcast_to * relax.strided_slice * relax.image.resize2d * relax.nn.max_pool2d * relax.nn.adaptive_avg_pool2d
* relax.cumsum * Legalizer for expand_dims * relax.trilu * relax.cast * Legalizer for batch_norm and flatten * relax.take * relax.full * relax.split * relax.broadcast_to * relax.strided_slice * relax.image.resize2d * relax.nn.max_pool2d * relax.nn.adaptive_avg_pool2d
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
* VM compiler. * Update. * Compile IRmodule; expose Python api * Add dtype contant serialization and type hint. * Address comments. * Add todos and fix lint. * Update * Update.
M2d: relax --> VM compile --> run on VM.
Currently, the VM compiler only supports compiling a call-packed form Relax program with static shape. PrimFunc lowering and symbolic shape compilation will be in future PRs.
(Note: we relax the VM constant pool to contain
TVMRetValue
instead ofObjectRef
to support emittingDataType
to the pool.)