3

I'm trying to manage the resources of a remote machine that we use for a daily task (that uses Ray). Is it possible to limit the number of CPUs (or equivalently the number of workers) that Ray uses?

The remote machine has 16 cores. Can I limit Ray to use only 12 of them or so?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
M.Erkin
  • 120
  • 1
  • 6

1 Answers1

2

You can limit resources using:

# To start a head node.
ray start --head --num-cpus=12

# To start a non-head node.
ray start --redis-address=<redis-address> --num-cpus=12

Or via ray.init:

ray.init(num_cpus=12)

Source: Ray documentation.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user1635327
  • 1,469
  • 3
  • 11