[Unity][TVMScript] Fix prim_func lost issue in relax.emit_te#14189
[Unity][TVMScript] Fix prim_func lost issue in relax.emit_te#14189Hzfengsy merged 4 commits intoapache:unityfrom
Conversation
|
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 |
4f59131 to
1bd78b4
Compare
|
please run the following commend to update to latest change |
1bd78b4 to
16be499
Compare
|
Have fixed the comments, pls take another look. cc @Hzfengsy |
src/script/ir_builder/ir/ir.cc
Outdated
| } | ||
| } | ||
|
|
||
| GlobalVar AddFunction(const BaseFunc& func, String func_name_hint) { |
There was a problem hiding this comment.
What's the difference between these two functions and DeclFunction, DefFunction?
There was a problem hiding this comment.
The main difference is FindModuleFrame used in DeclFunction and DefFunction, the two guys are required to be called immediately under I.ir_module(). AddFunction and UpdateFunction don't have this restriction.
Tried to use decl_function in emit_te, ran into error ValueError: 'I.DeclFunction' must be called immediately under I.ir_module()
There was a problem hiding this comment.
Could you enhance those two instead of writing two new ones?
Excaully ValueError: 'I.DeclFunction' must be called immediately under I.ir_module() is not necessary in this case
There was a problem hiding this comment.
cool, thanks for letting me know that! Have removed add/update_function then. pls take another look
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The `prim_func`s were not added into the same `ir_module`. The pr is to fix this issue, move some `call_tir` input handling code from `bb.call_te` to utils, then it is able to be leveraged by both `bb.emit_te` and `R.emit_te`.
Previously R.emit_te was introduced in #14123. The
prim_funcs were not added into the sameir_module. The pr is to fix this issue, move somecall_tirinput handling code frombb.call_teto utils, then it is able to be leveraged by bothbb.emit_teandR.emit_te.cc: @psrivas2 @tqchen