Using simulator in auto-tuning VTA

Hi there,

I’m trying to auto-tune a convnet on VTA without using a FPGA board. Could anyone provide some hints on how I should go about modifying the measure_option to use a simulator in this tutorial https://tvm.apache.org/docs/vta/tutorials/autotvm/tune_relay_vta.html? Should I use a local_runner instead?

"measure_option": autotvm.measure_option(
    builder=autotvm.LocalBuilder(),
    runner=autotvm.RPCRunner(
        env.TARGET,
        host=tracker_host,
        port=tracker_port,
        number=5,
        timeout=60,
        check_correctness=True,
    ),
),

Any help is appreciated.

1 Like

@tqchen Sorry if I should’ve pinged someone else, but any pointer will be appreciated.

You can try to setup an rpc server with a simulator. The main thing is to make sure that the vta fsim runtime is used

@tqchen Thanks for the reply. As I’m setting up the rpc with a local simulator, I’m using the following steps but could not find any under the server list. Do you happen to know where I did wrong?

(All the commands below are run on my local desktop as there isn’t really a remote device)

python -m tvm.exec.rpc_tracker --host=0.0.0.0 --port=9190 &
python -m tvm.exec.rpc_server --tracker=0.0.0.0:9190 --key=sim &
python -m tvm.exec.query_rpc_tracker --host=0.0.0.0 --port=9190

@tqchen @lianminzheng think I sorted out the rpc stuff, and the “sim” device shows up below as expected.

Tracker address 0.0.0.0:9190

Server List
----------------------------
server-address	key
----------------------------
127.0.0.1:44072	server:sim
----------------------------

Queue Status
---------------------------
key   total  free  pending
---------------------------
sim   1      1     0      
---------------------------

When I run the tuning on VTA/sim, I still got the error below.

Traceback (most recent call last):
  File "tune_relay_vta.py", line 267, in <module>
    tune_and_evaluate(tuning_option)
  File "tune_relay_vta.py", line 223, in tune_and_evaluate
    tune_tasks(tasks, **tuning_opt)
  File "tune_relay_vta.py", line 120, in tune_tasks
    autotvm.callback.log_to_file(tmp_log_file),
  File "/home/alecshi/working/tvm/python/tvm/autotvm/tuner/tuner.py", line 112, in tune
    measure_batch = create_measure_batch(self.task, measure_option)
  File "/home/alecshi/working/tvm/python/tvm/autotvm/measure/measure.py", line 257, in create_measure_batch
    attach_objects = runner.set_task(task)
  File "/home/alecshi/working/tvm/python/tvm/autotvm/measure/measure_methods.py", line 253, in set_task
    "Cannot get remote devices from the tracker. "
RuntimeError: Cannot get remote devices from the tracker. Please check the status of tracker by 'python -m tvm.exec.query_rpc_tracker --port [THE PORT YOU USE]' and make sure you have free devices on the queue status.

Is it because the current RPC fundamental does not support fsim with ext_dev -keys=vta,cpu -device=vta -model=sim_1x16_i8w8a32_15_15_18_17

1 Like

@aleczhanshi Hi brother, did you solve the problem?
I also try to use simulator in auto-tuning VTA, but I don’t know how to modify the code in tune_relay_vta.py.
It seems that auto-tuning VTA can work in simulation mode without a FPGA board, but how to do it actually?
Any help will be appreciated.

@tqchen Execuse me,
I’ve already got the vta fsim runtime libvta_fsim.so, and could you give more detail about how to setup an RPC server with a simulator?

I solved the problem, here: