code: def test_allreduce_different_dtype(
      ray_start_single_node_2_gpus, dtype
  ):
      world_size = 2
      actors, _ = create_collective_workers(world_size)
      ray.wait(
          [
              a.set_buffer.remote(cp.ones(10, dtype=dtype))
              for a in actors
          ]
      )
      results = ray.get([a.do_allreduce.remote() for a in actors])
      assert (
          results[0] == cp.ones((10,), dtype=dtype) * world_size
      ).all()
      assert (
          results[1] == cp.ones((10,), dtype=dtype) * world_size
      ).all()
  
file_path: ray/python/ray/util/collective/tests/single_node_gpu_tests/test_allreduce.py
imports: import cupy
  import pytest
  import ray
  import torch
  from ray.util.collective.tests.util import create_collective_workers
  from ray.util.collective.types import ReduceOp
label_desc: Use image node_id 6 for calling a global function with example usage: test_allreduce_different_dtype(ray_start_single_node_2_gpus, dtype) without return types