masahi commented on code in PR #14168:
URL: https://github.com/apache/tvm/pull/14168#discussion_r1133606097


##########
include/tvm/te/schedule.h:
##########
@@ -445,6 +446,26 @@ class Schedule : public ObjectRef {
   using ContainerType = ScheduleNode;
 };
 
+/*!
+ * \brief Context helper to collect debug information of Schedule.
+ *
+ *  Attach With<ScheduleContext>(schedule_instance, primitive_name)
+ *  inside function body of schedule primitives to collect the
+ *  snapshot of schedule status and corresponding primitive name
+ */
+class ScheduleContext {
+ private:
+  friend class With<ScheduleContext>;
+  ScheduleContext(const ScheduleNode* sch_node, String current_primitive_name);
+  void EnterWithScope();
+  void ExitWithScope();
+
+  /*! \brief the Schedule instance to store debug information */

Review Comment:
   information for



##########
include/tvm/te/schedule.h:
##########
@@ -546,6 +567,8 @@ class StageNode : public Object {
   IterVar attach_ivar;
   /*! \brief The stage this node attaches to */
   Stage attach_stage;
+  /*! \brief The schedule of current stage attaches to */
+  const ScheduleNode* attach_sch;

Review Comment:
   The schedule the current stage is attached to



##########
python/tvm/contrib/tedd.py:
##########
@@ -78,6 +78,30 @@ def insert_dot_id(sch):
     return sch
 
 
+def itervar_equal(iv_a, iv_b):
+    """A helper method that compares the equality of two iterative variables"""
+    # after schedule.normalize was called, domains of iterative variables 
inside
+    # stage.leaf_iter_vars would be discarded and expected to be inferred in 
later
+    # InferBound call
+    # this rebase behavior would make plain comparison fail (i.e. ivar == 
itervar)

Review Comment:
   What is "rebase behavior"



##########
include/tvm/te/schedule.h:
##########
@@ -445,6 +446,26 @@ class Schedule : public ObjectRef {
   using ContainerType = ScheduleNode;
 };
 
+/*!
+ * \brief Context helper to collect debug information of Schedule.
+ *
+ *  Attach With<ScheduleContext>(schedule_instance, primitive_name)
+ *  inside function body of schedule primitives to collect the
+ *  snapshot of schedule status and corresponding primitive name
+ */
+class ScheduleContext {
+ private:
+  friend class With<ScheduleContext>;
+  ScheduleContext(const ScheduleNode* sch_node, String current_primitive_name);
+  void EnterWithScope();
+  void ExitWithScope();
+
+  /*! \brief the Schedule instance to store debug information */
+  Schedule sch_;
+  /*! \brief string represents which primitive applied to Schedule */

Review Comment:
   String representing which primitive has been applied to sch_



##########
include/tvm/te/schedule.h:
##########
@@ -615,12 +638,32 @@ class ScheduleNode : public Object {
    *  This is created on demand and can be invalidated.
    */
   std::unordered_map<const Object*, Stage> op2stage_cache_;
+  /*!
+   * \brief list of all schedules during primitives applied to stages.

Review Comment:
   Broken sentence.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to