class_docstr: PipelineHelper assists with implementing pipelining in model parallelism.
  
  For a tutorial on model parallelism, as it's implemented in parts of ParlAI,
  see https://pytorch.org/tutorials/intermediate/model_parallel_tutorial.html.
  
  Usage:
  >>> my_model = PipelineHelper().make_parallel(my_model)
  
  Note that you will need to manually implement logic which handles the
  moved layers.
class_docstr_tok: ["PipelineHelper","assists","with","implementing","pipelining","in","model","parallelism",".","For","a","tutorial","on","model","parallelism",",","as","it","'s","implemented","in","parts","of","ParlAI",",","see","https",":","\/\/pytorch.org\/tutorials\/intermediate\/model_parallel_tutorial.html",".","Usage",":",">",">",">","my_model","=","PipelineHelper","(",")",".make_parallel","(","my_model",")","Note","that","you","will","need","to","manually","implement","logic","which","handles","the","moved","layers","."]
docstr: Check compatibility for opts.
  
  Really just used to raise an error message if the user mixes multiprocessing and
  model parallelism.
docstr_tok: ["Check","compatibility","for","opts",".","Really","just","used","to","raise","an","error","message","if","the","user","mixes","multiprocessing","and","model","parallelism","."]
code: def check_compatibility(self, opt):
      """
      Check compatibility for opts.
  
      Really just used to raise an error message if the user mixes multiprocessing and
      model parallelism.
      """
      if opt.get("multiprocessing") and not os.environ.get(
          "PARLAI_FORCE_MP"
      ):
          raise RuntimeError(
              "It looks like you are trying to mix multiprocessing data "
              "parallelism (multiprocessing_train or multiprocessing_eval) "
              "with --model-parallel true. This is almost certainly a user "
              "error, and is going to result in hanging as the two methods "
              "fight for resources. Use simple `train_model` instead of "
              "`mp_train`, or add `--model-parallel false`. For more info, "
              "see https://github.com/facebookresearch/ParlAI/issues/2962."
          )
  
imports: import os
  from typing import Union, Optional, Tuple, Any, List, Sized, TypeVar
  import itertools
  from collections import namedtuple
  import parlai.utils.logging
  import parlai.utils.io
  import torch.optim
label_desc: Use image node_id 2 for calling the PipelineHelper obj's underlying member method code with example usage: obj.check_compatibility(opt) without return types