code: def auto_set_denpendency_group_ids(
      graph_module: torch.fx.GraphModule,
      config_list: List[Dict[str, Any]],
      prune_type: str = "Filter",
      prune_axis: int = 0,
  ) -> List[Dict[str, Any]]:
      """
      Auto find the output dependency between all 'Conv2d', 'Linear', 'ConvTranspose2d', 'Embedding' modules,
      then set the ``dependency_group_id`` in config list.
  
      Note that a new dependency group id will be set as a shortcut in one config,
      it will replace the old configured one in that config.
  
      Parameters
      ----------
      graph_module : torch.fx.GraphModule
          The traced model to be analyzed.
      config_list : list
          The compression config list.
  
      Returns
      config_list : list
          The new config list with dependency group id.
      """
  
      channel_dependency = build_channel_dependency(
          graph_module, prune_type, prune_axis
      )
      module2uid = {}
      for d_set in channel_dependency:
          uid = uuid4().hex
          module2uid.update({node.target: uid for node in d_set})
  
      group_dependency = build_group_dependency(graph_module)
      group_dependency = {
          node.target: group_max
          for node, (group_max, group_min) in group_dependency.items()
      }
  
      config_list = trans_legacy_config_list(config_list)
      new_config_list = []
      for config in config_list:
          modules, public_config, _ = select_modules_by_config(
              graph_module, config
          )
          for target in modules.keys():
              sub_config = deepcopy(public_config)
              if target in module2uid:
                  sub_config["dependency_group_id"] = module2uid[target]
              if target in group_dependency:
                  sub_config["internal_metric_block"] = int(
                      group_dependency[target]
                  )
              new_config_list.append(
                  {"op_names": [target], **sub_config}
              )
  
      return new_config_list
  
file_path: nni/nni/compression/speedup/dependency.py
imports: import logging
  import operator
  from copy import deepcopy
  from typing import Any, Dict, List, Set
  from uuid import uuid4
  import numpy
  import torch
  import torch.fx
  from torch.fx.passes.shape_prop import TensorMetadata
  from nni.compression.base.config import trans_legacy_config_list, select_modules_by_config
label_desc: Use image node_id 5 for calling a global function with example usage: auto_set_denpendency_group_ids(graph_module, config_list, prune_type, prune_axis) and returns: new_config_list