You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/11/18 18:42:22 UTC

[GitHub] [incubator-tvm] comaniac commented on pull request #6888: Refactor compile_engine to introduce TETranslator

comaniac commented on pull request #6888:
URL: https://github.com/apache/incubator-tvm/pull/6888#issuecomment-729878479


   In this implementation we need to call lower twice, which I think would introduce unnecessary overheads to the `build` flow. If your ultimate goal is to lower a Relay function to a TE compute without applying the TOPI schedule, then it looks like we can improve #6903. It currently works like the following:
   
   - Set `PassContext.config.relay.backend.use_auto_scheduler` to `True`.
   - In `compile_engine`, if `PassContext.config.relay.backend.use_auto_scheduler` is `True` and there is no auto_scheduler schedule, then returns an initial schedule (created by `te.create_schedule`).
   
   To achieve your goal, maybe we simply set `PassContext.config.relay.backend.use_auto_scheduler` to `True` and directly call `ScheduleGetter` in `TVM_REGISTER_GLOBAL("relay.backend._TranslateToTE")`. In this case, since we don't provide auto_scheduler schedule, you'll just get an initial schedule. In this way, we won't affect any existing flow but just provide another path for getting the TE graph. Then we just need to focus on refining the message such as "Cannot find a config for ...".
   
   In addition, the name "translate_to_te" is misleading to me. First, Relay and TE are not at the same IR level, so "lower" would be more proper than "translate". Second, if you prefer just provide an API to "lower a Relay function to a TE compute with an initial schedule" instead of "any possbile schedule (i.e., TOPI schedule or auto_scheduler shcedule)", then this API should be like `lower_to_te_compute` (the initial schedule is just the same as the compute); otherwise it should be `lower_to_te(func, schedule=[initial, autotvm, auto_scheduler])`.
   
   cc @zhiics @merrymercy 
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org