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/04/23 16:44:32 UTC

[GitHub] [tvm] comaniac commented on a change in pull request #7898: [TE] Fix bug if find a loop in compute_at attach path

comaniac commented on a change in pull request #7898:
URL: https://github.com/apache/tvm/pull/7898#discussion_r619359694



##########
File path: tests/python/unittest/test_te_schedule.py
##########
@@ -321,6 +321,33 @@ def test_legalize_invalid_attach():
     assert isinstance(stmt, tvm.tir.stmt.For)
 
 
+def test_compute_at():
+    def add():
+        shape = (16, 16)
+        A = tvm.te.compute(shape, lambda *i: 1.0, name="A")
+        B = tvm.te.compute(shape, lambda *i: 2.0, name="B")
+        C = tvm.te.compute(shape, lambda *i: A(*i) + B(*i), name="C")
+        return A, B, C
+
+    def invalid_compute_at_self():
+        A, B, C = add()
+        s = tvm.te.create_schedule(C.op)
+        s[C].compute_at(s[C], C.op.axis[0])

Review comment:
       I would prefer throwing an error tho. If this statement is written by users, we should at least give a warning instead of dismissing it silently; otherwise users may not know this statement has to be fixed. If the statement is generated by auto-scheduler, we just need to catch the failure and throw the schedule away. Taking both cases into consideration, throwing an error is more reasonable, because we don't want to see lots of warnings during the tuning process.




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