comaniac commented on a change in pull request #6107:
URL: https://github.com/apache/incubator-tvm/pull/6107#discussion_r458944675
##########
File path: python/tvm/auto_scheduler/loop_state.py
##########
@@ -371,6 +433,23 @@ def _update_stage_id_map(self):
for index, stage in enumerate(self.stages):
self.stage_id_map[stage.op] = index
+ def _insert_new_stage(self, new_stage_id):
+ added_op = self.stages[new_stage_id].op
+
+ # Add a new stage will change all ops. But we still want to use the
old ops to index stages,
+ # So we keep updating them and do not remove the old ops.
Review comment:
- I know we don't need docstring for internal functions, but it's not a
problem if we need. At least we should put the description in the beginning of
the function.
- `_apply_stage_id_offset` sounds better.
- I didn't mean this function will be used by CacheRead/Write only. I meant
this function is required when we implement a step that changes the stages, but
there's no checking to enforce that. An ideal solution would be having a
function to deal with stage changing and let CacheRead/CacheWrite/Rfactor call
the function.
----------------------------------------------------------------
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:
[email protected]