Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limiting CPU resources of Ray

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?

like image 677
M.Erkin Avatar asked Oct 20 '25 02:10

M.Erkin


1 Answers

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.

like image 150
user1635327 Avatar answered Oct 21 '25 14:10

user1635327



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!