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 2021/03/02 22:32:06 UTC

[GitHub] [tvm] comaniac opened a new pull request #7571: [AutoScheduler] Query in task extraction

comaniac opened a new pull request #7571:
URL: https://github.com/apache/tvm/pull/7571


   This PR deals with the case that we may want to extract tuning tasks from a JIT model that compiles each subgraph when first time executing the model graph. In this case, we need at least one valid schedule (for GPU) to make sure we can visit the whole graph and collect all tasks, but this may not be the case especially for the backward model.
   
   The above puzzle forms a chicken egg problem -- we don't have valid schedules so we need to extract tasks to tune, but we need at least one valid schedule in order to extract tasks. This PR solves this puzzle by sampling one valid schedule during task extraction:
   
   ```python
       env_sample = auto_scheduler.ApplyHistoryBestOrSample("temp.log", num_measure=2)
       env_tracing_task = auto_scheduler.relay_integration.TracingEnvironment(
           auto_scheduler.relay_integration.TracingMode.EXTRACT_COMPLEX_TASK_ONLY
       )
       with env_sample:
           with env_tracing_task:
               # Run the JIT model.
   ```
   
   The idea is once we found that there's no valid schedule of the task being collected, we immediately sample a valid schedule and use it for the current subgraph. In this way, we guarantee the graph can be visited from beginning to the end.
   
   cc @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



[GitHub] [tvm] comaniac commented on pull request #7571: [AutoScheduler] Querying and sampling in task extraction

Posted by GitBox <gi...@apache.org>.
comaniac commented on pull request #7571:
URL: https://github.com/apache/tvm/pull/7571#issuecomment-790176040


   Thanks @merrymercy @jcf94 


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



[GitHub] [tvm] comaniac merged pull request #7571: [AutoScheduler] Querying and sampling in task extraction

Posted by GitBox <gi...@apache.org>.
comaniac merged pull request #7571:
URL: https://github.com/apache/tvm/pull/7571


   


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