code: def main(cuda: int):
      # --- CONFIG
      device = torch.device(
          f"cuda:{cuda}"
          if cuda >= 0 and torch.cuda.is_available()
          else "cpu"
      )
      RNGManager.set_random_seeds(1234)
  
      benchmark_type = "cifar100"
  
      # --- BENCHMARK CREATION
      if benchmark_type == "mnist":
          benchmark = SplitMNIST(
              n_experiences=5,
              seed=42,
              class_ids_from_zero_from_first_exp=True,
          )
      elif benchmark_type == "core50":
          benchmark = CORe50()
          benchmark.n_classes = 50
      elif benchmark_type == "cifar100":
          cifar100_train_transform = Compose(
              [
                  ToTensor(),
                  Normalize(
                      (0.5071, 0.4865, 0.4409), (0.2673, 0.2564, 0.2762)
                  ),
              ]
          )
  
          cifar100_eval_transform = Compose(
              [
                  ToTensor(),
                  Normalize(
                      (0.5071, 0.4865, 0.4409), (0.2673, 0.2564, 0.2762)
                  ),
              ]
          )
          benchmark = SplitCIFAR100(
              5,
              seed=1234,
              shuffle=True,
              train_transform=cifar100_train_transform,
              eval_transform=cifar100_eval_transform,
          )
      elif benchmark_type == "tinyimagenet":
          benchmark = SplitTinyImageNet()
      else:
          raise RuntimeError("Unknown benchmark")
  
      # Note: when Numba uses TBB, then 20 is the limit number of workers
      # However, this limit does not apply when using OpenMP
      # (which may be faster...). If you want to test using OpenMP, then
      # run this script with the following command:
      # NUMBA_THREADING_LAYER=omp NUMBA_NUM_THREADS=32 python benchmark_ffcv.py
      for num_workers in [8, 16, 32]:
          print("num_workers =", num_workers)
          print("device =", device)
          benchmark_pytorch_speed(
              benchmark,
              device=device,
              num_workers=num_workers,
              epochs=4,
          )
          benchmark_ffcv_speed(
              benchmark,
              f"./ffcv_test_{benchmark_type}",
              device=device,
              num_workers=num_workers,
              epochs=4,
          )
  
file_path: avalanche/examples/ffcv/ffcv_try_speed.py
imports: import argparse
  import time
  from typing import Tuple
  import torch
  import torch.optim.lr_scheduler
  from avalanche.benchmarks import SplitMNIST
  from avalanche.benchmarks.classic.ccifar100 import SplitCIFAR100
  from avalanche.benchmarks.classic.core50 import CORe50
  from avalanche.benchmarks.classic.ctiny_imagenet import SplitTinyImageNet
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.benchmarks.utils.ffcv_support import HybridFfcvLoader, enable_ffcv
  from avalanche.training.determinism.rng_manager import RNGManager
  from ffcv.transforms import ToTensor
  from torchvision.transforms import Compose, ToTensor, Normalize
  from torch.utils.data import DataLoader
  from torch.utils.data.sampler import BatchSampler, SequentialSampler
  from tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: main(cuda) without return types