class_docstr: Main class for data parallel.
  
  This class supports GCQ (Gradient Communication Quantization) for
  distributed multi-machine training based on fairseq.trainer.Trainer.
code: def model(self):
      if self._wrapped_model is None:
          super().model
          if isinstance(
              self._wrapped_model, DistributedDataParallel
          ) and getattr(self.args, "enable_GCQ", False):
              assert version.parse(torch.__version__) >= version.parse(
                  "1.10"
              ), "Training with GCQ requires that the version of torch has to be greater than or equal to 1.10!"
              state = GCQState(
                  process_group=dist.group.WORLD
                  if dist.is_initialized()
                  else None,
                  hidden_size=self.args.encoder_embed_dim,
                  quantile_value=self.args.GCQ_quantile,
              )
              # Register the communication hook.
              self._wrapped_model.register_comm_hook(
                  state=state, hook=encode_and_decode
              )
              logger.info(
                  "############ register communication hook done ###########"
              )
      return self._wrapped_model
  
file_path: lightseq/lightseq/training/gcq/ls_fs_gcq_trainer.py
imports: import logging
  import torch
  import torch.distributed
  from torch.nn.parallel import DistributedDataParallel
  from fairseq.trainer import Trainer
  from packaging import version
  from .gcq import GCQState, encode_and_decode
label_desc: Use image node_id 2 for calling the LSTrainer obj's underlying member method code with example usage: obj.model() and returns: self