# \[RLlib\] Need insights on profiling

**URL:** <https://discuss.ray.io/t/rllib-need-insights-on-profiling/2384>\
**Category:** RLlib\
**Created:** [June 2, 2021, 4:08pm UTC](https://discuss.ray.io/t/rllib-need-insights-on-profiling/2384 "2021-06-02T16:08:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clement\_Collgon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/clement_collgon/32/353_2.png) [@Clement\_Collgon](https://discuss.ray.io/u/Clement_Collgon)\
**Post date:** [June 2, 2021, 4:08pm UTC](https://discuss.ray.io/t/rllib-need-insights-on-profiling/2384/1 "2021-06-02T16:08:07Z")

</div>

Hello RLLib community,

as I was profiling some of my experiments, I saw in tensorboard a few entries concerning inference times, env\_step\_mean\_ms etc. I wanted to know if it was possible to know :

- the time spent in the physical environment during rollouts **in comparison with other things** ( like model inference , backprops… ) → seems to be the **"tune/sampler\_perf/mean\_env\_wait\_ms"**
- the time spent during inferences, how to know if it’s big or not? Once again, a tool to compare with other things going on → seems to be the **tune/sampler\_perf/mean\_inference\_ms**
- backpropagation of models → seems to be around the **tune/timers/learn\_time\_ms**

Solution to 1) seems to be to get more workers and optimize physical env  
2) seems to do rollout on GPU/ more envs\_per\_worker  
3) GPU instead of CPU

I’d love some more informations. I have used my pycharm profiler and it didn’t help as there was a lot of abstract classes in the diagram.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![sven1977](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sven1977/32/53_2.png) [@sven1977](https://discuss.ray.io/u/sven1977)\
**Post date:** [June 4, 2021, 8:01am UTC](https://discuss.ray.io/t/rllib-need-insights-on-profiling/2384/2 "2021-06-04T08:01:45Z")

</div>

Hey @Clement_Collgon , your assumptions about the meaning of these stats are all correct 🙂

1. All correct.
2. Correct, envs\_per\_worker will batch more action computations together, yielding some speedup here.  
Also 3) try to increase `num_gpus` in your config (if the algo supports that, which all PyTorch algos do, but also tf PPO/IMPALA/DQN/SAC/A2C/PG).
