class_docstr: Unit and integration tests to check that the behavior of DINO is correct
  under FSDP.
class_docstr_tok: ["Unit","and","integration","tests","to","check","that","the","behavior","of","DINO","is","correct","under","FSDP","."]
code: def _create_dino_linear_eval_config(
      checkpoint_path: str, with_fsdp: bool, gpu_count: int = 2
  ):
      cfg = compose_hydra_configuration(
          [
              "config=test/integration_test/quick_eval_in1k_linear.yaml",
              "+config/benchmark/linear_image_classification/imagenet1k/models=dino_deit_s16",
              f"config.MODEL.WEIGHTS_INIT.PARAMS_FILE={checkpoint_path}",
              f"config.DISTRIBUTED.NUM_PROC_PER_NODE={gpu_count}",
              # Datasets
              "config.DATA.TRAIN.DATA_SOURCES=[synthetic]",
              "config.DATA.TRAIN.LABEL_SOURCES=[synthetic]",
              "config.DATA.TRAIN.BATCHSIZE_PER_REPLICA=4",
              "config.DATA.TRAIN.RANDOM_SYNTHETIC_IMAGES=True",
              "config.DATA.TRAIN.DATA_LIMIT=32",
              "config.DATA.TRAIN.USE_DEBUGGING_SAMPLER=True",
              "config.DATA.TEST.DATA_SOURCES=[synthetic]",
              "config.DATA.TEST.LABEL_SOURCES=[synthetic]",
              "config.DATA.TEST.BATCHSIZE_PER_REPLICA=4",
              "config.DATA.TEST.RANDOM_SYNTHETIC_IMAGES=True",
              "config.DATA.TEST.DATA_LIMIT=32",
              "config.DATA.TEST.USE_DEBUGGING_SAMPLER=True",
              # To get the logs reliably
              "config.LOG_FREQUENCY=1",
              "config.REPRODUCIBILITY.CUDDN_DETERMINISTIC=True",
              "config.OPTIMIZER.num_epochs=2",
          ]
      )
      args, config = convert_to_attrdict(cfg)
      if with_fsdp:
          config["MODEL"]["TRUNK"]["NAME"] = "vision_transformer_fsdp"
          num_heads = len(config["MODEL"]["HEAD"]["PARAMS"])
          for i in range(num_heads):
              head_name = config["MODEL"]["HEAD"]["PARAMS"][i][0]
              config["MODEL"]["HEAD"]["PARAMS"][i][
                  0
              ] = f"{head_name}_fsdp"
          config.TRAINER.TASK_NAME = "self_supervision_fsdp_task"
          config.MODEL.FSDP_CONFIG.flatten_parameters = False
          config.MODEL.FSDP_CONFIG.mixed_precision = False
          config.MODEL.FSDP_CONFIG.fp32_reduce_scatter = False
          config.MODEL.FSDP_CONFIG.compute_dtype = torch.float32
      return config
  
imports: import os
  import unittest
  import torch
  import torch.multiprocessing
  import torch.optim
  from torch.nn.parallel import DistributedDataParallel
  from vissl.models import build_model
  from vissl.models.heads.dino_head import DINOHead, DINOHeadFSDP
  from vissl.utils.checkpoint import CheckpointFormatConverter, DINOCheckpointUtils
  from vissl.utils.fsdp_utils import fsdp_wrapper
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.misc import set_torch_seed
  from vissl.utils.test_utils import gpu_test, in_temporary_directory, init_distributed_on_file, run_integration_test, with_temp_files
label_desc: Use image node_id 2 for calling the TestDINO obj's underlying member method code with example usage: obj._create_dino_linear_eval_config(checkpoint_path, with_fsdp, gpu_count) and returns: config