-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[TensorIR] CreatePrimFunc from TE #7987
Conversation
Would it be possible to add a name field to the |
Create prim_func returns a PrimFunc, the name is attached in module creation process, we can likely recompose by mod = IRModule({"mycoolname": create_prim_func()) Note such name is different from the global_symbol(name of generated function), which can be set by |
Instead of |
If we really want to encourage the name, and given IRModule is the first class item for running exchange between passes. Let us consider make the function return an IRModule instead, in this case, perhaps we should rename to |
@tkonolige The mechanism causing the issue you mentioned is that when constructing a |
@tqchen The problem of creating an IRModule instead is that we might want to an IRModule that contains multiple PrimFuncs, e.g.: mod = IRModule({
"func_1": create_prim_func(...),
"func_2": create_prim_func(...),
}) |
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
I see, i now agree that we can go with the compositional style API. While I agree with @tkonolige that naming functions is going to be useful. We can do that through the compositional API and when creating example tutorials for scheduling. Thanks @junrushao1994 @Hzfengsy |
Thanks for the great discussion @tkonolige @tqchen @Hzfengsy! I am going to merge it in given there is no objection :-) |
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
Co-authored-by: Tianqi Chen <tqchen@users.noreply.github.com> Co-authored-by: Wuwei Lin <wuwei@apache.org> Co-authored-by: Ruihang Lai <lairuihangdongdong@qq.com>
This PR introduces a method to create PrimFunc (and further TensorIR schedule) from Tensor Expression. (e.g.
te.compute
)cc @tqchen @junrushao1994 @comaniac @jcf94 @xqdan