code: def run_performance_test(
      ops,
      inputs,
      run_backward=True,
      dtype="float32",
      ctx=mx.cpu(),
      profiler="native",
      warmup=10,
      runs=50,
  ):
      """Run operator benchmark for given operator or list of operators, ops, with the given inputs.
  
      Returns benchmark results as a list of dictionary where each dictionary represents benchmarks result per operator.
      key -> name of the operator and value -> map of results (forward time, backward time, time spent in memory
      operations.
  
      Parameters
      ----------
      ops: [Str]
          One or list of operators to benchmark. Should be an NDArray, Numpy or Numpy_extension operator.
      inputs: map
          Inputs for operator. Key should be name of parameter for operator.
          Example: inputs = {"lhs": (1024, 1024), "rhs": (1024, 1024)} for mx.nd.add or
                   inputs = {"x1": (1024, 1024), "x2": (1024, 1024)} for mx.np.add
      run_backward: Boolean, Default is True
          Should we have backward operator benchmarks.
      dtype: Str, default 'float32'
          Precision to use for input tensors. Defaults to float32. Example: 'float32', 'int64'
      ctx: mx.ctx, default mx.cpu()
          Context to use for benchmarks. Default to mx.cpu()
      profiler: Str, default 'native'
          Type of profiler to run benchmarks. Default to 'native'
          Option - ['python', 'native']
      warmup: int, default 10
          Number of warmup runs
      runs: int, default 50
          Number of runs for capturing benchmark results
  
      Returns
      -------
      List of dictionary of benchmark results. key -> name of the operator, Value is benchmark results.
  
      Note: when run_performance_test is called on the nd.Embedding operator with run_backward=True, an error will
      be thrown. Track issue here: https://github.com/apache/mxnet/issues/11314
      """
      if not isinstance(ops, list):
          ops = [ops]
  
      op_benchmark_result = []
      for op in ops:
          if (
              hasattr(mx.nd, op.__name__)
              or hasattr(mx.np, op.__name__)
              or hasattr(mx.npx, op.__name__)
          ):
              kwargs_list = _prepare_op_inputs(
                  inputs, run_backward, dtype, ctx, op.__module__
              )
              benchmark_result = _run_operator_performance_test(
                  op,
                  inputs,
                  run_backward,
                  warmup,
                  runs,
                  kwargs_list,
                  profiler,
              )
          else:
              raise ValueError(
                  f"Unknown {op.__module__} operator provided to benchmark. - {op.__name__}"
              )
          op_benchmark_result.append(benchmark_result)
      return op_benchmark_result
  
file_path: mxnet/benchmark/opperf/utils/benchmark_utils.py
imports: import logging
  import inspect
  import mxnet
  from mxnet import nd
  from mxnet import np
  from .ndarray_utils import get_mx_ndarray, nd_forward_and_profile, nd_forward_backward_and_profile
  from .common_utils import merge_map_list
  from .op_registry_utils import prepare_op_inputs
  from benchmark.opperf.rules.default_params import PARAMS_OF_TYPE_NDARRAY, PARAMS_OF_TYPE_NP_ARRAY
  from .profiler_utils import cpp_profile, python_profile
label_desc: Use image node_id 6 for calling a global function with example usage: run_performance_test(ops, inputs, run_backward, dtype, ctx, profiler, warmup, runs) and returns: op_benchmark_result