code: def classify_params_by_dp_degree(
      param_order: OrderedParamGenerator, process_group: ProcessGroup
  ) -> Dict[int, List[ColoParameter]]:
      """classify_params_by_dp_degree
  
      Classify the parameters by their dp degree
  
      Args:
          param_order (OrderedParamGenerator): the order of param be vised
          strict_ddp_flag (bool, optional): whether to enable the strict ddp mode. Defaults to False.
  
      Returns:
          Dict[int, List[ColoParameter]]: a dict contains the classification results.
          The keys are dp_degrees and the values are parameters.
      """
      params_dict: Dict[int, List[ColoParameter]] = dict()
      for param in param_order.generate():
          # assert isinstance(param, ColoParameter), "please init model in the ColoInitContext"
          if is_ddp_ignored(param):
              continue
          param_key = dist.get_world_size(process_group)
  
          if param_key not in params_dict:
              params_dict[param_key] = []
          params_dict[param_key].append(param)
  
      return params_dict
  
file_path: ColossalAI/colossalai/zero/gemini/chunk/search_utils.py
imports: import math
  from typing import Dict, List, Optional, Tuple
  import numpy
  import torch.distributed
  import torch.nn
  from torch.distributed import ProcessGroup
  from colossalai.tensor import ColoParameter
  from colossalai.utils import is_ddp_ignored
  from colossalai.zero.gemini.memory_tracer import MemStats, OrderedParamGenerator
label_desc: Use image node_id 4 for calling a global function with example usage: classify_params_by_dp_degree(param_order, process_group) and returns: params_dict