code: def check_all_reduce():
      tensor = torch.tensor(
          [dist.get_rank() * SIZE + j for j in range(SIZE)]
      )
      tensor = tensor.to(get_current_device())
      print("Before:   Rank {0} - {1}".format(dist.get_rank(), tensor))
      tensor, op = all_reduce(
          tensor, ParallelMode.GLOBAL, async_op=True
      )
      print("After:    Rank {0} - {1}".format(dist.get_rank(), tensor))
      op.wait()
      print("Complete: Rank {0} - {1}".format(dist.get_rank(), tensor))
      torch.cuda.synchronize()
  
file_path: colossalai/tests/test_legacy/test_comm/test_comm.py
imports: import pytest
  import torch
  import torch.distributed
  from colossalai.legacy.communication import all_gather, all_reduce, reduce_scatter
  from colossalai.legacy.context import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.initialize import launch
  from colossalai.testing import rerun_if_address_is_in_use, spawn
  from colossalai.utils import get_current_device
label_desc: Use image node_id 3 for calling a global function with example usage: check_all_reduce() without return types