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/24 09:07:59 UTC

[GitHub] [tvm] yzh119 opened a new pull request #10370: [fix] Convert BufferSlice to BufferLoad when used as range/loop start and end

yzh119 opened a new pull request #10370:
URL: https://github.com/apache/tvm/pull/10370


   A quick fix of the parser issue mentioned in #10327 .
   Ranges and loops require `start` and `stop` to be PrimExpr, however, `BufferSlice` is not always scalar so it's not a `PrimExpr`.
   This PR performs the transformation.
   
   A deeper question is should we make `BufferSlice` a `PrimExpr`? 
   
   CC @MasterJH5574 @Hzfengsy 


-- 
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] yzh119 commented on a change in pull request #10370: [fix] Convert BufferSlice to BufferLoad when used as range/loop start and end

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



##########
File path: tests/python/unittest/test_tvmscript_bufferslice_loop_range.py
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       DONE




-- 
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 a change in pull request #10370: [fix] Convert BufferSlice to BufferLoad when used as range/loop start and end

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



##########
File path: tests/python/unittest/test_tvmscript_bufferslice_loop_range.py
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       I suggest moving this test to the round-trip test file? That makes sense to me and I think there's no need for a new file.

##########
File path: tests/python/unittest/test_tvmscript_bufferslice_loop_range.py
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import tvm
+from tvm.script import tir as T
+
+
+@T.prim_func
+def segment_sum(A_ptr: T.handle, B_ptr: T.handle, indptr_ptr: T.handle, n: T.int32, m: T.int32) -> None:
+    A = T.match_buffer(A_ptr, [m], dtype="float32")
+    B = T.match_buffer(B_ptr, [n], dtype="float32")
+    indptr = T.match_buffer(indptr_ptr, [n + 1], dtype="int32")
+    # body
+    # with T.block("root")

Review comment:
       Heyy perhaps we can remove them.




-- 
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] junrushao1994 commented on pull request #10370: [fix] Convert BufferSlice to BufferLoad when used as range/loop start and end

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


   Thanks @yzh119!!


-- 
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] junrushao1994 merged pull request #10370: [fix] Convert BufferSlice to BufferLoad when used as range/loop start and end

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


   


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