docstr: Tests composing ``fully_shard`` and ``replicate``. To save unit test
  time, we run the different configs in subtests.
docstr_tok: ["Tests","composing","``","fully_shard","``","and","``","replicate","``",".","To","save","unit","test","time",",","we","run","the","different","configs","in","subtests","."]
code: def test_fully_shard_replicate_composability(self):
      """
      Tests composing ``fully_shard`` and ``replicate``. To save unit test
      time, we run the different configs in subtests.
      """
      self.run_subtests(
          {
              "config": [
                  "1fm,1r",
                  "1r,1fm",
                  "1r,1fa",
                  "1r1fm,1fm",
                  "1r1fa,1fm",
                  "1fm1fm,1r1r,1fm",
              ]
          },
          self._test_replicate_in_fully_shard,
      )
  
imports: import copy
  import sys
  from typing import Dict
  import torch
  import torch.distributed
  import torch.nn
  from torch.distributed._composable import checkpoint, fully_shard, replicate
  from torch.distributed._shard.sharded_tensor import ShardedTensor
  from torch.distributed.fsdp import FullyShardedDataParallel, StateDictType
  from torch.distributed.fsdp.api import MixedPrecision, ShardingStrategy
  from torch.distributed.fsdp.wrap import ModuleWrapPolicy
  from torch.testing._internal.common_dist_composable import CompositeModel, CompositeParamModel, UnitModule
  from torch.testing._internal.common_distributed import SaveForwardInputsModel, skip_if_lt_x_gpu
  from torch.testing._internal.common_fsdp import FSDPTest
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, run_tests, TEST_WITH_DEV_DBG_ASAN
label_desc: Use image node_id 12 for calling the TestFSDPCheckpoint obj's underlying member method code with example usage: obj.test_fully_shard_replicate_composability() without return types