code: def runtime_comm_spec_apply(
      tensor: torch.Tensor,
      comm_actions_dict: Dict,
      node_index: int,
      op_data_name: str,
  ):
      """
      This method will be invoked during runtime to apply the comm action following the instruction of comm spec.
      """
      comm_action = comm_actions_dict[node_index][op_data_name]
      if isinstance(comm_action.comm_spec, CommSpec):
          rst = comm_action.comm_spec.covert_spec_to_action(tensor)
      else:
          origin_sharding_spec = comm_action.comm_spec["src_spec"]
          tgt_sharding_spec = comm_action.comm_spec["tgt_spec"]
          rst = (
              shape_consistency_manager.apply_for_autoparallel_runtime(
                  tensor, origin_sharding_spec, tgt_sharding_spec
              )
          )
      return rst
  
file_path: ColossalAI/colossalai/auto_parallel/passes/runtime_apply_pass.py
imports: from typing import Dict, List
  import torch
  from torch.fx.node import Node
  from colossalai._analyzer.fx.node_util import MetaInfo
  from colossalai.auto_parallel.tensor_shard.sharding_strategy import CommType, OperationDataType
  from colossalai.tensor.comm_spec import CommSpec
  from colossalai.tensor.shape_consistency import ShapeConsistencyManager
  from colossalai.tensor.sharding_spec import ShardingSpec
label_desc: Use image node_id 3 for calling a global function with example usage: runtime_comm_spec_apply(tensor, comm_actions_dict, node_index, op_data_name) and returns: rst