class_docstr: The abstract dist sparse optimizer.
  
  Note: dgl dist sparse optimizer only work with dgl.distributed.DistEmbedding
  
  Parameters
  ----------
  params : list of DistEmbedding
      The list of DistEmbedding.
  lr : float
      The learning rate.
docstr: Load the local state of the optimizer from the file on per rank.
  
  NOTE: This needs to be called on all ranks.
  
  Parameters
  ----------
  f : Union[str, os.PathLike]
      The path of the file to load from.
  
  See Also
  --------
  save
docstr_tok: ["Load","the","local","state","of","the","optimizer","from","the","file","on","per","rank",".","NOTE",":","This","needs","to","be","called","on","all","ranks",".","Parameters","--","--","--","--","--","f",":","Union","[","str",",","os.PathLike","]","The","path","of","the","file","to","load","from",".","See","Also","--","--","--","--","save"]
code: def load(self, f):
      """Load the local state of the optimizer from the file on per rank.
  
      NOTE: This needs to be called on all ranks.
  
      Parameters
      ----------
      f : Union[str, os.PathLike]
          The path of the file to load from.
  
      See Also
      --------
      save
      """
      if self._world_size > 1:
          th.distributed.barrier()
      f = f if isinstance(f, str) else str(f, "UTF-8")
      f_attach_rank = f"{f}_{self._rank}"
      # Don't throw error here to support device number scale-out
      # after reloading, but make sure your hyper parameter is same
      # as before because new added local optimizers will be filled
      # in nothing
      if not exists(f_attach_rank):
          warnings.warn(
              f"File {f_attach_rank} can't be found, load nothing."
          )
      else:
          old_world_size = self._load_state_from(f_attach_rank)
          # Device number scale-in
          if self._world_size < old_world_size:
              for rank in range(
                  self._rank + self._world_size,
                  old_world_size,
                  self._world_size,
              ):
                  self._load_state_from(f"{f}_{rank}")
      if self._world_size > 1:
          th.distributed.barrier()
  
imports: import abc
  import warnings
  from abc import abstractmethod
  from os.path import exists
  import torch
  import dgl
  from ....None import backend
  from ...dist_tensor import DistTensor
  from ...graph_partition_book import EDGE_PART_POLICY, NODE_PART_POLICY
  from ...nn.pytorch import DistEmbedding
  from .utils import alltoall, alltoallv
label_desc: Use image node_id 5 for calling the DistSparseGradOptimizer obj's underlying member method code with example usage: obj.load(f) without return types