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/21 13:29:20 UTC

[GitHub] [tvm] leeexyz opened a new pull request #7898: [TE] Fix bug if find a loop in compute_at attach path

leeexyz opened a new pull request #7898:
URL: https://github.com/apache/tvm/pull/7898


   Fix the bug reported at https://discuss.tvm.apache.org/t/incorrect-compute-at-schedule-makes-tvm-stuck/9780/2


-- 
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] merrymercy merged pull request #7898: [TE] Fix bug if find a loop in compute_at attach path

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


   


-- 
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] jcf94 commented on a change in pull request #7898: [TE] Fix bug if find a loop in compute_at attach path

Posted by GitBox <gi...@apache.org>.
jcf94 commented on a change in pull request #7898:
URL: https://github.com/apache/tvm/pull/7898#discussion_r619056528



##########
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:
       Is there any way that we can just dismiss this operation?
   It's fine to raise error here, but I'm thinking that if we can treat compute_at an axis to its self as no effect would be better.




-- 
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] merrymercy merged pull request #7898: [TE] Fix bug if find a loop in compute_at attach path

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


   


-- 
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 a change in pull request #7898: [TE] Fix bug if find a loop in compute_at attach path

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
jcf94 commented on a change in pull request #7898:
URL: https://github.com/apache/tvm/pull/7898#discussion_r619056528



##########
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:
       Is there any way that we can just dismiss this operation?
   It's fine to raise error here, but I'm thinking that if we can treat compute_at a axis to its self as no effect would be better.




-- 
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] leeexyz commented on pull request #7898: [TE] Fix bug if find a loop in compute_at attach path

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


   @merrymercy @comaniac Would you guys help to take a look? Thanks a lot. :)


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