jcf94 commented on a change in pull request #7145:
URL: https://github.com/apache/tvm/pull/7145#discussion_r547038245
##########
File path: python/tvm/auto_scheduler/search_task.py
##########
@@ -221,10 +221,6 @@ def __init__(
target_host = Target(target_host)
self.dag = compute_dag
Review comment:
The search task also has a ComputeDAG member, can we just use
`self.compute_dag` after `__init_handle_by_constructor__`?
E... seem I have not fully understand the "reconstruct ComputeDAG" part.
##########
File path: python/tvm/auto_scheduler/search_task.py
##########
@@ -314,30 +310,26 @@ def __getstate__(self):
def __setstate__(self, state):
self.dag = state["dag"]
- self.workload_key = state["workload_key"]
# Register the workload if needed
try:
- workload = json.loads(self.workload_key)
+ workload = json.loads(state["workload_key"])
except Exception: # pylint: disable=broad-except
- raise RuntimeError("Invalid workload key %s" % self.workload_key)
+ raise RuntimeError("Invalid workload key %s" %
state["workload_key"])
# The workload from a compute DAG does not have arguments and is not
registered
# by default so we register it here. If the workload has already been
registered,
# the later registration overrides the prvious one.
if len(workload) == 1:
register_workload_tensors(workload[0], self.dag.tensors)
- self.target = state["target"]
- self.target_host = state["target_host"]
- self.hardware_params = state["hardware_params"]
self.__init_handle_by_constructor__(
_ffi_api.SearchTask,
self.dag,
Review comment:
The same to the comment above, can we just build a local variable `dag`
here, and it will be processed by the constructor to set it to
`self.compute_dag`?
----------------------------------------------------------------
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]