class_docstr: A training engine hybrid pipeline, data, and model parallel training.
  
  This engine is created by ``deepspeed.initialize()`` when a :class:`PipelineModule`
  is provided.
code: def mem_status(self, msg, print_rank=-1, reset_max=False):
      return
      global mem_alloced, mem_cached
      if not self.global_steps == 0 or not self.global_steps == 9:
          # return
          pass
      if self.mpu.get_data_parallel_rank() != 0:
          return
  
      if self.global_rank != 0:
          return
  
      rank = self.global_rank
      if print_rank != -1 and rank != print_rank:
          return
  
      torch.cuda.synchronize()
  
      if reset_max:
          torch.cuda.reset_max_memory_cached()
          torch.cuda.reset_max_memory_allocated()
  
      new_alloced = torch.cuda.memory_allocated()
      new_cached = torch.cuda.memory_cached()
  
      delta_alloced = new_alloced - mem_alloced
      delta_cached = new_cached - mem_cached
  
      mem_cached = new_cached
      mem_alloced = new_alloced
  
      max_alloced = torch.cuda.max_memory_allocated()
      max_cached = torch.cuda.max_memory_cached()
  
      # convert to GB for printing
      new_alloced /= 1024**3
      new_cached /= 1024**3
      delta_alloced /= 1024**3
      delta_cached /= 1024**3
      max_alloced /= 1024**3
      max_cached /= 1024**3
  
      print(
          f"RANK={rank} STAGE={self.stage_id} STEP={self.global_steps} MEMSTATS",
          msg,
          f"current alloc={new_alloced:0.4f}GB (delta={delta_alloced:0.4f}GB max={max_alloced:0.4f}GB) "
          f"current cache={new_cached:0.4f}GB (delta={delta_cached:0.4f}GB max={max_cached:0.4f}GB)",
      )
  
imports: from types import MethodType
  import torch
  from deepspeed import comm
  from deepspeed.utils import logger
  from deepspeed.utils.timer import ThroughputTimer
  from ..engine import DeepSpeedEngine, MEMORY_OPT_ALLREDUCE_SIZE
  from ..utils import PartitionedTensor
  from ..dataloader import RepeatingLoader
  from .module import PipelineModule, PipelineError
  from .None import p2p
  from .None import schedule
label_desc: Use image node_id 41 for calling the PipelineEngine obj's underlying member method code with example usage: obj.mem_status(msg, print_rank, reset_max) without return types