code: def _get_fqns(
      model: nn.Module, name: str, skip_ddp_prefix: bool = True
  ) -> FQNS_T:
      """
      This API is used to convert the name of a parameter to the FQNs. For FSDP
      without `use_orig_params`, the name of FlatParameter can be mapped to
      multiple original parameters. As a result, the return type of this function
      is `Set[str]`.
  
      Args:
          module (nn.Module): the root model.
          name (str): the name
          skip_ddp_prefix (bool): whether to skip DDP's `module` prefix
  
      Returns:
          The canonical FQNs based on the model traversal.
      """
      if "." not in name:
          return {name}
  
      obj_names = name.split(".")
      fqn_obj_names = []
      curr_obj = model
      for i, curr_obj_name in enumerate(obj_names):
          if isinstance(curr_obj, DDP):
              assert curr_obj_name == "module"
              curr_obj = curr_obj.module
              if not skip_ddp_prefix:
                  fqn_obj_names.append(curr_obj_name)
          elif isinstance(curr_obj, FSDP):
              if (
                  i < len(obj_names) - 1
                  and obj_names[i + 1] == FLAT_PARAM
              ):
                  prefix = ".".join(fqn_obj_names)
                  flat_param = getattr(curr_obj, FLAT_PARAM)
                  if prefix:
                      prefix = f"{prefix}."
                  return {f"{prefix}{fqn}" for fqn in flat_param._fqns}
              curr_obj = getattr(curr_obj, FSDP_WRAPPED_MODULE)
              if curr_obj_name != FSDP_WRAPPED_MODULE:
                  fqn_obj_names.append(curr_obj_name)
                  curr_obj = getattr(curr_obj, curr_obj_name)
          else:
              fqn_obj_names.append(curr_obj_name)
              curr_obj = getattr(curr_obj, curr_obj_name)
  
      return {".".join(fqn_obj_names)}
  
imports: import contextlib
  import functools
  import gc
  from dataclasses import asdict, dataclass, field
  from itertools import chain
  from typing import Any, Callable, cast, Dict, Iterable, List, no_type_check, Optional, Set, Tuple, Union
  import torch
  import torch.distributed
  import torch.nn
  from torch.distributed._shard.sharded_tensor import ShardedTensor
  from torch.distributed._state_dict_utils import _gather_state_dict, _offload_state_dict_to_cpu
  from torch.distributed._tensor import DTensor
  from torch.distributed.fsdp import FullOptimStateDictConfig, FullStateDictConfig, FullyShardedDataParallel, OptimStateDictConfig, ShardedOptimStateDictConfig, ShardedStateDictConfig, StateDictConfig, StateDictType
  from torch.distributed.fsdp._common_utils import _get_module_fsdp_state_if_fully_sharded_module, FSDP_WRAPPED_MODULE
  from torch.nn.modules.module import _IncompatibleKeys
  from torch.nn.parallel import DistributedDataParallel
label_desc: Use image node_id 2 for calling a global function with example usage: _get_fqns(model, name, skip_ddp_prefix) and returns: unknown, unknown, unknown