areusch commented on code in PR #10963:
URL: https://github.com/apache/tvm/pull/10963#discussion_r853245930


##########
python/tvm/autotvm/measure/measure_methods.py:
##########
@@ -496,7 +496,7 @@ def set_task(self, task):
 def _build_func_common(measure_input, runtime=None, check_gpu=None, 
build_option=None):
     """Common part for building a configuration"""
     target, task, config = measure_input
-    target, task.target_host = Target.check_and_update_host_consist(target, 
task.target_host)
+    target, _ = Target.check_and_update_host_consist(target, task.target_host)

Review Comment:
   @mbs-octoml is working to overhaul this function to work with VirtualDevice, 
so I think it may not be worth spending cycles on that right now. I agree with 
you otherwise @Mousius, though here my request comes more from  that it's 
really tricky to mentally model what may happen in all the various scenarios 
with that function.



##########
python/tvm/autotvm/measure/measure_methods.py:
##########
@@ -496,7 +497,8 @@ def set_task(self, task):
 def _build_func_common(measure_input, runtime=None, check_gpu=None, 
build_option=None):
     """Common part for building a configuration"""
     target, task, config = measure_input
-    target, task.target_host = Target.check_and_update_host_consist(target, 
task.target_host)
+    assert not isinstance(target, (Map, dict)), "It's expected that 'target' 
is a string here."

Review Comment:
   i agree this assert is probably internal since target comes from Task, but 
there is probably another place we could add an assert closer to `Tuner.tune` 
which would be worth adding a test for. also, since the assert is expecting 
precisely one thing, can you flip the logic around (`assert isinstance(target, 
str)`) so that it's not dependent on the range of values passed to 
`check_and_update_host_consist`? anyway @mbs-octoml is working on making 
`check_and_update_host_consist` much less ambiguous.



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