code: def test_serialize_cupy_from_rmm(size):
      np = pytest.importorskip("numpy")
      rmm = pytest.importorskip("rmm")
  
      x_np = np.arange(size, dtype="u1")
  
      x_np_desc = x_np.__array_interface__
      (x_np_ptr, _) = x_np_desc["data"]
      (x_np_size,) = x_np_desc["shape"]
      x = rmm.DeviceBuffer(ptr=x_np_ptr, size=x_np_size)
  
      header, frames = serialize(
          x, serializers=("cuda", "dask", "pickle")
      )
      header["type-serialized"] = pickle.dumps(cupy.ndarray)
  
      y = deserialize(
          header,
          frames,
          deserializers=("cuda", "dask", "pickle", "error"),
      )
  
      assert (x_np == cupy.asnumpy(y)).all()
  
file_path: distributed/distributed/protocol/tests/test_cupy.py
imports: from __future__ import annotations
  import pickle
  import pytest
  from distributed.protocol import deserialize, serialize
label_desc: Use image node_id 3 for calling a global function with example usage: test_serialize_cupy_from_rmm(size) without return types