merrymercy commented on a change in pull request #5200: Fix intel conv2d auto 
tune
URL: https://github.com/apache/incubator-tvm/pull/5200#discussion_r401955632
 
 

 ##########
 File path: python/tvm/autotvm/measure/measure_methods.py
 ##########
 @@ -479,9 +479,10 @@ def run_through_rpc(measure_input, build_result,
         if ref_input:
             args = [nd.array(x, ctx=ctx) for x in ref_input]
         else:
-            # create empty arrays on the remote device and copy them once.
+            # create random arrays on the remote device and copy them once.
             # This can avoid some memory issues that make the measurement 
results unreliable.
-            args = [nd.empty(x[0], dtype=x[1], ctx=ctx) for x in 
build_result.arg_info]
+            args = [nd.array(np.random.uniform(0.0, 255.0, 
size=x[0]).astype(dtype=x[1]), ctx=ctx)
 
 Review comment:
   This will introduce a data copy when using RPCRunner, which will bring too 
much overhead.
   One way to solve this is by implementing a `tvm.nd.non_empty` or 
`tvm.nd.random` in the tvm runtime, then we can do the random fill on the 
target device without copying over the network.
   
   @FrozenGene has implemented a version in our internal codebase. Maybe 
@FrozenGene can help on this?

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


With regards,
Apache Git Services

Reply via email to