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 2022/02/20 03:54:47 UTC

[GitHub] [tvm] Hzfengsy commented on a change in pull request #10327: [Arith] Support integer BufferLoad in IntervalSetEvaluator

Hzfengsy commented on a change in pull request #10327:
URL: https://github.com/apache/tvm/pull/10327#discussion_r810565801



##########
File path: tests/python/unittest/test_tir_transform_compact_buffer_region.py
##########
@@ -505,6 +505,74 @@ def compacted_opaque_access_annotated_func(a: T.handle) -> None:
                 T.store(C.data, i, T.load("float32", B.data, i))
 
 
+@T.prim_func
+def sparse_read_cache(
+    A_data: T.Buffer[(819,), "float32"],
+    B: T.Buffer[(128,), "float32"],
+    A_indptr: T.Buffer[(129,), "int32"],
+    A_indices: T.Buffer[(819,), "int32"],
+) -> None:
+    for i in T.serial(128):
+        with T.block("rowsum_outer"):
+            T.reads(
+                A_indptr[i],
+                A_indptr[i + 1],
+                A_data[A_indptr[i] + 0 : A_indptr[i] + (A_indptr[i + 1] - A_indptr[i])],

Review comment:
       ```suggestion
                   A_data[A_indptr[i] : A_indptr[i + 1]],
   ```

##########
File path: tests/python/unittest/test_tir_transform_compact_buffer_region.py
##########
@@ -505,6 +505,74 @@ def compacted_opaque_access_annotated_func(a: T.handle) -> None:
                 T.store(C.data, i, T.load("float32", B.data, i))
 
 
+@T.prim_func
+def sparse_read_cache(
+    A_data: T.Buffer[(819,), "float32"],
+    B: T.Buffer[(128,), "float32"],
+    A_indptr: T.Buffer[(129,), "int32"],
+    A_indices: T.Buffer[(819,), "int32"],
+) -> None:
+    for i in T.serial(128):
+        with T.block("rowsum_outer"):
+            T.reads(
+                A_indptr[i],
+                A_indptr[i + 1],

Review comment:
       IIRC, we don't allow annotating one buffer twice in `read` and `write` regions. Here it's better to be `A_indptr[i: i + 1]`




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org