Finding max number of workers for training config

I have a machine with following cpu information and I want to use its maximum parallelization capacity.

(base) bash-4.2$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 104
On-line CPU(s) list: 0-103
Thread(s) per core: 2
Core(s) per socket: 26
Socket(s): 2

config = ppo.DEFAULT_CONFIG.copy()
config[‘num_workers’] = …

I have 52 cores and 104 threads and 104 CPUs. How many maximum num_workers can I assign: 52 or 104?

1 Like

You should be able to assign 103 workers. One thread has to be used by the trainer, the others can be made workers. There’s also a parameter for the number of environments per worker that you should take a look at.

If you set your output verbosity high, you should be able to actually see how many resources are available to use. Something like: CPU: 10/104, GPU: 0/0, .... This may only be a tune output though.

For more information, check out the scaling guide

1 Like