class_docstr: The async pipeline parallelism for Pipe.
class_docstr_tok: ["The","async","pipeline","parallelism","for","Pipe","."]
code: def __init__(
      self,
      partitions: List[ModuleWrapper],
      skip_layout: SkipLayout,
      checkpoint_stop: int,
      group: torch.distributed.ProcessGroup,
      *,
      worker_map: Optional[Dict[int, str]] = None,
      input_device: Union[None, int, str, torch.device] = None,
      final_stage: bool = False,
  ) -> None:
      self.partitions = partitions
      self.skip_layout = skip_layout
      self.__checkpoint_stop = checkpoint_stop
      self.group = group
      self.training: bool
      self.transport = MakeTransport(
          use_rpc=("OMPI_COMM_WORLD_RANK" not in os.environ)
          or ("FORCE_RPC" in os.environ),
          worker_map=worker_map,
          input_device=input_device,
      )
      self.input_device = input_device
      self.final_stage = final_stage
  
file_path: fairscale/fairscale/nn/pipe/async_pipeline.py
imports: import logging
  import os
  from threading import Event
  from typing import Dict, List, Optional, Union
  import torch
  from .async_schedule import AsyncEventLoop, ModuleWrapper
  from .messages import MakeTransport
  from .microbatch import Batch
  from .skip.layout import SkipLayout
  from .skip.tracker import SkipTrackerThroughPotals
label_desc: Use image node_id 1 to create a new AsyncPipeline object  with example: obj = AsyncPipeline(partitions, skip_layout, checkpoint_stop, group)