masahi commented on code in PR #10876:
URL: https://github.com/apache/tvm/pull/10876#discussion_r842232260


##########
python/tvm/meta_schedule/testing/utils.py:
##########
@@ -110,3 +116,46 @@ def initialize_with_tune_context(self, context: 
"TuneContext") -> None:
 
     def apply(self, trace: Trace, _) -> Optional[Trace]:
         return Trace(trace.insts, {})
+
+
+def apply_fixed_schedules(
+    relay_mod: Union[RelayFunc, IRModule],
+    target: Union[str, Target],
+    params: Optional[Dict[str, NDArray]],
+    schedule_fn: Callable[[ExtractedTask, Schedule], bool],
+):
+    """Apply fixed schedules (manually written, without any tunable knobs) as 
specified by
+    schedule_fn to extracted tasks, and return a database that can be passed 
to ApplyHistoryBest.
+
+    Parameters
+    ----------
+    mod : Union[RelayFunc, IRModule]
+        The Relay module to apply fixed schedules.
+    target : Union[str, Target]
+        The target used to extract tasks.
+    params : Optional[Dict[str, tvm.runtime.NDArray]]
+        The associated parameters of the module.
+    schedule_fn : Callable[[ExtractedTask, Schedule], bool]

Review Comment:
   That's possible, but that will force users to write
   
   ```
   mod = Parse._mod(task.dispatched[0])
   sch = Schedule(mod)
   ```
   
   in every `schedule_fn` callback. I think this boilerplate is non-trivial 
(users shouldn't care about `dispatched` or `Parse` stuff).



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

Reply via email to