code: def check_all_reduce_bwd(process_groups_dict, rank):
      # tensor to comm
      tensor_to_comm = torch.ones(2, 2).cuda() * rank
  
      tensor_to_check = torch.ones(2, 2).cuda() * rank
  
      comm_spec = CommSpec(
          CollectiveCommPattern.IDENTITY_FWD_ALLREDUCE_BWD,
          process_groups_dict,
          logical_process_axis=0,
      )
      tensor_to_comm = comm_spec.covert_spec_to_action(tensor_to_comm)
  
      assert tensor_to_comm.equal(tensor_to_check)
  
file_path: ColossalAI/tests/test_tensor/test_dtensor/test_comm_spec.py
imports: import pytest
  import torch
  import torch.distributed
  from colossalai.device.device_mesh import DeviceMesh
  from colossalai.initialize import launch
  from colossalai.logging import disable_existing_loggers
  from colossalai.tensor.d_tensor.comm_spec import CollectiveCommPattern, CommSpec
  from colossalai.testing import rerun_if_address_is_in_use, spawn
label_desc: Use image node_id 5 for calling a global function with example usage: check_all_reduce_bwd(process_groups_dict, rank) without return types