code: def main():
      describe()
      print(f"Workload: {ARGS.model_name}")
  
      onnx_model = onnx.load(ARGS.onnx_path)
      shape_dict = {}
      for item in ARGS.input_shape:
          print(f"  input_name : {item['name']}")
          print(f"  input_shape: {item['shape']}")
          print(f"  input_dtype: {item['dtype']}")
          shape_dict[item["name"]] = item["shape"]
      mod, params = from_onnx(
          onnx_model, shape_dict, freeze_params=True
      )
      input_data = {
          item["name"]: generate_input_data(
              item["shape"], item["dtype"]
          )
          for item in ARGS.input_shape
      }
  
      with ms.Profiler() as profiler:
          database = ms.relay_integration.tune_relay(
              mod=mod,
              target=ARGS.target,
              params=params,
              work_dir=ARGS.work_dir,
              max_trials_global=ARGS.num_trials,
              num_trials_per_iter=64,
              runner=ms.runner.RPCRunner(  # type: ignore
                  rpc_config=ARGS.rpc_config,
                  evaluator_config=ms.runner.EvaluatorConfig(
                      number=ARGS.number,
                      repeat=ARGS.repeat,
                      min_repeat_ms=ARGS.min_repeat_ms,
                      enable_cpu_cache_flush=ARGS.cpu_flush,
                  ),
                  alloc_repeat=1,
              ),
              cost_model=ms.cost_model.XGBModel(  # type: ignore
                  extractor=ms.feature_extractor.PerStoreFeature(),
                  adaptive_training=ARGS.adaptive_training,
              ),
              strategy=ms.search_strategy.EvolutionarySearch(),
          )
          lib = ms.relay_integration.compile_relay(
              database=database,
              mod=mod,
              target=ARGS.target,
              params=params,
              backend=ARGS.backend,
          )
  
      print("Tuning Time:")
      print(profiler.table())
  
      run_module_via_rpc(
          rpc_config=ARGS.rpc_config,
          lib=lib,
          dev_type=ARGS.target.kind.name,
          args=input_data,
          continuation=create_timer(ARGS.backend),
          backend=ARGS.backend,
      )
  
file_path: tvm/python/tvm/meta_schedule/testing/tune_onnx.py
imports: import argparse
  import json
  import logging
  from distutils.util import strtobool
  import onnx
  import tvm
  from tvm import meta_schedule
  from tvm.meta_schedule.testing.custom_builder_runner import run_module_via_rpc
  from tvm.relay.frontend import from_onnx
  from tvm.support import describe
  from .tune_utils import create_timer, generate_input_data
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types