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


##########
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:
   Apologies for not getting back to you on this! I was referring to testing 
this at the higher interface than `_build_func_common` which I think you're 
right would be here as that's the `tune` interface. In doing so the assert 
could remain in `_build_func_common` as the interface would eventually be 
fulfilled by the internal function raising an error, but I think you're right 
that it'd be much clearer if the check was next to the inputs to `tune`.
   
   Having said that, I would still strongly favour keeping the assertions 
inside of the `Target` API, as it seems as though we're defensively coding 
around our own internals here rather than actively wanting to clamp `tune` to 
only accepting these inputs? 



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