@Dileep Sorry for the late response. I've tried auto tuning on iOS device 
before and needed some hacks to make it work.

- Pass a customized build function to LocalBuilder to compile your model with 
Xcode.
- Modify autotvm.measure.measure_methods.check_remote to make it return True 
always. It is necessary because, with the iOS RPC workflow, the devices are not 
visible from tuner before compiling.
- Run rpc_proxy on the host machine so that iOS device can connect to the 
tracker.
  ```
  python -m tvm.exec.rpc_proxy --host [HOST_IP] --tracker [TRACKER_IP]:9190
  ```

Here is a part of code.  Hope this would be helpful.
```python
autotvm.measure.measure_methods.check_remote = lambda *args: True

def fcompile(*args):
    from tvm.contrib import xcode
    xcode.create_dylib(*args, arch=arch, sdk=sdk)
    path = args[0]
    xcode.codesign(path)
    xcode.popen_test_rpc(proxy_host, proxy_port, key,
                     destination=destination,
                     libs=[path])

fcompile.output_format = "dylib"

tuning_option = {
    'log_filename': log_file,
    'tuner': 'random',
    'early_stopping': None,

    'measure_option': autotvm.measure_option(
        builder=autotvm.LocalBuilder(
            n_parallel=1,
            build_func=fcompile,
            timeout=60
        ),
        runner=autotvm.RPCRunner(
            key, host='127.0.0.1', port=9190,
            number=20, repeat=3, timeout=60, min_repeat_ms=150)
    ),
}
```





---
[Visit 
Topic](https://discuss.tvm.ai/t/auto-tvm-how-to-auto-tune-the-model-on-ios-device/7681/6)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/fcc11413dafb2d0d319b97b33bddb8a4a73b190ba3fbc5619ee3d59cd04a34c1).

Reply via email to