code: def test_smaller_than_world_size(world_size, test_case, fsdp_config):
      """Test FSDP with uneven divide of parameter shards."""
      if torch_version() < (1, 6, 0):
          pytest.skip(
              "older pytorch doesn't support reduce_scatter in gloo backend"
          )
  
      if world_size > torch.cuda.device_count():
          pytest.skip("Not enough GPUs.")
  
      temp_file_name = tempfile.mkstemp()[1]
      unused = tempfile.mkstemp()[1]
  
      model = Sequential(
          Linear(3, 3, bias=False),
          Linear(3, 4, bias=False),
          Linear(4, 5, bias=False),
          Linear(5, 4, bias=False),
          Linear(4, 3, bias=False),
          Linear(3, 1, bias=False),
          Linear(
              1, 1, bias=False
          ),  # param here is smaller than world_size if unflattened.
      )
      mp.spawn(
          _test_func,
          args=(
              world_size,
              model,
              fsdp_config,
              temp_file_name,
              unused,
              test_case,
          ),
          nprocs=world_size,
          join=True,
      )
  
file_path: fairscale/tests/nn/data_parallel/test_fsdp_uneven.py
imports: import tempfile
  import pytest
  import torch
  from torch import Tensor
  import torch.multiprocessing
  from torch.nn import Linear, Sequential
  from torch.optim import SGD
  from fairscale.fair_dev.testing.testing import dist_init, skip_if_single_gpu, teardown
  from fairscale.internal import torch_version
  from fairscale.nn.data_parallel import FullyShardedDataParallel
  from fairscale.nn.data_parallel.fully_sharded_data_parallel import TrainingState
label_desc: Use image node_id 3 for calling a global function with example usage: test_smaller_than_world_size(world_size, test_case, fsdp_config) without return types