code: def _test_bert_int8(
      relay_mod, params, input_info, target, sch_rules, postprocs
  ):
      relay_mod = relay.transform.FastMath()(relay_mod)
      tune_tasks = [
          task
          for task in ms.relay_integration.extract_tasks(
              relay_mod, target, params
          )
          if "dense" in task.task_name
          or "batch_matmul" in task.task_name
      ]
      with tempfile.TemporaryDirectory() as work_dir:
          (
              tasks,
              task_weights,
          ) = ms.relay_integration.extracted_tasks_to_tune_contexts(
              extracted_tasks=tune_tasks,
              work_dir=work_dir,
              space=ms.space_generator.PostOrderApply(
                  sch_rules=sch_rules,
                  postprocs=postprocs,
              ),
          )
          database = ms.tune.tune_tasks(
              tasks=tasks,
              task_weights=task_weights,
              work_dir=work_dir,
              max_trials_per_task=32,
              max_trials_global=20000,
          )
      with database, tvm.transform.PassContext(
          opt_level=3,
          config={"relay.backend.use_meta_schedule": True},
      ):
          lib = relay.build(relay_mod, target=target, params=params)
  
      dev = tvm.device("cuda" if "nvidia" in target else target, 0)
      runtime = tvm.contrib.graph_executor.GraphModule(
          lib["default"](dev)
      )
      inputs = []
      for name, shape in input_info:
          arr = np.random.uniform(1, 10, size=shape).astype("int64")
          runtime.set_input(name, arr)
          inputs.append(arr)
      print(runtime.benchmark(dev, number=1, repeat=50).mean)
  
imports: import tempfile
  import numpy
  import pytest
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import meta_schedule
  from tvm import relay
  from tvm.meta_schedule.testing import relay_workload
  from tvm.meta_schedule.testing.tlcbench import load_quantized_bert_base
  from tvm.tir.tensor_intrin.arm_cpu import DP4A_INTRIN
  from tvm.tir.tensor_intrin.rocm import AMDGPU_SDOT4_INTRIN
  from tvm.tir.tensor_intrin.x86 import VNNI_DOT_16x4_INTRIN
  from tvm.tir.tensor_intrin.x86 import AVX512_DOT_16x4_INTRIN
label_desc: Use image node_id 6 for calling a global function with example usage: _test_bert_int8(relay_mod, params, input_info, target, sch_rules, postprocs) without return types