class_docstr: BaseOffloadModule: A model wrapper for parameter offloading.
  
  Args:
      model (nn.Module): model to apply offloading.
      region_manager (RegionManager): a ``RegionManager`` instance.
      is_sync (bool): synchronous mode or not.
class_docstr_tok: ["BaseOffloadModule",":","A","model","wrapper","for","parameter","offloading",".","Args",":","model","(","nn.Module",")",":","model","to","apply","offloading",".","region_manager","(","RegionManager",")",":","a","``","RegionManager","``","instance",".","is_sync","(","bool",")",":","synchronous","mode","or","not","."]
code: def __init__(
      self,
      model: nn.Module,
      region_manager: RegionManager,
      is_sync=True,
  ):
      self.model = model
      self.region_manager = region_manager
      self.grad_hook_list = []
      self.overflow_counter = torch.cuda.IntTensor([0])
  
      self.grad_offload_stream = (
          torch.cuda.current_stream()
          if is_sync
          else GlobalRuntimeInfo.d2h_stream
      )
  
      self._cast_buffers()
  
imports: from functools import partial
  from typing import Optional, Set
  import torch
  import torch.nn
  from colossalai.utils import _cast_float
  from colossalai.zero.legacy.gemini.tensor_utils import free_storage
  from .region_manager import RegionManager
  from .util import GlobalRuntimeInfo
label_desc: Use image node_id 1 to create a new BaseOffloadModule object  with example: obj = BaseOffloadModule(model, region_manager, is_sync)