code: def save_state_dict(
      state_dict: STATE_DICT_TYPE,
      storage_writer: StorageWriter,
      process_group: Optional[dist.ProcessGroup] = None,
      coordinator_rank: int = 0,
      no_dist: bool = False,
      planner: Optional[SavePlanner] = None,
  ) -> Metadata:
      """This method is deprecated. Please switch to 'save'."""
      warnings.warn(
          "'save_state_dict' is deprecated and will be removed in future versions."
          "Please use 'save' instead."
      )
  
      # TODO: test returning `save` here instead.
      with _profile():
          return _save_state_dict(
              state_dict,
              storage_writer,
              process_group,
              coordinator_rank,
              no_dist,
              planner,
          )
  
file_path: pytorch/torch/distributed/checkpoint/state_dict_saver.py
imports: import warnings
  from concurrent.futures import Future, ThreadPoolExecutor
  from typing import Optional
  import torch
  import torch.distributed
  from torch.distributed._state_dict_utils import _offload_state_dict_to_cpu
  from torch.distributed.checkpoint.stateful import Stateful
  from .default_planner import DefaultSavePlanner
  from .metadata import Metadata, STATE_DICT_TYPE
  from .planner import SavePlanner
  from .storage import StorageWriter
  from .utils import _DistWrapper, _profile
label_desc: Use image node_id 1 for calling a global function with example usage: save_state_dict(state_dict, storage_writer, process_group, coordinator_rank, no_dist, planner) and returns: _save_state_dict