class_docstr: Builder for SD model Trainer with overrides.
class_docstr_tok: ["Builder","for","SD","model","Trainer","with","overrides","."]
docstr: Returns a ddp strategy passed to Trainer.strategy.
docstr_tok: ["Returns","a","ddp","strategy","passed","to","Trainer.strategy","."]
code: def _training_strategy(self) -> NLPDDPStrategy:
      """
      Returns a ddp strategy passed to Trainer.strategy.
      """
      ddp_overlap = self.cfg.model.get("ddp_overlap", True)
      if ddp_overlap:
          return NLPDDPStrategy(
              no_ddp_communication_hook=False,
              gradient_as_bucket_view=self.cfg.model.gradient_as_bucket_view,
              find_unused_parameters=True,
              bucket_cap_mb=256,
          )
      else:
          return NLPDDPStrategy(
              no_ddp_communication_hook=True,
              gradient_as_bucket_view=self.cfg.model.gradient_as_bucket_view,
              find_unused_parameters=False,
          )
  
file_path: NeMo/examples/multimodal/text_to_image/stable_diffusion/sd_train.py
imports: import os
  import torch
  from omegaconf.omegaconf import OmegaConf
  from nemo.collections.multimodal.models.text_to_image.stable_diffusion.ldm.ddpm import MegatronLatentDiffusion
  from nemo.collections.nlp.parts.megatron_trainer_builder import MegatronTrainerBuilder
  from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy
  from nemo.core.config import hydra_runner
  from nemo.utils import logging
  from nemo.utils.exp_manager import exp_manager
label_desc: Use image node_id 1 for calling the MegatronStableDiffusionTrainerBuilder obj's underlying member method code with example usage: obj._training_strategy() and returns: NLPDDPStrategy, NLPDDPStrategy