ray icon indicating copy to clipboard operation
ray copied to clipboard

<RLlib> What is the cause of the low CPU utilization in rllib PPO?

Open fuckingcrazy0711 opened this issue 2 years ago • 2 comments

What happened + What you expected to happen

This is my ppo config / I open 30workers and 30 env per worker, but the cpu usage is only 15% , every rollout worker 0.6% cpu usage / I wanna to improve the cpu sampling speed. this is my code . the env is my custom env / how can I improve the cpu usage

Versions / Dependencies

ray==2.2.0

Reproduction script

from ray.rllib.algorithms.ppo import PPOConfig ray.init() config = PPOConfig() config = config.training(gamma=0.99, lr=1e-05, use_gae='True', train_batch_size =50000, model ={ "fcnet_hiddens":[512, 1024, 512]} ) config = config.rollouts(num_rollout_workers=30, num_envs_per_worker=30) config = config.environment(Env, env_config=config_env)

Issue Severity

None

fuckingcrazy0711 avatar May 13 '23 07:05 fuckingcrazy0711

Hi, could you provide more details about your environment and system specs? 30 rollout workers and 30 environments per worker sounds very high unless you specifically have more than 30 cpus available AND each cpu can run 30 environments in parallel (only possible if your env is exceptionally lightweight). Otherwise, you're just going to bottleneck your sampling performance.

Rohan138 avatar May 15 '23 17:05 Rohan138

This P2 issue has seen no activity in the past 2 years. It will be closed in 2 weeks as part of ongoing cleanup efforts.

Please comment and remove the pending-cleanup label if you believe this issue should remain open.

Thanks for contributing to Ray!

cszhu avatar Jun 17 '25 00:06 cszhu