code: def assert_not_equal_in_group(tensor, process_group=None):
      # all gather tensors from different ranks
      world_size = dist.get_world_size(process_group)
      tensor_list = [
          torch.empty_like(tensor) for _ in range(world_size)
      ]
      dist.all_gather(tensor_list, tensor, group=process_group)
  
      # check if they are equal one by one
      for i in range(world_size - 1):
          a = tensor_list[i]
          b = tensor_list[i + 1]
          assert not torch.allclose(a, b), (
              f"expected tensors on rank {i} and {i + 1} not to be equal "
              f"but they are, {a} vs {b}"
          )
  
file_path: colossalai/tests/test_moe/moe_utils.py
imports: import torch
  import torch.distributed
  import torch.nn
  from colossalai.legacy.engine.gradient_handler._base_gradient_handler import BaseGradientHandler
  from colossalai.legacy.engine.gradient_handler.utils import bucket_allreduce
  from colossalai.legacy.registry import GRADIENT_HANDLER
  from colossalai.moe import SparseMLP
  from colossalai.moe.manager import MOE_MANAGER
  from colossalai.moe.utils import get_moe_epsize_param_dict
label_desc: Use image node_id 1 for calling a global function with example usage: assert_not_equal_in_group(tensor, process_group) without return types