Question about resource management in Ray

Okay, @sangcho , that was what I was looking for. In fact, I saw that only on thread per worker was executed at each time, but Why does Ray creates many threads for each worker? I mean, I always see a thread in state Running for each worker (in fact in the image you can see trhree threads running, one of them corresponding to the htop process), but why are many threads created for ecah one and they execute alternatively? Maybe this a more question of understanding RLlib and PPO way of work and it’s more aproppiate to move the question To RLLIB section…

Anyway thanks in advance for your answers

Ray worker is not just a python process, but it has cpp code attached (for Ray related operations), and they are written in multi threaded code to optimize the performance!

1 Like

Also, there are other ray components at each ray node (e.g., Raylet, a scheduler, dashboard agent, and etc.), which also uses some CPUs. They shouldn’t use many CPUs, but they all are using some of them (and it can use any CPU in your machine as ray doesn’t do resource isolation like Docker)

1 Like