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/06/10 12:19:21 UTC

[GitHub] [tvm] Beya2019 opened a new pull request #8235: [TVMSCRIPT] add more type support in script function parameter

Beya2019 opened a new pull request #8235:
URL: https://github.com/apache/tvm/pull/8235


   Now the function parameters decorated by @tvm.script.tir only support int32 and handle.
   If we have such a demand: func parameters need to be int8 float32 and float16, we can only  write this
   (if c is a float32 data)
   ```
   @tvm.script.tir
   def func(a: ty.handle, b: ty.handle) -> None:
       A = tir.match_buffer(b, (1, 5), "float32")
       B = tir.match_buffer(c, (1), "float32")
       with tir.block([1, 5], "init") as [vi, vj]:
           A[vi, vj] = B[0]
   ```
   Would it be better like this(Under the premise of defining ty.float32) 
   ```
   @tvm.script.tir
   def func(a: ty.handle b: ty.float32) -> None:
       A = tir.match_buffer(b, (1, 5), "float32")
       A[vi, vj] = b
   ```
   In the future, if we use script to define more operators like the iou_threshold non_max_suppression and on_value/off_value in one_hot, this will simplify our coding IMO.
   


-- 
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] tqchen commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   Thanks @Beya2019 , can you add a regression testcase? Right now we do support passing in value arguments


-- 
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] tkonolige commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   @tqchen Is this something we wish to support?


-- 
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] Beya2019 commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   > Hi @Beya2019, let's fix these CI errors and this PR will be fine to merge.
   
   Already fix CI errors. Please help to merge it. Thanks very much.


-- 
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 pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   Hi @Beya2019, let's fix these CI errors and this PR will be fine to merge.


-- 
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] Beya2019 commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   > Can you also add `int16`, `int64`, and `float64`?
   
   OK, Now support types as below:
   ```
   int8 = ConcreteType("int8")
   int16 = ConcreteType("int16")
   int32 = ConcreteType("int32")
   int64 = ConcreteType("int64")
   float16 = ConcreteType("float16")
   float32 = ConcreteType("float32")
   float64 = ConcreteType("float64")
   bool = ConcreteType("bool")
   handle = ConcreteType("handle")
   ```


-- 
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] Beya2019 commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   > Thanks @Beya2019 , can you add a regression testcase? Right now we do support passing in value arguments
   
   Already added the get_valid_counts in test_tvmscript_ops.py
   ```
   @tvm.script.tir
   def get_valid_counts(
       data: ty.handle,
       valid_count: ty.handle,
       out: ty.handle,
       out_indices: ty.handle,
       score_threshold: ty.float32,
       id_index: ty.int32,
       score_index: ty.int32,
   ) -> None:
   ```
   
   In this operator, the data type of score_threshold is ty.float32 which is our newly supported situation


-- 
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] Beya2019 commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   > Thanks @Beya2019 , can you add a regression testcase? Right now we do support passing in value arguments
   
   


-- 
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] tkonolige commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   Can you also add `int16`, `int64`, and `float64`?


-- 
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] Beya2019 removed a comment on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

Posted by GitBox <gi...@apache.org>.
Beya2019 removed a comment on pull request #8235:
URL: https://github.com/apache/tvm/pull/8235#issuecomment-861116899






-- 
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] Beya2019 closed pull request #8235: [TVMSCRIPT] add more type support in script function parameter

Posted by GitBox <gi...@apache.org>.
Beya2019 closed pull request #8235:
URL: https://github.com/apache/tvm/pull/8235


   


-- 
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 pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   > > Hi @Beya2019, let's fix these CI errors and this PR will be fine to merge.
   > 
   > Already fix CI errors. Please help to merge it. Thanks very much.
   
   Great! @Beya2019 Now merged.
   Thanks! @tkonolige @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.

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



[GitHub] [tvm] Beya2019 commented on pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   > > Thanks @Beya2019 , can you add a regression testcase? Right now we do support passing in value arguments
   
   


-- 
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 merged pull request #8235: [TVMSCRIPT] add more type support in script function parameter

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


   


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