Resource allocation

How severe does this issue affect your experience of using Ray?

  • Low: It annoys or frustrates me for a moment.

What are the differences in resources allocated at the top level through ray.init(...) from at an actor or task level ray.remote(...). E.g., if I allocate ray.init(num_cpus=4), does that mean ray.remote(num_cpus=x), x <= 4? Also, how does fractional resource allocation work e…g, ray.remote(num_gpus=.5) – I’m assuming you have to specify whole numbers at the top level ray.init(num_gpus=y) where y is an integer?

Hey @Jerome_Ku , the resources passed to ray.init() are manually overriding the number of CPUs / GPUs Ray autodetects for the current machine. Generally, you should only set this for unit testing purposes.

To answer the question, the resources for ray.remote are allocation requests (i.e., how many CPUs Ray should reserve for this task), but the ones passed to ray.init are defining the available resources (i.e., how many CPUs should this machine be considered to have).

This doc link might also help: Tips for testing Ray programs — Ray 1.12.0