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 2023/01/15 20:09:25 UTC

[GitHub] [tvm] MasterJH5574 opened a new pull request, #13788: [Fix] Buffer slicing using idnex dtype as extent

MasterJH5574 opened a new pull request, #13788:
URL: https://github.com/apache/tvm/pull/13788

   This PR fixes a bug of TIR Buffer `__getitem__` on Python side.
   
   Whenever the `__getitem__` parameter is a multi-dim slice, on non-slice dimension a Range will be created. Prior to this PR, that range will have int32 dtype in regardless of the `start`, while the proper behavior is to generate the extent according to the dtype of `start` when `start` is a PrimExpr.
   
   This PR fixes the issue and provides a regression test.


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


[GitHub] [tvm] tqchen merged pull request #13788: [TIR][Fix] Buffer slicing using index dtype as extent

Posted by GitBox <gi...@apache.org>.
tqchen merged PR #13788:
URL: https://github.com/apache/tvm/pull/13788


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


[GitHub] [tvm] MasterJH5574 commented on pull request #13788: [Fix] Buffer slicing using index dtype as extent

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on PR #13788:
URL: https://github.com/apache/tvm/pull/13788#issuecomment-1383296583

   > LGTM, and would you like to revert the change to `3rdparty/cutlass`? Seems like irrelevant
   
   @junrushao Sorry my bad. I didn’t notice that... Will do later.


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


[GitHub] [tvm] tvm-bot commented on pull request #13788: [Fix] Buffer slicing using idnex dtype as extent

Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13788:
URL: https://github.com/apache/tvm/pull/13788#issuecomment-1383240021

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-ccs-start-->
    * No users to tag found in teams: `fix` <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


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


[GitHub] [tvm] Hzfengsy commented on a diff in pull request #13788: [TIR][Fix] Buffer slicing using index dtype as extent

Posted by GitBox <gi...@apache.org>.
Hzfengsy commented on code in PR #13788:
URL: https://github.com/apache/tvm/pull/13788#discussion_r1070814965


##########
tests/python/unittest/test_tvmscript_regression.py:
##########
@@ -73,9 +74,17 @@ def func_ref():
     tvm.ir.assert_structural_equal(test_case, func_ref)
 
 
+def test_tir_buffer_region_extent_correct_dtype():
+    @T.prim_func
+    def func(A: T.Buffer[(T.int64(16), T.int64(1)), "float32"]):
+        for i in T.grid(T.int64(16)):
+            with T.block("block"):
+                vi = T.axis.remap("S", [i])
+                T.reads(A[vi, T.int64(0) : T.int64(1)])
+                T.evaluate(0)
+
+    assert func.body.block.body.body.block.reads[0].region[0].extent.dtype == "int64"
+
+
 if __name__ == "__main__":
-    a = numpy.zeros((10, 10), dtype="int8")
-    test_multi_element_array_in_outmost_namespace()
-    test_different_dtype_assignment_to_var()
-    b = 1
-    test_var_capturing_order()
+    tvm.testing.main()

Review Comment:
   `a = numpy.zeros((10, 10), dtype="int8")` here is to test var capturing in https://github.com/apache/tvm/pull/13640. I appreciate it if you could revert it and add a comment here. 



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


[GitHub] [tvm] MasterJH5574 commented on pull request #13788: [Fix] Buffer slicing using idnex dtype as extent

Posted by GitBox <gi...@apache.org>.
MasterJH5574 commented on PR #13788:
URL: https://github.com/apache/tvm/pull/13788#issuecomment-1383242450

   cc @cyx-6 @junrushao @tqchen 


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