Tantalus13A98B5F commented on a change in pull request #8113:
URL: https://github.com/apache/tvm/pull/8113#discussion_r638399365



##########
File path: python/tvm/autotvm/measure/measure_methods.py
##########
@@ -575,18 +596,22 @@ def run_through_rpc(
                 f_preproc=f_prepare,
             )
 
-            try:
-                random_fill = 
remote.get_function("tvm.contrib.random.random_fill")
-            except AttributeError:
-                raise AttributeError(
-                    "Please make sure USE_RANDOM is ON in the config.cmake " 
"on the remote devices"
-                )
-            args = [nd.empty(x[0], x[1], dev) for x in build_result.arg_info]
-            if "scatter" not in measure_input.task.name:
-                # the index tensor of scatter op cannot be randomly initialized
-                for arg in args:
-                    random_fill(arg)
-            dev.sync()
+            if ref_input:
+                args = [nd.array(x, device=dev) for x in ref_input]
+            else:
+                try:
+                    random_fill = 
remote.get_function("tvm.contrib.random.random_fill")
+                except AttributeError:
+                    raise AttributeError(
+                        "Please make sure USE_RANDOM is ON in the config.cmake 
"
+                        "on the remote devices"
+                    )
+                args = [nd.empty(x[0], x[1], dev) for x in 
build_result.arg_info]
+                if "scatter" not in measure_input.task.name:
+                    # the index tensor of scatter op cannot be randomly 
initialized
+                    for arg in args:
+                        random_fill(arg)
+                dev.sync()

Review comment:
       I guess you mean if `dev.sync` is in its right position w.r.t. the 
`scatter` branch. In fact it seems not for me, but I'm not sure; just inherited 
this piece of code from the previous commit. Confirmation needed.




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