code: def test(world_size, precision, flatten):
      """
      This test simulates wrapping the module after training to run inference.
      This is required in cases where later in a session, the model is wrapped again in FSDP but
      contains nested FSDP wrappers within the module.
      """
      if torch_version() < (1, 6, 0):
          pytest.skip("older pytorch doesn't support reduce_scatter")
  
      temp_file_name = tempfile.mkstemp()[1]
      unused = tempfile.mkstemp()[1]
  
      fsdp_config = {
          "mixed_precision": precision == "mixed",
          "flatten_parameters": flatten == "flatten",
      }
  
      mp.spawn(
          _test_func,
          args=(world_size, fsdp_config, temp_file_name, unused),
          nprocs=world_size,
          join=True,
      )
  
file_path: fairscale/tests/nn/data_parallel/test_fsdp_multiple_wrapping.py
imports: import tempfile
  import pytest
  import torch
  import torch.multiprocessing
  from torch.nn import Linear, Module, Sequential
  from torch.optim import SGD
  from fairscale.fair_dev.testing.testing import dist_init, skip_if_no_cuda, teardown
  from fairscale.internal import torch_version
  from fairscale.nn.data_parallel import FullyShardedDataParallel
  from fairscale.nn.data_parallel import TrainingState
label_desc: Use image node_id 2 for calling a global function with example usage: test(world_size, precision, flatten) without return types