class_docstr: Monitor the speed of each step and each epoch.
      
code: def __init__(
      self,
      intra_step_time: bool = True,
      inter_step_time: bool = True,
      epoch_time: bool = True,
      verbose=False,
  ):
      super().__init__()
      self._log_stats = AttributeDict(
          {
              "intra_step_time": intra_step_time,
              "inter_step_time": inter_step_time,
              "epoch_time": epoch_time,
          }
      )
      self.verbose = verbose
  
file_path: flash-attention/training/src/callbacks/speed_monitor.py
imports: import time
  from typing import Any
  from pytorch_lightning import Callback, Trainer
  from pytorch_lightning.utilities import rank_zero_only
  from pytorch_lightning.utilities.parsing import AttributeDict
  from pytorch_lightning.utilities.types import STEP_OUTPUT
label_desc: Use image node_id 1 to create a new SpeedMonitor object from inherited base classes: Callback with example: obj = SpeedMonitor(intra_step_time, inter_step_time, epoch_time, verbose)