Intentionally not using GPU

Hello, I’m new to ray but obviously I love this library!

I have a question. I want to ray.init() or @ray.remote, specifying only CPU resource with GPU machine. It’s because:

  • for my calculation the overhead to copy the numpy array to torch.Tensor array is not much gain in terms of speed.
  • I’m inside Docker and the ray’s GPU detection does not work correctly. (I’m not thinking to dig this to resolve for now - in a nutshell, torch.cuda.is_available() returns True outside ray but ray says it is False.)

So how I can do this? I’m specifying num_gpus=0 but ray.available_resources() still returns
{'object_store_memory': 5855249203.0, 'node:172.17.0.23': 1.0, 'accelerator_type:RTX': 1.0, 'memory': 11710498407.0, 'CPU': 10.0}
And I think I want to delete this accelerator_type:RTX because, obviously, I explicitly tell ray num_gpus = 0 !

Thank you.

cc @Alex

I believe in this case, accelerator_type:RTX': 1.0 shouldn’t do anything! But I agreed ideally, we should not detect accelerator type if num GPU is specified as 0.

Hmmm ok, thank you.
My error was saying that “deserializing from torch to numpy failed”, so I assumed that it casted numpy to torch somewhere inside even when I set num_gpus = 0. That’s why I guessed the accelerator did something. I can check that later.

If you think it is related to the accelerator type, can you create a Github issue?