class_docstr: Some common benchmarks that help understand perf bottleneck of a standard dataloader
  made of dataset, mapper and sampler.
class_docstr_tok: ["Some","common","benchmarks","that","help","understand","perf","bottleneck","of","a","standard","dataloader","made","of","dataset",",","mapper","and","sampler","."]
code: def _log_time(self, msg, avg, all_times, distributed=False):
      percentiles = [
          np.percentile(all_times, k, interpolation="nearest")
          for k in [1, 5, 95, 99]
      ]
      if not distributed:
          logger.info(
              f"{msg}: avg={1.0/avg:.1f} it/s, "
              f"p1={percentiles[0]:.2g}s, p5={percentiles[1]:.2g}s, "
              f"p95={percentiles[2]:.2g}s, p99={percentiles[3]:.2g}s."
          )
          return
      avg_per_gpu = comm.all_gather(avg)
      percentiles_per_gpu = comm.all_gather(percentiles)
      if comm.get_rank() > 0:
          return
      for idx, avg, percentiles in zip(
          count(), avg_per_gpu, percentiles_per_gpu
      ):
          logger.info(
              f"GPU{idx} {msg}: avg={1.0/avg:.1f} it/s, "
              f"p1={percentiles[0]:.2g}s, p5={percentiles[1]:.2g}s, "
              f"p95={percentiles[2]:.2g}s, p99={percentiles[3]:.2g}s."
          )
  
imports: import logging
  import numpy
  from itertools import count
  from typing import List, Tuple
  import torch
  import tqdm
  from fvcore.common.timer import Timer
  from detectron2.utils import comm
  from .build import build_batch_data_loader
  from .common import DatasetFromList, MapDataset
  from .samplers import TrainingSampler
label_desc: Use image node_id 3 for calling the DataLoaderBenchmark obj's underlying member method code with example usage: obj._log_time(msg, avg, all_times, distributed) without return types