class_docstr: An Async Memory Monitor running during computing. Sampling memory usage of the current GPU
  at interval of `1/(10**power)` sec.
  
  The idea comes from Runtime Memory Tracer of PatrickStar
  `PatrickStar: Parallel Training of Pre-trained Models via Chunk-based Memory Management`_
  
  Usage::
  
      async_mem_monitor = AsyncMemoryMonitor()
      input = torch.randn(2, 20).cuda()
      OP1 = torch.nn.Linear(20, 30).cuda()
      OP2 = torch.nn.Linear(30, 40).cuda()
  
      async_mem_monitor.start()
      output = OP1(input)
      async_mem_monitor.finish()
      async_mem_monitor.start()
      output = OP2(output)
      async_mem_monitor.finish()
      async_mem_monitor.save('log.pkl')
  
  Args:
      power (int, optional): the power of time interval. Defaults to 10.
  
  .. _PatrickStar: Parallel Training of Pre-trained Models via Chunk-based Memory Management:
      https://arxiv.org/abs/2108.05818
class_docstr_tok: ["An","Async","Memory","Monitor","running","during","computing",".","Sampling","memory","usage","of","the","current","GPU","at","interval","of","`","1\/","(","10","*","*","power",")","`","sec",".","The","idea","comes","from","Runtime","Memory","Tracer","of","PatrickStar","`","PatrickStar",":","Parallel","Training","of","Pre-trained","Models","via","Chunk-based","Memory","Management","`","_","Usage",":",":","async_mem_monitor","=","AsyncMemoryMonitor","(",")","input","=","torch.randn","(","2",",","20",")",".cuda","(",")","OP1","=","torch.nn.Linear","(","20",",","30",")",".cuda","(",")","OP2","=","torch.nn.Linear","(","30",",","40",")",".cuda","(",")","async_mem_monitor.start","(",")","output","=","OP1","(","input",")","async_mem_monitor.finish","(",")","async_mem_monitor.start","(",")","output","=","OP2","(","output",")","async_mem_monitor.finish","(",")","async_mem_monitor.save","(","'log.pkl","'",")","Args",":","power","(","int",",","optional",")",":","the","power","of","time","interval",".","Defaults","to","10",".","..","_PatrickStar",":","Parallel","Training","of","Pre-trained","Models","via","Chunk-based","Memory","Management",":","https",":","\/\/arxiv.org\/abs\/2108.05818"]
code: def finish(self):
      if self.keep_measuring is False:
          return 0
  
      self.keep_measuring = False
      max_usage = self.monitor_thread.result()
  
      self.monitor_thread = None
      self.time_stamps.append(time())
      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 5 for calling the AsyncMemoryMonitor obj's underlying member method code with example usage: obj.finish() and returns: max_usage, int