You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/11/18 03:12:14 UTC

[GitHub] [incubator-tvm] merrymercy commented on a change in pull request #6927: [AutoScheduler] Register workload when deserializing tasks

merrymercy commented on a change in pull request #6927:
URL: https://github.com/apache/incubator-tvm/pull/6927#discussion_r525709883



##########
File path: python/tvm/auto_scheduler/search_task.py
##########
@@ -63,6 +66,11 @@ def __getstate__(self):
     def __setstate__(self, state):
         self.dag = state["dag"]
         self.workload_key = state["workload_key"]
+        try:
+            func_name = json.loads(self.workload_key)[0]
+        except Exception:  # pylint: disable=broad-except
+            raise RuntimeError("Invalid workload key %s" % self.workload_key)
+        register_workload_tensors(func_name, self.dag.tensors)

Review comment:
       We should do more checks here.
   There are two kinds of workloads.
   You can find the note here 
   https://github.com/apache/incubator-tvm/blob/51d81fb71781eb606f4b563ec28290dbd8d04faf/python/tvm/auto_scheduler/workload_registry.py#L42-L50
   
   We have to handle two cases correctly without incorrect overwriting
   
   
   




----------------------------------------------------------------
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:
users@infra.apache.org