code: def run_benchmark(
      tables: List[EmbeddingBagConfig],
      quant_device: torch.device,
      device: torch.device,
      sharding_type: ShardingType,
      world_size: int,
      batch_size: int,
      terminal_stage: TerminalStage,
      warmup_inputs: List[KeyedJaggedTensor],
      bench_inputs: List[KeyedJaggedTensor],
      prof_inputs: List[KeyedJaggedTensor],
      output_dir: str,
      num_benchmarks: int,
  ) -> BenchmarkResult:
      module = _model_ebc(
          terminal_stage=terminal_stage,
          tables=tables,
          quant_device=quant_device,
          device=device,
          quant_state_dict_split_scale_bias=True,
          sharding_type=sharding_type,
          world_size=world_size,
          batch_size=batch_size,
          inputs=bench_inputs,
      )
  
      name = benchmark_type_name(terminal_stage, sharding_type)
  
      return benchmark(
          name,
          module,
          warmup_inputs,
          bench_inputs,
          prof_inputs,
          batch_size,
          world_size=world_size,
          output_dir=output_dir,
          num_benchmarks=num_benchmarks,
      )
  
imports: import argparse
  import gc
  import logging
  import os
  import time
  from dataclasses import dataclass
  from enum import Enum
  from typing import Dict, List, Tuple
  import torch
  from torch.autograd.profiler import record_function
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel, ShardingType
  from torchrec.distributed.planner import EmbeddingShardingPlanner, Topology
  from torchrec.distributed.planner.enumerators import EmbeddingEnumerator
  from torchrec.distributed.planner.shard_estimators import EmbeddingPerfEstimator, EmbeddingStorageEstimator
  from torchrec.distributed.shard import _shard_modules
  from torchrec.distributed.test_utils.infer_utils import TestQuantEBCSharder
  from torchrec.distributed.test_utils.test_model import ModelInput
  from torchrec.distributed.types import DataType, ShardingEnv
  from torchrec.fx import symbolic_trace
  from torchrec.modules.embedding_configs import EmbeddingBagConfig
  from torchrec.quant.embedding_modules import EmbeddingBagCollection
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor, KeyedTensor
label_desc: Use image node_id 5 for calling a global function with example usage: run_benchmark(tables, quant_device, device, sharding_type, world_size, batch_size, terminal_stage, warmup_inputs, bench_inputs, prof_inputs, output_dir, num_benchmarks) and returns: benchmark