code: def format_num(num: int, bytes=False):
      """Scale bytes to its proper format, e.g. 1253656 => '1.20MB'"""
      factor = 1024 if bytes else 1000
      suffix = "B" if bytes else ""
      for unit in ["", " K", " M", " G", " T", " P"]:
          if num < factor:
              return f"{num:.2f}{unit}{suffix}"
          num /= factor
  
file_path: colossalai/examples/language/bert/benchmark_utils.py
imports: import inspect
  from logging import getLogger
  from time import time
  from typing import Callable
  import torch
  import yaml
  from torch.optim.lr_scheduler import _LRScheduler
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from colossalai.booster import Booster
  from colossalai.cluster import DistCoordinator
label_desc: Use image node_id 1 for calling a global function with example usage: format_num(num, bytes) and returns: num, unit, suffix