junrushao1994 commented on a change in pull request #8943:
URL: https://github.com/apache/tvm/pull/8943#discussion_r704967570



##########
File path: src/tir/schedule/concrete_schedule.cc
##########
@@ -439,6 +439,44 @@ BlockRV ConcreteScheduleNode::CacheWrite(const BlockRV& 
block_rv, int write_buff
 
 /******** Schedule: Compute location ********/
 
+void ConcreteScheduleNode::ComputeAt(const BlockRV& block_rv, const LoopRV& 
loop_rv,
+                                     bool preserve_unit_loops) {
+  static StmtSRef inline_mark = StmtSRef::InlineMark();
+  static StmtSRef root_mark = StmtSRef::RootMark();
+  StmtSRef loop_sref = this->GetSRef(loop_rv);

Review comment:
       Here is how it works:
   - `SampleComputeLocation` returns `LoopRV`s that indicate which loops the 
current stage can be moved under. Besides, `SampleComputeLocation` provides 
options to "do nothing" and "do compute-inline" instead of doing compute-at;
   - If the primitive wants to instruct the system to "do nothing" or "do 
compute-inline" instead, it returns LoopRVs that are looked up as inline-mark 
or root-mark;
   - Therefore, on line 211 & 214 in GetSRef, we check if the loop_sref is 
inline-mark or root-mark.
   - In compute-at, it checks the return value of `GetSRef` to determine which 
primitive it should dispatch to
   
   > We should never ever insert InlineMark and RootMark into the symbol table, 
if we do, it is a bug
   
   Sorry I didn't make it clear. I mean they shouldn't be in the symbol table 
as keys, because they are not loop_rvs. I made it wrong previously in our 
private repo so I remembered this bug quite vividly lol.
   




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