code: def is_valid_fsdp_model(model: FSDP) -> bool:
      """
      Checks if a FSDP model is valid by looking at the sub-FSDP modules
      and ensuring that they do not think they are the root FSDP model
      """
      for n, m in model.named_modules():
          if isinstance(m, FSDP):
              if n != "" and m._is_root is not None:
                  return False
      return True
  
file_path: vissl/vissl/utils/fsdp_utils.py
imports: import torch.distributed
  import torch.nn
  from fairscale.nn import auto_wrap, default_auto_wrap_policy, enable_wrap
  from fairscale.nn.data_parallel import auto_wrap_bn, FullyShardedDataParallel
  from vissl.config.attr_dict import AttrDict
label_desc: Use image node_id 5 for calling a global function with example usage: is_valid_fsdp_model(model) and returns: True, False