code: def main(argv: List[str]) -> None:
      args = parse_args(argv)
  
      if not args.cpu_only and torch.cuda.is_available():
          device = torch.device("cuda")
      else:
          device = torch.device("cpu")
  
      if args.mode == "ebc_comparison_dlrm":
          print("Running EBC vs. FusedEBC on DLRM EMB")
  
          for reduction_degree in [128, 64, 32]:
              embedding_bag_configs: List[EmbeddingBagConfig] = [
                  EmbeddingBagConfig(
                      name=f"ebc_{idx}",
                      embedding_dim=128,
                      num_embeddings=num_embeddings,
                      feature_names=[f"ebc_{idx}_feat_1"],
                  )
                  for idx, num_embeddings in enumerate(
                      get_shrunk_dlrm_num_embeddings(reduction_degree)
                  )
              ]
              (
                  ebc_time_avg,
                  ebc_time_std,
                  fused_ebc_time_avg,
                  fused_ebc_time_std,
                  speedup,
              ) = get_ebc_comparison(embedding_bag_configs, device)
  
              print(
                  f"when DLRM EMB is reduced by {reduction_degree} times:"
              )
              print(f"ebc_time = {ebc_time_avg} +/- {ebc_time_std} sec")
              print(
                  f"fused_ebc_time = {fused_ebc_time_avg} +/- {fused_ebc_time_std} sec"
              )
              print(f"speedup = {speedup}")
  
      elif args.mode == "fused_ebc_uvm":
          print("Running DLRM EMB on FusedEBC with UVM/UVM-caching")
          embedding_bag_configs: List[EmbeddingBagConfig] = [
              EmbeddingBagConfig(
                  name=f"ebc_{idx}",
                  embedding_dim=128,
                  num_embeddings=num_embeddings,
                  feature_names=[f"ebc_{idx}_feat_1"],
              )
              for idx, num_embeddings in enumerate(
                  get_shrunk_dlrm_num_embeddings(2)
              )
          ]
          (
              fused_ebc_time_avg,
              fused_ebc_time_std,
          ) = get_fused_ebc_uvm_time(
              embedding_bag_configs,
              device,
              EmbeddingLocation.MANAGED_CACHING,
          )
          print(
              f"FusedEBC with UVM caching on DLRM: {fused_ebc_time_avg} +/- {fused_ebc_time_std} sec"
          )
  
          embedding_bag_configs: List[EmbeddingBagConfig] = [
              EmbeddingBagConfig(
                  name=f"ebc_{idx}",
                  embedding_dim=128,
                  num_embeddings=num_embeddings,
                  feature_names=[f"ebc_{idx}_feat_1"],
              )
              for idx, num_embeddings in enumerate(
                  DLRM_NUM_EMBEDDINGS_PER_FEATURE
              )
          ]
          (
              fused_ebc_time_avg,
              fused_ebc_time_std,
          ) = get_fused_ebc_uvm_time(
              embedding_bag_configs, device, EmbeddingLocation.MANAGED
          )
          print(
              f"FusedEBC with UVM management on DLRM: {fused_ebc_time_avg} plus/minus {fused_ebc_time_std} sec"
          )
  
      elif args.mode == "ebc_comparison_scaling":
          print("Running EBC vs. FusedEBC scaling experiment")
  
          num_tables_list = [10, 100, 1000]
          embedding_dim_list = [4, 8, 16, 32, 64, 128]
          num_embeddings_list = [
              4,
              8,
              16,
              32,
              64,
              128,
              256,
              1024,
              2048,
              4096,
              8192,
          ]
  
          for num_tables in num_tables_list:
              for num_embeddings in num_embeddings_list:
                  for embedding_dim in embedding_dim_list:
                      embedding_bag_configs: List[
                          EmbeddingBagConfig
                      ] = [
                          EmbeddingBagConfig(
                              name=f"ebc_{idx}",
                              embedding_dim=embedding_dim,
                              num_embeddings=num_embeddings,
                              feature_names=[f"ebc_{idx}_feat_1"],
                          )
                          for idx in range(num_tables)
                      ]
                      (
                          ebc_time,
                          _,
                          fused_ebc_time,
                          _,
                          speedup,
                      ) = get_ebc_comparison(
                          embedding_bag_configs, device, epochs=3
                      )
                      print(
                          f"EBC num_tables = {num_tables}, num_embeddings = {num_embeddings}, embedding_dim = {embedding_dim}:"
                      )
                      print(
                          f"ebc_time = {ebc_time} sec, fused_ebc_time = {fused_ebc_time} sec, speedup = {speedup}"
                      )
  
file_path: torchrec/benchmarks/ebc_benchmarks.py
imports: import argparse
  import sys
  from typing import List, Tuple
  import torch
  from fbgemm_gpu.split_table_batched_embeddings_ops_training import EmbeddingLocation
  from torchrec.github.benchmarks import ebc_benchmarks_utils
  from torchrec.modules.embedding_configs import EmbeddingBagConfig
  from torchrec.modules.embedding_modules import EmbeddingBagCollection
  from torchrec.modules.fused_embedding_modules import FusedEmbeddingBagCollection
label_desc: Use image node_id 2 for calling a global function with example usage: main(argv) without return types