merrymercy commented on a change in pull request #7053:
URL: https://github.com/apache/tvm/pull/7053#discussion_r538817599



##########
File path: python/tvm/auto_scheduler/measure.py
##########
@@ -740,6 +775,7 @@ def local_run(
     min_repeat_ms=0,
     cooldown_interval=0,
     enable_cpu_cache_flush=False,
+    working_dir="",

Review comment:
       The correctness check is not implemented for LocalRunner.
   We should at least add an assertion here.

##########
File path: python/tvm/auto_scheduler/auto_schedule.py
##########
@@ -210,6 +253,35 @@ def auto_schedule(task, search_policy=None, 
tuning_options=TuningOptions()):
     if search_policy is None:
         cost_model = XGBModel()
         search_policy = SketchPolicy(task, cost_model)
+    
+    if tuning_options.check_correctness == True:
+        empty_sch, args = task.compute_dag.apply_steps_from_state(
+            task.compute_dag.get_init_state(), layout_rewrite=True)
+        cpu_func = build_module.build(
+                        empty_sch, args, target="llvm", 
target_host=task.target_host
+                    )
+        buffer_path = os.path.join(tuning_options.working_dir, "buffer.pkl")
+        if os.path.exists(buffer_path) is True:
+            with open(buffer_path, "rb") as fi:
+                buffer = pickle.load(fi)
+            if len(buffer) == len(args):
+                # we skip check each arg shape here
+                pass
+            elif len(buffer) == len(args) - 1:
+                # assume only one output

Review comment:
       ```suggestion
                   # assume only one output
                   # todo(antinucleon): get the output information from 
`task.compute_dag` to support multiple output
   ```




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


Reply via email to