Mousius commented on PR #13606: URL: https://github.com/apache/tvm/pull/13606#issuecomment-1352929237
> @Mousius The new function simply composes the existing interface to the TECompiler, `LowerTECompute` and `CreatePrimFunc` that converts lowered TE compute to TensorIR. `LowerTECompute` was introduced after the compile engine refactor you mentioned completed, and made only possible thanks to that refactoring work. So I don't get your concern here. I find this equally concerning, given this is also exposing more of the internals of the TE Compiler rather than having clear boundaries within the codebase. > What I wanted to add is a simple interface that converts one Relay primitive function to the corresponding TIR prim func. Then I realized that backend/task_extraction.cc already has code that does exactly that, so I simply extracted into a reusable function and exposed it to Python. We require the input to be a primitive function, so we never generates multiple TIR prim funcs. Exposing it python and as part of the public API means others can access it, which means that we have to support it as a way of using the compiler rather than as an aspect of meta-scheduler. This is similar to the previous methods that we were unable to deprecate in https://github.com/apache/tvm/pull/13606. > This is just a convention of MetaSchedule, storing an IRModule with one prim func as a task. I didn't change any behavior about task extraction in this PR. What we want is a `relay::Function -> tir::PrimFunc` interface, `IRModule -> IRModule` is valid but it wouldn't convey what this new API is meant for. `LowerTE` is also overkill since I don't need to lower schedules and I'm not concerned about external codegen etc. I don't think `LowerTE` is overkill in practice, if it doesn't find any external codegen or other things to do it won't take any action - it's a standardised interface between two modules in the codebase, you've already indicated meta schedule is breaking that boundary and that leads us back to the original issues with CompileEngine. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
