class_docstr: Test the Regnet FSDP model in comparison with the DDP Regnet
  to verify that both converge to the same losses
class_docstr_tok: ["Test","the","Regnet","FSDP","model","in","comparison","with","the","DDP","Regnet","to","verify","that","both","converge","to","the","same","losses"]
code: def _create_pretraining_config(
      with_fsdp: bool,
      with_activation_checkpointing: bool,
      with_larc: bool,
  ):
      cfg = compose_hydra_configuration(
          [
              "config=pretrain/swav/swav_8node_resnet",
              "+config/pretrain/swav/models=regnet16Gf",
              "config.SEED_VALUE=2",
              "config.MODEL.AMP_PARAMS.USE_AMP=True",
              "config.MODEL.AMP_PARAMS.AMP_TYPE=pytorch",
              "config.MODEL.SYNC_BN_CONFIG.CONVERT_BN_TO_SYNC_BN=True",
              "config.MODEL.SYNC_BN_CONFIG.SYNC_BN_TYPE=pytorch",
              f"config.OPTIMIZER.use_larc={with_larc}",
              "config.LOSS.swav_loss.epsilon=0.03",
              "config.MODEL.FSDP_CONFIG.flatten_parameters=True",
              "config.MODEL.FSDP_CONFIG.mixed_precision=False",
              "config.MODEL.FSDP_CONFIG.fp32_reduce_scatter=False",
          ],
      )
      args, config = convert_to_attrdict(cfg)
      if with_fsdp:
          config["MODEL"]["TRUNK"]["NAME"] = "regnet_fsdp"
          config["MODEL"]["HEAD"]["PARAMS"][0][0] = "swav_head_fsdp"
      else:
          config["MODEL"]["TRUNK"]["NAME"] = "regnet_v2"
          config["MODEL"]["HEAD"]["PARAMS"][0][0] = "swav_head"
  
      if with_larc and with_fsdp:
          config.MODEL.FSDP_CONFIG.flatten_parameters = False
          config.OPTIMIZER.name = "sgd_fsdp"
  
      config["MODEL"]["ACTIVATION_CHECKPOINTING"][
          "USE_ACTIVATION_CHECKPOINTING"
      ] = with_activation_checkpointing
      return config
  
file_path: vissl/tests/test_regnet_fsdp.py
imports: import pickle
  import unittest
  import torch
  import torch.multiprocessing
  from classy_vision.optim import build_optimizer
  from torch.nn.parallel import DistributedDataParallel
  from vissl.losses.swav_loss import SwAVLoss
  from vissl.models import build_model
  from vissl.optimizers import *
  from vissl.utils.fsdp_utils import fsdp_wrapper
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.test_utils import gpu_test, init_distributed_on_file, with_temp_files
label_desc: Use image node_id 1 for calling the TestRegnetFSDP obj's underlying member method code with example usage: obj._create_pretraining_config(with_fsdp, with_activation_checkpointing, with_larc) and returns: config