junrushao1994 commented on a change in pull request #5:
URL: https://github.com/apache/tvm-rfcs/pull/5#discussion_r676879435



##########
File path: rfcs/0001-meta-schedule-autotensorir.md
##########
@@ -266,55 +322,83 @@ sch.reorder(l14, l18, l15, l19, l22, l16, l20, l23, l17, 
l21)
 ### 4.2. Exploring the Design Space
 
 Meta Schedule provides several built-in exploration strategies to exhaustively 
or efficiently search
-for efficient schedules.
-
-**Random search by replaying schedule functions.** With a user-provided 
schedule function
-as a black-box design space generator, our system could repetitively invoke 
such an opaque function
-without doing any extra analysis. The function could be written in C++ or 
Python, or any language
-that implements packed function FFI. If sampling instructions are present in 
the function, then each
-invocation results in a different IRModule after being scheduled because the 
random decisions are
-possibly changed across different runs. Effectively, it is equivalent to
-random exploration without trace, allowing the flexibility for users to define 
arbitrary functions
+for efficient schedules. Those strategies are mostly supported by re-execute 
either a function or a
+trace with a builtin interpreter in meta schedule, and this process is called 
**replay**.
+
+#### Random search by replaying schedule functions
+
+With a user-provided schedule function
+as a black-box design space generator, meta schedule could repetitively 
invokes such an opaque TVM
+packed function without doing any extra analysis.
+If sampling instructions are present in the trace, then scheduling is 
non-deterministic
+(random decisions may not be repeated across runs)

Review comment:
       Yeah I should clarify more straightforward: a trace with decisions 
strictly guarantees reproducibility.
   
   In detail, a trace is defined as:
   
   ```python
   class Trace:
     instructions: List[Instruction]
     decisions: Dict[Instruction, Any]
   ```
   
   For each sampling instruction in the trace, if it has a corresponding entry 
in the decisions dict, then the output is uniquely determined by the decision, 
hence reproducibility is guaranteed (Example 1); If a corresponding entry is 
not presented, then randomness will be introduced by interpreting the trace 
(Example 2).
   
   ```python
   # Example 1. Trace with deterministic result
   l1, l2 = sch.sample_perfect_tile(loop, n=2, decisions=[4, 32])  # 
Deterministic l1 = 4, l2 = 32
   # Example 2. Trace with randomized result
   l1, l2 = sch.sample_perfect_tile(loop, n=2)  # l1 and l2 are random
   ```
   




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