class_docstr: Handles partitioning and gathering of parameters.
docstr: release the parameters of a sub module, assuming they meet conditions to
  be released.
docstr_tok: ["release","the","parameters","of","a","sub","module",",","assuming","they","meet","conditions","to","be","released","."]
code: def release_sub_module(self, submodule: Module) -> None:
      """release the parameters of a sub module, assuming they meet conditions to
      be released."""
      params_to_release = (
          self.__params_to_release(submodule, self.__step_id)
          if self.is_complete_trace()
          else set(p.ds_id for p in iter_params(submodule))
      )
      for param in iter_params(submodule):
          param.ds_active_sub_modules.discard(submodule.id)
          if (
              param.ds_id in params_to_release
              and not param.is_external_param
          ):
              self.__release_param(param)
  
imports: from dataclasses import dataclass
  import collections
  from collections import UserDict
  from typing import Deque, Set
  from torch.cuda import Event, Stream
  from deepspeed import comm
  from deepspeed.utils.logging import logger
  from deepspeed.runtime.zero.offload_config import OffloadDeviceEnum
  from deepspeed.runtime.zero.partition_parameters import *
  from deepspeed.runtime.swap_tensor.partitioned_param_swapper import PartitionedParamStatus
  from deepspeed.utils.debug import debug_module2name_id, debug_param2name_id
label_desc: Use image node_id 15 for calling the PartitionedParameterCoordinator obj's underlying member method code with example usage: obj.release_sub_module(submodule) without return types