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/09/15 00:36:35 UTC

[GitHub] [tvm] cyx-6 opened a new pull request, #12786: [TVMScript] IRBuilder methods for `For`

cyx-6 opened a new pull request, #12786:
URL: https://github.com/apache/tvm/pull/12786

   This PR introduces remaining IRBuilder methods for `For`.
   
   Co-authored-by: yongwww <yo...@gmail.com>
   


-- 
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] junrushao commented on a diff in pull request #12786: [TVMScript] IRBuilder methods for `For`

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


##########
include/tvm/script/ir_builder/tir/frame.h:
##########
@@ -187,6 +187,51 @@ class BlockFrame : public TIRFrame {
   TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(BlockFrame, TIRFrame, BlockFrameNode);
 };
 
+/*!
+ * \brief A frame that represents the for loop.
+ *
+ * \sa BlockInitFrame

Review Comment:
   ```suggestion
    * \sa ForFrame
   ```



-- 
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] junrushao merged pull request #12786: [TVMScript] IRBuilder methods for `For`

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


-- 
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] junrushao commented on a diff in pull request #12786: [TVMScript] IRBuilder methods for `For`

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


##########
include/tvm/script/ir_builder/tir/frame.h:
##########
@@ -187,6 +187,51 @@ class BlockFrame : public TIRFrame {
   TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(BlockFrame, TIRFrame, BlockFrameNode);
 };
 
+/*!
+ * \brief A frame that represents the for loop.
+ *
+ * \sa BlockInitFrame
+ */
+class ForFrameNode : public TIRFrameNode {
+ public:
+  /*! \brief The for loop generating function type. */
+  using FMakeForLoop =
+      runtime::TypedPackedFunc<tvm::tir::Stmt(Array<tvm::tir::Var>, Array<Range>, tvm::tir::Stmt)>;

Review Comment:
   ```suggestion
     /*!
      * \brief Functions that generate loop nests.
      * \param loop_vars The loop variables, from outer to inner
      * \param loop_extents The loop extents that correspond to loop variables
      * \param loop_body The loop body
      * \return A stmt, the loop nest
      */
     using FMakeForLoop =
         runtime::TypedPackedFunc<tvm::tir::Stmt(Array<tvm::tir::Var> loop_vars, Array<Range> loop_extents, tvm::tir::Stmt loop_body)>;
   ```



-- 
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] cyx-6 commented on a diff in pull request #12786: [TVMScript] IRBuilder methods for `For`

Posted by GitBox <gi...@apache.org>.
cyx-6 commented on code in PR #12786:
URL: https://github.com/apache/tvm/pull/12786#discussion_r972316972


##########
include/tvm/script/ir_builder/tir/frame.h:
##########
@@ -187,6 +187,51 @@ class BlockFrame : public TIRFrame {
   TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(BlockFrame, TIRFrame, BlockFrameNode);
 };
 
+/*!
+ * \brief A frame that represents the for loop.
+ *
+ * \sa BlockInitFrame

Review Comment:
   updated



##########
include/tvm/script/ir_builder/tir/frame.h:
##########
@@ -187,6 +187,51 @@ class BlockFrame : public TIRFrame {
   TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(BlockFrame, TIRFrame, BlockFrameNode);
 };
 
+/*!
+ * \brief A frame that represents the for loop.
+ *
+ * \sa BlockInitFrame
+ */
+class ForFrameNode : public TIRFrameNode {
+ public:
+  /*! \brief The for loop generating function type. */
+  using FMakeForLoop =
+      runtime::TypedPackedFunc<tvm::tir::Stmt(Array<tvm::tir::Var>, Array<Range>, tvm::tir::Stmt)>;

Review Comment:
   updated



-- 
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] cyx-6 commented on a diff in pull request #12786: [TVMScript] IRBuilder methods for `For`

Posted by GitBox <gi...@apache.org>.
cyx-6 commented on code in PR #12786:
URL: https://github.com/apache/tvm/pull/12786#discussion_r972317258


##########
python/tvm/script/ir_builder/tir/frame.py:
##########
@@ -34,3 +36,10 @@ class PrimFuncFrame(TIRFrame):
 @_register_object("script.ir_builder.tir.BlockFrame")
 class BlockFrame(TIRFrame):
     ...
+
+
+@_register_object("script.ir_builder.tir.ForFrame")
+class ForFrame(TIRFrame):
+    def __enter__(self) -> List[Var]:

Review Comment:
   updated



-- 
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] junrushao commented on a diff in pull request #12786: [TVMScript] IRBuilder methods for `For`

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


##########
python/tvm/script/ir_builder/tir/frame.py:
##########
@@ -34,3 +36,10 @@ class PrimFuncFrame(TIRFrame):
 @_register_object("script.ir_builder.tir.BlockFrame")
 class BlockFrame(TIRFrame):
     ...
+
+
+@_register_object("script.ir_builder.tir.ForFrame")
+class ForFrame(TIRFrame):
+    def __enter__(self) -> List[Var]:

Review Comment:
   ```suggestion
       def __enter__(self) -> Union[Var, List[Var]]:
   ```



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