class_docstr: A synchronized cuda memory monitor.
  It only record the maximum allocated cuda memory from start point to finish point.
class_docstr_tok: ["A","synchronized","cuda","memory","monitor",".","It","only","record","the","maximum","allocated","cuda","memory","from","start","point","to","finish","point","."]
docstr: return max gpu memory used since latest `start()`.
  
  Returns:
      int: max GPU memory
docstr_tok: ["return","max","gpu","memory","used","since","latest","`","start","(",")","`",".","Returns",":","int",":","max","GPU","memory"]
code: def finish(self) -> int:
      """
      return max gpu memory used since latest `start()`.
  
      Returns:
          int: max GPU memory
      """
      torch.cuda.synchronize()
      self.time_stamps.append(time())
      max_usage = torch.cuda.max_memory_allocated()
      self.mem_stats.append(max_usage)
      return max_usage
  
imports: import json
  from abc import abstractmethod
  from concurrent.futures import ThreadPoolExecutor
  from time import sleep, time
  import torch
  from colossalai.utils import get_current_device
label_desc: Use image node_id 3 for calling the SyncCudaMemoryMonitor obj's underlying member method code with example usage: obj.finish() and returns: max_usage