class_docstr: Megatron Bert pretraining.
  Model returns [batch, seq, hidden] shape
class_docstr_tok: ["Megatron","Bert","pretraining",".","Model","returns","[","batch",",","seq",",","hidden","]","shape"]
code: def build_LDDL_data(self, cfg):
      if not HAVE_LDDL:
          raise ImportError(
              "LDDL was not found. Please see the LDDL README for installation instructions: https://github.com/NVIDIA/LDDL#installation."
          )
      logging.info(f"Starting building LDDL Dataloaders")
      self._train_ds = None
      self._validation_ds = None
      self._test_ds = None
      data_parallel_size = parallel_state.get_data_parallel_world_size()
      num_micro_batches = self.cfg.global_batch_size // (
          self.cfg.micro_batch_size * data_parallel_size
      )
      global_batch_size_on_this_data_parallel_rank = (
          num_micro_batches * self.cfg.micro_batch_size
      )
      samples_consumed_dploader = (
          self.compute_consumed_samples(0) // data_parallel_size
      )
      # We run under the assumption that the datapath is the prefix if LDDL dataloader
      train_lddl_data_path = self.cfg.data.data_prefix[0]
      self._train_dl = get_bert_pretrain_data_loader(
          train_lddl_data_path,
          dp_rank=parallel_state.get_data_parallel_rank(),
          local_rank=self.local_rank,
          shuffle_buffer_size=16384,
          shuffle_buffer_warmup_factor=16,
          vocab_file=self.cfg.tokenizer.vocab_file,
          data_loader_kwargs={
              "batch_size": global_batch_size_on_this_data_parallel_rank,
              "num_workers": self.cfg.data.num_workers,
              "prefetch_factor": 2,
          },
          mlm_probability=0.15,
          base_seed=self.cfg.seed,
          log_level=logging.CRITICAL,
          log_dir="/tmp/log",
          return_raw_samples=False,
          start_epoch=0,
          sequence_length_alignment=8,
          ignore_index=-1,
          samples_seen=samples_consumed_dploader,
          micro_batch_size=self.cfg.micro_batch_size,
      )
      logging.info(f"Completed build train LDDL Dataloader")
      if len(self.cfg.data.data_prefix) > 1:
          val_lddl_data_path = self.cfg.data.data_prefix[1]
          self._validation_dl = get_bert_pretrain_data_loader(
              val_lddl_data_path,
              dp_rank=parallel_state.get_data_parallel_rank(),
              local_rank=self.local_rank,
              shuffle_buffer_size=16384,
              shuffle_buffer_warmup_factor=16,
              vocab_file=self.cfg.tokenizer.vocab_file,
              data_loader_kwargs={
                  "batch_size": global_batch_size_on_this_data_parallel_rank,
                  "num_workers": self.cfg.data.num_workers,
                  "prefetch_factor": 2,
              },
              mlm_probability=0.15,
              base_seed=self.cfg.seed,
              log_level=logging.CRITICAL,
              log_dir="/tmp/log",
              return_raw_samples=False,
              start_epoch=0,
              sequence_length_alignment=8,
              ignore_index=-1,
              micro_batch_size=self.cfg.micro_batch_size,
          )
      if len(self.cfg.data.data_prefix) > 2:
          test_lddl_data_path = self.cfg.data.data_prefix[2]
          self._test_dl = get_bert_pretrain_data_loader(
              test_lddl_data_path,
              dp_rank=parallel_state.get_data_parallel_rank(),
              local_rank=self.local_rank,
              shuffle_buffer_size=16384,
              shuffle_buffer_warmup_factor=16,
              vocab_file=self.cfg.tokenizer.vocab_file,
              data_loader_kwargs={
                  "batch_size": global_batch_size_on_this_data_parallel_rank,
                  "num_workers": self.cfg.data.num_workers,
                  "prefetch_factor": 2,
              },
              mlm_probability=0.15,
              base_seed=self.cfg.seed,
              log_level=logging.CRITICAL,
              log_dir="/tmp/log",
              return_raw_samples=False,
              start_epoch=0,
              sequence_length_alignment=8,
              ignore_index=-1,
              micro_batch_size=self.cfg.micro_batch_size,
          )
      logging.info(f"Finished building LDDL Dataloaders")
  
imports: import itertools
  from typing import Any, Dict, List, Optional
  import torch
  import torch.nn.functional
  from omegaconf.dictconfig import DictConfig
  from pytorch_lightning.trainer.trainer import Trainer
  from nemo.collections.nlp.data.language_modeling.megatron import dataset_utils
  from nemo.collections.nlp.data.language_modeling.megatron.data_samplers import MegatronPretrainingRandomSampler, MegatronPretrainingSampler
  from nemo.collections.nlp.models.language_modeling.megatron.bert_model import BertModel
  from nemo.collections.nlp.models.language_modeling.megatron_base_model import MegatronBaseModel
  from nemo.collections.nlp.modules.common.megatron.build_model import build_model
  from nemo.collections.nlp.modules.common.megatron.module import Float16Module
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, average_losses_across_data_parallel_group, get_params_for_weight_decay_optimization
  from nemo.collections.nlp.parts.nlp_overrides import GradScaler
  from nemo.collections.nlp.parts.utils_funcs import get_last_rank
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.core.neural_types import ChannelType, MaskType, NeuralType
  from nemo.utils import AppState, logging
label_desc: Use image node_id 13 for calling the MegatronBertModel obj's underlying member method code with example usage: obj.build_LDDL_data(cfg) without return types