tqchen commented on code in PR #15141:
URL: https://github.com/apache/tvm/pull/15141#discussion_r1239862522


##########
python/tvm/dlight/gpu/default_schedule.py:
##########
@@ -0,0 +1,89 @@
+# pylint: disable=missing-docstring
+from typing import Callable
+
+from tvm import tir
+from tvm._ffi import get_global_func
+from tvm.ir import IRModule
+from tvm.ir.transform import PassContext, module_pass
+from tvm.target import Target
+
+
+def _default_schedule(  # pylint: disable=too-many-locals
+    func: tir.PrimFunc,
+    target: Target,
+) -> tir.PrimFunc:
+    max_threads_per_block = None
+    for name in ["max_threads_per_block", "max_num_threads"]:
+        if max_threads_per_block is None:
+            max_threads_per_block = target.attrs.get(name, None)
+    if max_threads_per_block is None:

Review Comment:
   Should have one schedule_rule, and invoke that schedule rule here. The 
schedule do not need to match all instances. Dlight is meant to get performant 
schedules 



##########
python/tvm/dlight/gpu/default_schedule.py:
##########
@@ -0,0 +1,89 @@
+# pylint: disable=missing-docstring
+from typing import Callable
+
+from tvm import tir
+from tvm._ffi import get_global_func
+from tvm.ir import IRModule
+from tvm.ir.transform import PassContext, module_pass
+from tvm.target import Target
+
+
+def _default_schedule(  # pylint: disable=too-many-locals
+    func: tir.PrimFunc,
+    target: Target,
+) -> tir.PrimFunc:
+    max_threads_per_block = None
+    for name in ["max_threads_per_block", "max_num_threads"]:
+        if max_threads_per_block is None:
+            max_threads_per_block = target.attrs.get(name, None)
+    if max_threads_per_block is None:

Review Comment:
   Should have one schedule_rule, and invoke that schedule rule here. The 
schedule do not need to match all instances (match tag is fine). Dlight is 
meant to get performant schedules 



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