# RLlib IMPALA multi GPU performance

**URL:** <https://discuss.ray.io/t/rllib-impala-multi-gpu-performance/9362>\
**Category:** Configure Algorithm, Training, Evaluation, Scaling\
**Created:** [February 14, 2023, 3:18am UTC](https://discuss.ray.io/t/rllib-impala-multi-gpu-performance/9362 "2023-02-14T03:18:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuzant](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/nuzant/32/3886_2.png) [@nuzant](https://discuss.ray.io/u/nuzant)\
**Post date:** [February 14, 2023, 3:18am UTC](https://discuss.ray.io/t/rllib-impala-multi-gpu-performance/9362/1 "2023-02-14T03:18:10Z")

</div>

Hello! I have a question about multi-GPU training performance of RLlib. I appreciate your answers in advance!

RLlib IMPALA supports multi-GPU training. I trained with config provided in tuned example [pong-impala-fast.yaml](https://github.com/ray-project/ray/blob/master/rllib/tuned_examples/impala/pong-impala-fast.yaml) and got expected training throughput (around 33k transitions per second). However, when I doubled the resource to 256 workers and 4 GPUs and changed nothing else, the training throughput only reached ~35k, which should be doubled (~60k) in expectation since sampling and training in IMPALA is completely asynchronous.

What’s the problem here? Is there any settings that could be tuned to get a better result? Do we have a standard benchmark of multi-GPU training for RLlib algorithm that could scale up to 8 GPUs?

---

<div class="post-metadata">

**Author:** ![arturn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/arturn/32/2096_2.png) [@arturn](https://discuss.ray.io/u/arturn)\
**Post date:** [March 8, 2023, 11:35pm UTC](https://discuss.ray.io/t/rllib-impala-multi-gpu-performance/9362/2 "2023-03-08T23:35:16Z")

</div>

What framework do you use? Does the same happen with APPO?

---

<div class="post-metadata">

**Author:** ![nuzant](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/nuzant/32/3886_2.png) [@nuzant](https://discuss.ray.io/u/nuzant)\
**Post date:** [March 19, 2023, 7:59am UTC](https://discuss.ray.io/t/rllib-impala-multi-gpu-performance/9362/3 "2023-03-19T07:59:43Z")

</div>

I tried both pytorch and tensorflow, and the results were close. They both do not scale with multi-GPU. And yes, the same happens with APPO. I thought RLlib reused IMPALA implementation for APPO. Is there any significant difference?

---

<div class="post-metadata">

**Author:** ![arturn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/arturn/32/2096_2.png) [@arturn](https://discuss.ray.io/u/arturn)\
**Post date:** [March 19, 2023, 9:14pm UTC](https://discuss.ray.io/t/rllib-impala-multi-gpu-performance/9362/4 "2023-03-19T21:14:20Z")

</div>

In RLlib, APPO adds a target network and a KL loss to IMPALA.  
We do have a multi (2) GPU release test for APPO.  
RLlib is undergoing major changes around Multi-GPU training though.  
I’m sure @avnishn has to say more about this.
