class_docstr: Main class for model parallel with data parallel training.
code: def __init__(
      self, cfg: FairseqConfig, task, model, criterion, **kwargs
  ):
      if not has_megatron_submodule:
          raise ImportError(
              "\n\nPlease install the megatron submodule:"
              "\n\n  git submodule update --init "
              "fairseq/model_parallel/megatron"
          )
      super().__init__(cfg, task, model, criterion, **kwargs)
  
file_path: fairseq/fairseq/model_parallel/megatron_trainer.py
imports: from fairseq.dataclass.configs import FairseqConfig
  from fairseq.distributed import utils
  from fairseq.trainer import Trainer
label_desc: Use image node_id 1 to create a new MegatronTrainer object from inherited base classes: Trainer with example: obj = MegatronTrainer(cfg, task, model, criterion)