abhikran-quic commented on code in PR #14854:
URL: https://github.com/apache/tvm/pull/14854#discussion_r1209785817


##########
tests/python/unittest/test_tir_schedule_compute_at.py:
##########
@@ -995,6 +995,41 @@ def 
floordiv_and_floormod_indices_after_reverse_compute_at(a: T.handle, b: T.han
                 Y[v_i] = temp[v_i // 16, v_i % 16]
 
 
[email protected]_func
+def recursive_floordiv_and_floormod_indices(a: T.handle, b: T.handle) -> None:
+    X = T.match_buffer(a, [16, 16])
+    Y = T.match_buffer(b, [256])
+    temp = T.alloc_buffer([16, 4, 2, 2])
+    for i, j in T.grid(16, 16):
+        with T.block("A"):
+            v_i, v_j = T.axis.remap("SS", [i, j])
+            temp[v_i, v_j // 4, (v_j % 4) //2, v_j % 2] = X[v_j, v_i] + 1.0
+    for i, j in T.grid(16, 16):
+        with T.block("B"):
+            v_i, v_j = T.axis.remap("SS", [i, j])
+            Y[v_i*16 + v_j] = temp[v_i, v_j // 4, (v_j % 4) // 2, (v_j %2)]
+
+
[email protected]_func
+def recursive_floordiv_and_floormod_indices_after_reverse_compute_at(a: 
T.handle, b: T.handle) -> None:
+    X = T.match_buffer(a, [16, 16])
+    Y = T.match_buffer(b, [256])
+    temp = T.alloc_buffer((16, 4, 2, 2))
+    for i in range(16):
+        for j in range(16):
+            with T.block("A"):
+                v_i, v_j = T.axis.remap("SS", [i, j])
+                T.reads(X[v_j, v_i])
+                T.writes(temp[v_i, v_j // 4, v_j % 4 // 2, v_j % 2])
+                temp[v_i, v_j // 4, v_j % 4 // 2, v_j % 2] = X[v_j, v_i] + 
T.float32(1)

Review Comment:
   I'm seeing an error while applying `reverse_compute_at` using the index_map 
shared above.
   Could you please tell if the idea is to check for indices access for 
non-bijective form ?



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