class_docstr: GenerateSchedule is a class that handles the pipeline parallel inference.
  In our schedule, we place tie weight layer, embedding and lm_head in the same device to save space, so in
  this schedule, the out for each encoding progress is on rank0.
  
  Args:
      stage_manager (`PipelineStageManager`): Pipeline stage manager.
      mb_manager (`MicroBatchManager`): Micro batch manager.
      verbose (bool): Whether to verbose the information of the pipeline.
code: def __init__(
      self,
      stage_manager: PipelineStageManager,
      mb_manager: MicroBatchManager,
      verbose: bool,
  ) -> None:
      super().__init__(stage_manager)
      self.comm = PipelineP2PCommunication(stage_manager)
      self.mb_manager = mb_manager
      self.microbatch_size = mb_manager.micro_batch_size
      self.batch: Optional[Any] = None
      self.batch_size: Optional[int] = None
      self.microbatch_offset: Optional[int] = None
      self.num_microbatches: Optional[int] = None
      self.action_interval_buffer = ActionIntervalBuffer()
      self.verbose = verbose
      self.timestamps = None
      self.comm_dtype = None
  
imports: import time
  from functools import partial
  from typing import Any, Iterable, Optional, Union
  import torch
  import torch.cuda
  from torch.nn import Module
  from torch.utils._pytree import tree_map
  from colossalai.inference.engine.microbatch_manager import MicroBatchManager, Status
  from colossalai.pipeline.p2p import PipelineP2PCommunication
  from colossalai.pipeline.stage_manager import PipelineStageManager
  from colossalai.utils.device import get_current_device
  from ._utils import get_batch_size, get_micro_batch, model_forward, to_device
  from .base import PipelineSchedule
label_desc: Use image node_id 1 to create a new GenerateSchedule object from inherited base classes: PipelineSchedule with example: obj = GenerateSchedule(stage_manager, mb_manager, verbose)