Title: SEED RL: SCALABLE AND EFFICIENT DEEP-RL WITH ACCELERATED CENTRAL INFERENCE

Abstract: We present a modern scalable reinforcement learning agent called SEED (Scalable, Efficient Deep-RL). By effectively utilizing modern accelerators, we show that it is not only possible to train on millions of frames per second but also to lower the cost of experiments compared to current methods. We achieve this with a simple architecture that features centralized inference and an optimized communication layer. SEED adopts two state of the art distributed algorithms, IMPALA/V-trace (policy gradients) and R2D2 (Q-learning), and is evaluated on Atari-57, DeepMind Lab and Google Research Football. We improve the state of the art on Football and are able to reach state of the art on Atari-57 three times faster in wall-time. For the scenarios we consider, a 40% to 80% cost reduction for running experiments is achieved. The implementation along with experiments is open-sourced so results can be reproduced and novel ideas tried out.

1. INTRODUCTION:

The field of reinforcement learning (RL) has recently seen impressive results across a variety of tasks. This has in part been fueled by the introduction of deep learning in RL and the introduction of accelerators such as GPUs. In the very recent history, focus on massive scale has been key to solve a number of complicated games such as AlphaGo (Silver et al., 2016) , Dota (OpenAI, 2018) and StarCraft 2 (Vinyals et al., 2017) .

The sheer amount of environment data needed to solve tasks trivial to humans, makes distributed machine learning unavoidable for fast experiment turnaround time. RL is inherently comprised of heterogeneous tasks: running environments, model inference, model training, replay buffer, etc. and current state-of-the-art distributed algorithms do not efficiently use compute resources for the tasks. The amount of data and inefficient use of resources makes experiments unreasonably expensive. The two main challenges addressed in this paper are scaling of reinforcement learning and optimizing the use of modern accelerators, CPUs and other resources.

We introduce SEED (Scalable, Efficient, Deep-RL), a modern RL agent that scales well, is flexible and efficiently utilizes available resources. It is a distributed agent where model inference is done centrally combined with fast streaming RPCs to reduce the overhead of inference calls. We show that with simple methods, one can achieve state-of-the-art results faster on a number of tasks. For optimal performance, we use TPUs (cloud.google.com/tpu/) and TensorFlow 2 (Abadi et al., 2015) to simplify the implementation. The cost of running SEED is analyzed against IMPALA (Espeholt et al., 2018) which is a commonly used state-of-the-art distributed RL algorithm (Veeriah et al. (2019) ; Li et al. (2019) ; Deverett et al. (2019) ; Omidshafiei et al. (2019) ; Vezhnevets et al. (2019) ; Hansen et al. (2019) ; Schaarschmidt et al.; Tirumala et al. (2019) , ...). We show cost reductions of up to 80% while being significantly faster. When scaling SEED to many accelerators, it can train on millions of frames per second. Finally, the implementation is open-sourced together with examples of running it at scale on Google Cloud (see Appendix A.4 for details) making it easy to reproduce results and try novel ideas.

2. RELATED WORK:

For value-based methods, an early attempt for scaling DQN was Nair et al. (2015) that used asynchronous SGD (Dean et al., 2012) together with a distributed setup consisting of actors, replay buffers, parameter servers and learners. Since then, it has been shown that asynchronous SGD leads to poor sample complexity while not being significantly faster (Chen et al., 2016; Espeholt et al., 2018) . Along with advances for Q-learning such as prioritized replay (Schaul et al., 2015) , dueling networks (Wang et al., 2016) , and double-Q learning (van Hasselt, 2010; Van Hasselt et al., 2016) the state-of-the-art distributed Q-learning was improved with Ape-X (Horgan et al., 2018) . Recently, R2D2 (Kapturowski et al., 2018) achieved impressive results across all the Arcade Learning Environment (ALE) (Bellemare et al., 2013) games by incorporating value-function rescaling (Pohlen et al., 2018) and LSTMs (Hochreiter & Schmidhuber, 1997) on top of the advancements of Ape-X.

There have also been many approaches for scaling policy gradients methods. A3C (Mnih et al., 2016) introduced asynchronous single-machine training using asynchronous SGD and relied exclusively on CPUs. GPUs were later introduced in GA3C (Mahmood, 2017) with improved speed but poor convergence results due to an inherently on-policy method being used in an off-policy setting. This was corrected by V-trace (Espeholt et al., 2018) in the IMPALA agent both for singlemachine training and also scaled using a simple actor-learner architecture to more than a thousand machines. PPO (Schulman et al., 2017) serves a similar purpose to V-trace and was used in OpenAI Rapid (Petrov et al., 2018) with the actor-learner architecture extended with Redis (redis.io), an in-memory data store, and was scaled to 128,000 CPUs. For inexpensive environments like ALE, a single machine with multiple accelerators can achieve results quickly (Stooke & Abbeel, 2018) . This approach was taken a step further by converting ALE to run on a GPU (Dalton et al., 2019) .

A third class of algorithms is evolutionary algorithms. With simplicity and massive scale, they have achieved impressive results on a number of tasks (Salimans et al., 2017; Such et al., 2017) .

Besides algorithms, there exist a number of useful libraries and frameworks for reinforcement learning. ELF (Tian et al., 2017) is a framework for efficiently interacting with environments, avoiding Python global-interpreter-lock contention. Dopamine (Castro et al., 2018) is a flexible research focused RL framework with a strong emphasis on reproducibility. It has state of the art agent implementations such as Rainbow (Hessel et al., 2017) but is single-threaded. TF-Agents (Guadarrama et al., 2018) and rlpyt (Stooke & Abbeel, 2019) both have a broader focus with implementations for several classes of algorithms but as of writing, they do not have distributed capability for largescale RL. RLLib (Liang et al., 2017) provides a number of composable distributed components and a communication abstraction with a number of algorithm implementations such as IMPALA and Ape-X. Concurrent with this work, TorchBeast (Küttler et al., 2019) was released which is an implementation of single-machine IMPALA with remote environments. SEED is closest related to IMPALA, but has a number of key differences that combine the benefits of single-machine training with a scalable architecture. Inference is moved to the learner but environments run remotely. This is combined with a fast communication layer to mitigate latency issues from the increased number of remote calls. The result is significantly faster training at reduced costs by as much as 80% for the scenarios we consider. Along with a policy gradients (V-trace) implementation we also provide an implementation of state of the art Q-learning (R2D2). In the work we use TPUs but in principle, any modern accelerator could be used in their place. TPUs are particularly well-suited given they high throughput for machine learning applications and the scalability. Up to 2048 cores are connected with a fast interconnect providing 100+ petaflops of compute.

3. ARCHITECTURE:

Before introducing the architecture of SEED, we first analyze the generic actor-learner architecture used by IMPALA, which is also used in various forms in Ape-X, OpenAI Rapid and others. An overview of the architecture is shown in Figure 1a .

A large number of actors repeatedly read model parameters from the learner (or parameter servers). Each actor then proceeds the local model to sample actions and generate a full trajectory of observations, actions, policy logits/Q-values. Finally, this trajectory along with recurrent state is transferred There are a number of reasons for why this architecture falls short:

1. Using CPUs for neural network inference: The actor machines are usually CPU-based (occasionally GPU-based for expensive environments). CPUs are known to be computationally inefficient for neural networks (Raina et al., 2009) . When the computational needs of a model increase, the time spent on inference starts to outweigh the environment step computation. The solution is to increase the number of actors which increases the cost and affects convergence (Espeholt et al., 2018) .

2.. Inefficient resource utilization::

Actors alternate between two tasks: environment steps and inference steps. The compute requirements for the two tasks are often not similar which leads to poor utilization or slow actors. E.g. some environments are inherently single-threading while neural networks are easily parallelizable.

3. Bandwidth requirements: Model parameters, recurrent state and observations are transferred between actors and learners. Relatively to model parameters, the size of the observation trajectory often only accounts for a few percents.1 Furthermore, memory-based models send large states, increase bandwidth requirements.

While single-machine approaches such as GA3C (Mahmood, 2017) and single-machine IMPALA avoid using CPU for inference (1) and do not have network bandwidth requirements (3), they are restricted by resource usage (2) and the scale required for many types of environments.

The architecture used in SEED (Figure 1b ) solves the problems mentioned above. Inference and trajectory accumulation is moved to the learner which makes it conceptually a single-machine setup with remote environments (besides handling failures). Moving the logic effectively makes the actors a small loop around the environments. For every single environment step, the observations are sent to the learner, which runs the inference and sends actions back to the actors. This introduces a new problem: 4. Latency.

To minimize latency, we created a simple framework that uses gRPC (grpc.io) -a high performance RPC library. Specifically, we employ streaming RPCs where the connection from actor to learner is kept open and metadata sent only once. Furthermore, the framework includes a batching module that efficiently batches multiple actor inference calls together. In cases where actors can fit on the same machine as learners, gRPC uses unix domain sockets and thus reduces latency, CPU and syscall overhead. Overall, the end-to-end latency, including network and inference, is faster for a number of the models we consider (see Appendix A.7). (a) Off-policy in IMPALA. For the entire trajectory the policy stays the same. By the time the trajectory is sent to the queue for optimization, the policy has changed twice.

✓t+1 ✓t+2 ⇡✓ t+1 ⇡✓ t+2 ✓t ✓t+1 ✓t+2 Q ⇡✓ t ⇡✓ t+1 ⇡✓ t+2 Learner Actor (b) Off-policy in SEED.

Optimizing a model has immediate effect on the policy. Thus, the trajectory consists of actions sampled from many different policies (π θ t , π θ t+1 , ...). 

2.:

Recurrent states 1.

2.

3.:

Training thread 1.

Reporting and checkpointing:

Apply gradients 2.

Training TPUs Model 3. The IMPALA and SEED architectures differ in that for SEED, at any point in time, only one copy of the model exists whereas for distributed IMPALA each actor has its own copy. This changes the way the trajectories are off-policy. In IMPALA (Figure 2a ), an actor uses the same policy π θt for an entire trajectory. For SEED (Figure 2b ), the policy during an unroll of a trajectory may change multiple times with later steps using more recent policies closer to the one used at optimization time.

Data prefetching threads:

A detailed view of the learner in the SEED architecture is shown on Figure 3 . Three types of threads are running: 1. Inference 2. Data prefetching and 3. Training. Inference threads receive a batch of observations, rewards and episode termination flags. They load the recurrent states and send the data to the inference TPU core. The sampled actions and new recurrent states are received, and the actions are sent back to the actors while the latest recurrent states are stored. When a trajectory is fully unrolled it is added to a FIFO queue or replay buffer and later sampled by data prefetching threads. Finally, the trajectories are pushed to a device buffer for each of the TPU cores taking part in training. The training thread (the main Python thread) takes the prefetched trajectories, computes gradients using the training TPU cores and applies the gradients on the models of all TPU cores (inference and training) synchronously. The ratio of inference and training cores can be adjusted for maximum throughput and utilization. The architecture scales to a TPU pod (2048 cores) by roundrobin assigning actors to TPU host machines, and having separate inference threads for each TPU host. When actors wait for a response from the learner, they are idle so in order to fully utilize the machines, we run multiple environments on a single actor.

To summarize, we solve the issues listed previously by:

1. Moving inference to the learner and thus eliminating any neural network related computations from the actors. Increasing the model size in this architecture will not increase the need for more actors (in fact the opposite is true).

2. Batching inference on the learner and having multiple environments on the actor. This fully utilize both the accelerators on the learner and CPUs on the actors. The number of TPU cores for inference and training is finely tuned to match the inference and training workloads. All factors help reducing the cost of experiments. 3. Everything involving the model stays on the learner and only observations and actions are sent between the actors and the learner. This reduces bandwidth requirements by as much as 99%. 4. Using streaming gRPC that has minimal latency and minimal overhead and integrating batching into the server module.

We provide the following two algorithms implemented in the SEED framework: V-trace and Qlearning.

3.1. V-TRACE:

One of the algorithms we adapt into the framework is V-trace (Espeholt et al., 2018) . We do not include any of the additions that have been proposed on top of IMPALA such as van den Oord et al. ( 2018); Gregor et al. (2019) . The additions can also be applied to SEED and since they are more computational expensive, they would benefit from the SEED architecture.

3.2. Q-LEARNING:

We show the versatility of SEED's architecture by fully implementing R2D2 (Kapturowski et al., 2018) , a state of the art distributed value-based agent. R2D2 itself builds on a long list of improvements over DQN (Mnih et al., 2015) : double Q-learning (van Hasselt, 2010; Van Hasselt et al., 2016) , multi-step bootstrap targets (Sutton, 1988; Sutton & Barto, 1998; Mnih et al., 2016) , dueling network architecture (Wang et al., 2016) , prioritized distributed replay buffer (Schaul et al., 2015; Horgan et al., 2018) , value-function rescaling (Pohlen et al., 2018 ), LSTM's (Hochreiter & Schmidhuber, 1997) and burn-in (Kapturowski et al., 2018) .

Instead of a distributed replay buffer, we show that it is possible to keep the replay buffer on the learner with a straightforward flexible implementation. This reduces complexity by removing one type of job in the setup. It has the drawback of being limited by the memory of the learner but it was not a problem in our experiments by a large margin: a replay buffer of 10 5 trajectories of length 120 of 84 × 84 uncompressed grayscale observations (following R2D2's hyperparameters) takes 85GBs of RAM, while Google Cloud machines can offer hundreds of GBs. However, nothing prevents the use of a distributed replay buffer together with SEED's central inference, in cases where a much larger replay buffer is needed.

4. EXPERIMENTS:

We evaluate SEED on a number of environments: DeepMind Lab (Beattie et al., 2016) , Google Research Football (Kurach et al., 2019) and Arcade Learning Environment (Bellemare et al., 2013) .

4.1. DEEPMIND LAB AND V-TRACE:

DeepMind Lab is a 3D environment based on the Quake 3 engine. It features mazes, laser tag and memory tasks. We evaluate on four commonly used tasks. The action set used is from Espeholt et al. (2018) although for some tasks, higher return can be achieved with bigger action sets such as the one introduced in Hessel et al. (2018) . For all experiments, we used an action repeat of 4 and the number of frames in plots is listed as environment frames (equivalent to 4 times the number of steps). The same set of 24 hyperparameter sets and the same model (ResNet from IMPALA) was used for both agents. More details can be found in Appendix A.1.2.

4.1.1. STABILITY:

The first experiment evaluates the effect of the change in off-policy behavior described in Figure 2 .

Exactly the same hyperparameters are used for both IMPALA and SEED, including the number of environments used. As is shown in Figure 4 , the stability across hyperparameters of SEED is slightly better than IMPALA, while achieving slightly higher final returns.

Published as a conference paper at ICLR 2020 IMPALA -P100, 175 envs. SEED -TPU v3 2 cores, 175 envs. 

4.1.2. SPEED:

For evaluating performance, we compare IMPALA using an Nvidia P100 with SEED with multiple accelerator setups. They are evaluated on the same set of hyperparameters. We find that SEED is 2.5x faster than IMPALA using 2 TPU v3 cores (see Table 1 ), while using only 77% more environments and 41% less CPU (see section 4.4.1). Scaling from 2 to 8 cores results in an additional 4.4x speedup with sample complexity maintained (Figure 5 ). The speed-up is greater than 4x due to using 6 cores for training and 2 for inference instead of 1 core for each, resulting in better utilization. A 5.3x speed-up instead of 4.4x can be obtained by increasing the batch size linearly with the number of training cores, but contrary to related research (You et al., 2017b; Goyal et al., 2017) we found that increased batch size hurts sample complexity even with methods like warm-up and actor de-correlation (Stooke & Abbeel, 2018) . We hypothesize that this is due to the limited actor and environment diversity in DeepMind Lab tasks. In McCandlish et al. (2018) they found that Pong scales poorly with batch size but that Dota can be trained effectively with a batch size five orders of magnitude larger. Note, for most models, the effective batch size is batch size • trajectory length.

In Figure 5 , we include a run from a limited sweep on "explore_goal_locations_small" using 64 cores with an almost linear speed-up. Wall-time performance is improved but sample complexity is heavily penalized.

When using an Nvidia P100, SEED is 1.58x slower than IMPALA. A slowdown is expected because SEED performs inference on the accelerator. SEED does however use significantly fewer CPUs and is lower cost (see Appendix A.6). The TPU version of SEED has been optimized but it is likely that improvements can be found for SEED with P100. 

4.2. GOOGLE RESEARCH FOOTBALL AND V-TRACE:

Google Research Football is an environment similar to FIFA video games (ea.com). We evaluate SEED on the "Hard" task introduced in Kurach et al. (2019) where the baseline IMPALA agent achieved a positive average score after 500M frames using the engineered "checkpoint" reward function but a negative average score using only the score as a reward signal. In all experiments we use the model from Kurach et al. (2019) and sweep over 40 hyperparameter sets with 3 seeds each. See all hyperparameters in Appendix A.2.1.

Compared to the baseline IMPALA using 2 Nvidia P100's (and CPUs for inference) in Kurach et al. (2019) we find that using 2 TPU v3 cores in SEED improves the speed by 1.6x (see Table 1 ). Additionally, using 8 cores adds another 4.1x speed-up. A speed-up of 4.5x is achievable if the batch size is increased linearly with the number of training cores (5). However, we found that increasing the batch size, like with DeepMind Lab, hurts sample complexity.

4.2.2. INCREASED MAP SIZE:

More compute power allows us to increase the size of the Super Mini Map (SMM) input state. By default its size is 96 x 72 (x 4) and it represents players, opponents, ball and the active player as 2d bit maps. We evaluated three sizes: (1) Default 96 x 72, (2) Medium 120 x 90 and (3) Large 144 x 108. As shown in Table 1 , switching from Default to Large SMM results in 60% speed reduction. However, increasing the map size improves the final score (Table 2 ). It may suggest that the bit map representation is not granular enough for the task. For both reward functions, we improve upon the results of Kurach et al. (2019) . Finally, training on 4B frames improves the results by a significant margin (an average score of 0.46 vs. 4.76 in case of the scoring reward function). 2019) although we ran 40 hyperparameter sets vs. 100 but did not rerun our best models using 5 seeds.

4.3. ARCADE LEARNING ENVIRONMENT:

We follow the same evaluation procedure as R2D2. In particular, we use the full action set, no lossof-life-as-episode-end heuristic and start episodes with up to 30 random no-ops. We use 8 TPU v3 cores and 610 actors to maximize TPU utilization. This achieves 260K environment FPS and performs 9.5 network updates per second. Other hyperparameters are taken from R2D2, and are fully reproduced in appendix A.3.1.

Figure 6 shows the median humannormalized scores for SEED, R2D2, Ape-X and Rainbow. As expected, SEED has similar sample efficiency as R2D2, but it is 3.1x faster (see Table 1 ). This allows us to reach a median humannormalized score of 1880% in just 1.8 days of training instead of 5, establishing a new wall-time state of the art on Atari-57.

With the number of actors increased to 1200, a batch size increased to 256 and without framestacking, we can achieve 440K environment FPS and learn using 16 batches per second. However, this significantly degrades sample efficiency and limits the final median human-normalized score to approximately 1000%.

4.4. COST COMPARISONS:

With growing complexity of environments as well as size of neural networks used in reinforcement learning, the need of running big experiments increases, making cost reductions important. In this The batch size was lowered from 32 to 16 due to limited memory on Nvidia P100.

Table 4 : Training cost on DeepMind Lab for 1 billion frames.

As Table 4 shows, SEED turns out to be not only faster, but also cheaper to run. The cost ratio between SEED and IMPALA is around 4. Due to high cost of inference on a CPU, IMPALA's cost increases with increasing complexity of the network. In the case of SEED, increased network size has smaller impact on overall costs, as inference accounts for about 30% of the costs (see Table A .5).

4.4.2. GOOGLE RESEARCH FOOTBALL:

We evaluate cost of running experiments with Google Research Football with different sizes of the Super Mini Map representation (the size has virtually no impact on environment's speed.) For IMPALA, two Nvidia P100 GPUs were used for training and SEED used one TPU v3 core for training and one for inference.

For IMPALA, we use one core per actor while SEED's actors run multiple environments per actor for better CPU utilization (8 cores, 12 environments).

For the default size of the Table 5 : Training cost on Google Research Football for 1 billion frames.

have relatively smaller impact on the overall experiment cost. The difference increases when the size of the SMM increases and SEED needing relatively fewer actors.

Due to lack of baseline implementation for R2D2, we do not include cost comparisons for this environment. However, comparison of relative costs between ALE, DeepMind Lab and Football suggests that savings should be even more significant. ALE is the fastest among the three environments making inference proportionally the most expensive. Appendix A.5 presents training cost split between actors and the learner for different setups.

5. CONCLUSION:

We introduced and analyzed a new reinforcement learning agent architecture that is faster and less costly per environment frame than previous distributed architectures by better utilizing modern accelerators. It achieved a 11x wall-time speedup on DeepMind Lab compared to a strong IMPALA baseline while keeping the same sample efficiency, improved on state of the art scores on Google Research Football, and achieved state of the art scores on Atari-57 3.1x faster (wall-time) than previous research.

The agent is open-sourced and packaged to easily run on Google Cloud. We hope that this will accelerate reinforcement learning research by allowing the community to replicate state-of-the-art results and build on top of them.

As a demonstration of the potential of this new agent architecture, we were able to scale it to millions of frames per second in some realistic scenarios (80x speedup compared to previous research). However, this requires increasing the number of environments and using larger batch sizes which hurts sample efficiency in the environments tested. Preserving sample efficiency with larger batchsizes has been studied to some extent in RL (Stooke & Abbeel, 2018; McCandlish et al., 2018) and in the context of supervised learning (You et al., 2017b; a; 2019; Goyal et al., 2017) . We believe it is still an open and increasingly important area of research in order to scale up reinforcement learning. 

:

With 100,000 observations send per second (96 x 72 x 3 bytes each), a trajectory length of

and a 30MB model, the total bandwidth requirement is 148 GB/s. Transferring observations uses only 2 GB/s.

TPU cores are sold in multiples of 8, by running many experiments at once we use as many cores per experiment as needed. See cloud.google.com/ml-engine/docs/pricing.

Figures and Tables:

(b) SEED architecture, see detailed replay architecture in Figure3.

Figure 1: Overview of architectures

Figure2: Variants of "near on-policy" when evaluating a policy π while asynchronously optimizing model parameters θ.

Figure 3: Detailed Learner architecture in SEED (with an optional replay buffer).

Figure 4: Comparison of IMPALA and SEED under the exact same conditions (175 actors, same hyperparameters, etc.) The plots show hyperparameter combinations sorted by the final performance across different hyperparameter combinations.

Figure 7: Learning curves on 57 Atari 2600 games for SEED (8 TPUv3 cores, 610 actors, evaluated with 1 seed). Each point of each curve averages returns over 200 episodes. No curve smoothing was performed. Curves end at approximately 43 hours of training, corresponding to 40e9 environment frames.

Each of the 256 R2D2 actors run at 335 FPS (information from the R2D2 authors). 3 5/8 cores used for training.4 No frame stacking. Performance of SEED, IMPALA and R2D2.

Table content: <table><tr><td>Architecture</td><td>Accelerators</td><td colspan="4">Environments Actor CPUs Batch Size FPS Ratio</td></tr><tr><td>DeepMind Lab</td><td/><td/><td/><td/><td/></tr><tr><td>IMPALA</td><td>Nvidia P100</td><td>176</td><td>176</td><td>30K</td><td>-</td></tr><tr><td>SEED</td><td>Nvidia P100</td><td>176</td><td>44</td><td colspan="2">19K 0.63x</td></tr><tr><td>SEED</td><td>TPU v3, 2 cores</td><td>312</td><td>104</td><td colspan="2">74K 2.5x</td></tr><tr><td>SEED</td><td>TPU v3, 8 cores</td><td>1560</td><td>520</td><td colspan="2">330K 11.0x</td></tr><tr><td>SEED</td><td>TPU v3, 64 cores</td><td>12,480</td><td>4,160</td><td colspan="2">2.4M 80.0x</td></tr><tr><td colspan="2">Google Research Football</td><td/><td/><td/><td/></tr><tr><td colspan="2">IMPALA, Default 2 x Nvidia P100</td><td>400</td><td>400</td><td>11K</td><td>-</td></tr><tr><td>SEED, Default</td><td>TPU v3, 2 cores</td><td>624</td><td>416</td><td colspan="2">18K 1.6x</td></tr><tr><td>SEED, Default</td><td>TPU v3, 8 cores</td><td>2,496</td><td>1,664</td><td colspan="2">71K 6.5x</td></tr><tr><td>SEED, Medium</td><td>TPU v3, 8 cores</td><td>1,550</td><td>1,032</td><td>44K</td><td>-</td></tr><tr><td>SEED, Large</td><td>TPU v3, 8 cores</td><td>1,260</td><td>840</td><td>29K</td><td>-</td></tr><tr><td>SEED, Large</td><td>TPU v3, 32 cores</td><td>5,040</td><td>3,360</td><td colspan="2">114K 3.9x</td></tr><tr><td colspan="2">Arcade Learning Environment</td><td/><td/><td/><td/></tr><tr><td>R2D2</td><td>Nvidia V100</td><td>256</td><td>N/A</td><td>85K 2</td><td>-</td></tr><tr><td>SEED</td><td>Nvidia V100</td><td>256</td><td>55</td><td colspan="2">67K 0.79x</td></tr><tr><td>SEED</td><td>TPU v3, 8 cores</td><td>610</td><td>213</td><td colspan="2">260K 3.1x</td></tr><tr><td>SEED</td><td>TPU v3, 8 cores</td><td>1200</td><td>419</td><td colspan="2">440K 4 5.2x</td></tr><tr><td colspan="2">1 6/8 cores used for training. 2</td><td/><td/><td/><td/></tr></table>

Median human-normalized score on Atari-57 for SEED and related agents. SEED was run with 1 seed for each game. All agents use up to 30 random no-ops for evaluation. Left: X-axis is hours Right: X-axis is environment frames (a frame is 1/4th of an environment step due to action repeat). SEED reaches state of the art performance 3.1x faster (wall-time) than R2D2.We evaluate our implementation of R2D2 in SEED architecture on 57 Atari 2600 games from the ALE benchmark. This benchmark has been the testbed for most recent deep reinforcement learning agents because of the diversity of visuals and game mechanics.

Table content: <table><tr><td>0% 500% 1000% 1500% 2000% (Median over 57 games) Human-normalized Score</td><td>0</td><td colspan="2">20 R2D2(12h) 40 Training time (Hours) 60 80 R2D2(24h) R2D2(48h) R2D2(72h) 100 120 R2D2(120h) Ape-X(20h) Ape-X(70h) Ape-X(120h) Rainbow(120h) SEED 8 cores 500% 0% 1000% 1500% 2000% Human-normalized Score (Median over 57 games)</td><td>0 Rainbow(120h) 1 Environment frames 2 3 R2D2(12h) R2D2(24h) R2D2(72h) Ape-X(20h) Ape-X(70h) Ape-X(120h) R2D2(120h) 1e10 4 R2D2(48h) SEED 8 cores</td></tr><tr><td colspan="5">Figure 6: Architecture Accelerators</td><td>SMM</td><td>Median Max</td></tr><tr><td/><td/><td colspan="2">Scoring reward</td></tr><tr><td/><td/><td>IMPALA</td><td colspan="2">2 x Nvidia P100 Default</td><td>-0.74 0.06</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 2 cores Default</td><td>-0.72 -0.12</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 8 cores Default</td><td>-0.83 -0.02</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 8 cores Medium</td><td>-0.74 0.12</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 8 cores Large</td><td>-0.69 0.46</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 32 cores Large</td><td>n/a 4.76 1</td></tr><tr><td/><td/><td colspan="3">Checkpoint reward</td></tr><tr><td/><td/><td>IMPALA</td><td colspan="2">2 x Nvidia P100 Default</td><td>-0.27 1.63</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 2 cores Default</td><td>-0.44 1.64</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 8 cores Default</td><td>-0.68 1.55</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 8 cores Medium</td><td>-0.52 1.76</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 8 cores Large</td><td>-0.38 1.86</td></tr><tr><td/><td/><td>SEED</td><td colspan="2">TPU v3, 32 cores Large</td><td>n/a 7.66 1</td></tr><tr><td/><td/><td colspan="3">AND Q-LEARNING</td></tr></table>

Google Research Football "Hard" using two kinds of reward functions. For each reward function, 40 hyperparameter sets ran with 3 seeds each which were averaged after 500M frames of training. The table shows the median and maximum of the 40 averaged values. This is a similar setup toKurach  et al. (

Table content: <table/>

section we analyze how increasing complexity of the network impacts training cost for SEED and IMPALA. In our experiments we use the pricing model of Google AI Platform, ML Engine. 2

Table content: <table><tr><td>Resource</td><td>Cost per hour</td></tr><tr><td>CPU core</td><td>$0.0475</td></tr><tr><td>Nvidia Tesla P100</td><td>$1.46</td></tr><tr><td>TPU v3 core</td><td>$1.00</td></tr></table>

Cost of cloud resources as of Sep. 2019. experiment is based on the ResNet model from IMPALA. We evaluate increasing the number of filters in the convolutional layers: (1) Default 1x (2) Medium 2x and (3) Large 4x. Experiments are performed on the "explore_goal_locations_small" task. IMPALA uses a single Nvidia Tesla P100 GPU for training while inference is done on CPU by the actors. SEED uses one TPU v3 core for training and one for inference.For IMPALA, actor CPU utilization is close to 100% but in case of SEED, only the environment runs on an actor making CPU idle while waiting for inference step. To improve utilization, a single SEED actor runs multiple environments (between 12 and 16) on a 4-CPU machine.

Table content: <table><tr><td colspan="5">Our main focus is on obtaining lowest possible cost per</td><td/><td/></tr><tr><td colspan="5">step, while maintaining training speed. Distributed exper-</td><td/><td/></tr><tr><td colspan="5">iments from Espeholt et al. (2018) (IMPALA) used be-</td><td/><td/></tr><tr><td colspan="5">tween 150 and 500 CPUs, which translates into $7.125 -</td><td/><td/></tr><tr><td colspan="5">$23.75 of actors' cost per hour. The cost of single-GPU</td><td/><td/></tr><tr><td colspan="5">learner is $1.46 per hour. Due to the relatively high ex-</td><td/><td/></tr><tr><td colspan="5">pense of the actors, our main focus is to reduce number of</td><td/><td/></tr><tr><td colspan="3">actors and to obtain high CPU utilization.</td><td/><td/><td/><td/></tr><tr><td>4.4.1 DEEPMIND LAB</td><td/><td/><td/><td/><td/><td/></tr><tr><td>Our DeepMind Lab Model</td><td colspan="6">Actors CPUs Envs. Speed Cost/1B Cost ratio</td></tr><tr><td>IMPALA</td><td/><td/><td/><td/><td/><td/></tr><tr><td>Default</td><td>176</td><td>176</td><td>176</td><td>30k</td><td>$90</td><td>-</td></tr><tr><td>Medium</td><td>130</td><td>130</td><td>130</td><td>16.5k</td><td>$128</td><td>-</td></tr><tr><td>Large</td><td>100</td><td>100</td><td>100</td><td>7.3k 1</td><td>$236</td><td>-</td></tr><tr><td>SEED</td><td/><td/><td/><td/><td/><td/></tr><tr><td>Default</td><td>26</td><td>104</td><td>312</td><td>74k</td><td>$25</td><td>3.60</td></tr><tr><td>Medium</td><td>12</td><td>48</td><td>156</td><td>34k</td><td>$35</td><td>3.66</td></tr><tr><td>Large</td><td>6</td><td>24</td><td>84</td><td>16k</td><td>$54</td><td>4.37</td></tr><tr><td>1</td><td/><td/><td/><td/><td/><td/></tr></table>

SMM, per experiment training cost differs by only 68%. As the Google Research Football environment is more expensive than DeepMind Lab, training and inference costs

Table content: <table><tr><td>Model</td><td colspan="6">Actors CPUs Envs. Speed Cost/1B Cost ratio</td></tr><tr><td>IMPALA</td><td/><td/><td/><td/><td/><td/></tr><tr><td>Default</td><td>400</td><td>400</td><td>400</td><td>11k</td><td>$553</td><td>-</td></tr><tr><td>Medium</td><td>300</td><td>300</td><td>300</td><td>7k</td><td>$681</td><td>-</td></tr><tr><td>Large</td><td>300</td><td>300</td><td>300</td><td>5.3k</td><td>$899</td><td>-</td></tr><tr><td>SEED</td><td/><td/><td/><td/><td/><td/></tr><tr><td>Default</td><td>52</td><td>416</td><td>624</td><td>17.5k</td><td>$345</td><td>1.68</td></tr><tr><td>Medium</td><td>31</td><td>248</td><td>310</td><td>10.5k</td><td>$365</td><td>1.87</td></tr><tr><td>Large</td><td>21</td><td>168</td><td>252</td><td>7.5k</td><td>$369</td><td>2.70</td></tr></table>

Final performance of SEED 8 TPU v3 cores, 610 actors (1 seed) compared to R2D2 (averaged over 3 seeds) and Human, using up to 30 random no-op steps at the beginning of each episode. SEED was evaluated by averaging returns over 200 episodes for each game after training on 40e9 environment frames.

Table content: <table><tr><td colspan="2">A.3.2 FULL RESULTS ON ATARI-57</td><td/><td/></tr><tr><td>Game</td><td>Human</td><td colspan="2">R2D2 SEED 8 TPU v3 cores</td></tr><tr><td>Alien</td><td>7127.7</td><td>229496.9</td><td>262197.4</td></tr><tr><td>Amidar</td><td>1719.5</td><td>29321.4</td><td>28976.4</td></tr><tr><td>Assault</td><td>742.0</td><td>108197.0</td><td>102954.7</td></tr><tr><td>Asterix</td><td>8503.3</td><td>999153.3</td><td>983821.0</td></tr><tr><td>Asteroids</td><td>47388.7</td><td>357867.7</td><td>296783.0</td></tr><tr><td>Atlantis</td><td colspan="2">29028.1 1620764.0</td><td>1612438.0</td></tr><tr><td>BankHeist</td><td>753.1</td><td>24235.9</td><td>47080.6</td></tr><tr><td>BattleZone</td><td>37187.5</td><td>751880.0</td><td>777200.0</td></tr><tr><td>BeamRider</td><td>16926.5</td><td>188257.4</td><td>173505.3</td></tr><tr><td>Berzerk</td><td>2630.4</td><td>53318.7</td><td>57530.4</td></tr><tr><td>Bowling</td><td>160.7</td><td>219.5</td><td>204.2</td></tr><tr><td>Boxing</td><td>12.1</td><td>98.5</td><td>100.0</td></tr><tr><td>Breakout</td><td>30.5</td><td>837.7</td><td>854.1</td></tr><tr><td>Centipede</td><td>12017.0</td><td>599140.3</td><td>574373.1</td></tr><tr><td>ChopperCommand</td><td>7387.8</td><td>986652.0</td><td>994991.0</td></tr><tr><td>CrazyClimber</td><td>35829.4</td><td>366690.7</td><td>337756.0</td></tr><tr><td>Defender</td><td>18688.9</td><td>665792.0</td><td>555427.2</td></tr><tr><td>DemonAttack</td><td>1971.0</td><td>140002.3</td><td>143748.6</td></tr><tr><td>DoubleDunk</td><td>-16.4</td><td>23.7</td><td>24.0</td></tr><tr><td>Enduro</td><td>860.5</td><td>2372.7</td><td>2369.3</td></tr><tr><td>FishingDerby</td><td>-38.7</td><td>85.8</td><td>75.0</td></tr><tr><td>Freeway</td><td>29.6</td><td>32.5</td><td>33.0</td></tr><tr><td>Frostbite</td><td>4334.7</td><td>315456.4</td><td>101726.8</td></tr><tr><td>Gopher</td><td>2412.5</td><td>124776.3</td><td>117650.4</td></tr><tr><td>Gravitar</td><td>3351.4</td><td>15680.7</td><td>7813.8</td></tr><tr><td>Hero</td><td>30826.4</td><td>39537.1</td><td>37223.1</td></tr><tr><td>IceHockey</td><td>0.9</td><td>79.3</td><td>79.2</td></tr><tr><td>Jamesbond</td><td>302.8</td><td>25354.0</td><td>25987.0</td></tr><tr><td>Kangaroo</td><td>3035.0</td><td>14130.7</td><td>13862.0</td></tr><tr><td>Krull</td><td>2665.5</td><td>218448.1</td><td>113224.8</td></tr><tr><td>KungFuMaster</td><td>22736.3</td><td>233413.3</td><td>239713.0</td></tr><tr><td>MontezumaRevenge</td><td>4753.3</td><td>2061.3</td><td>900.0</td></tr><tr><td>MsPacman</td><td>6951.6</td><td>42281.7</td><td>43115.4</td></tr><tr><td>NameThisGame</td><td>8049.0</td><td>58182.7</td><td>68836.2</td></tr><tr><td>Phoenix</td><td>7242.6</td><td>864020.0</td><td>915929.6</td></tr><tr><td>Pitfall</td><td>6463.7</td><td>0.0</td><td>-0.1</td></tr><tr><td>Pong</td><td>14.6</td><td>21.0</td><td>21.0</td></tr><tr><td>PrivateEye</td><td>69571.3</td><td>5322.7</td><td>198.0</td></tr><tr><td>Qbert</td><td>13455.0</td><td>408850.0</td><td>546857.5</td></tr><tr><td>Riverraid</td><td>17118.0</td><td>45632.1</td><td>36906.4</td></tr><tr><td>RoadRunner</td><td>7845.0</td><td>599246.7</td><td>601220.0</td></tr><tr><td>Robotank</td><td>11.9</td><td>100.4</td><td>104.8</td></tr><tr><td>Seaquest</td><td>42054.7</td><td>999996.7</td><td>999990.2</td></tr><tr><td>Skiing</td><td>-4336.9</td><td>-30021.7</td><td>-29973.6</td></tr><tr><td>Solaris</td><td>12326.7</td><td>3787.2</td><td>861.6</td></tr><tr><td>SpaceInvaders</td><td>1668.7</td><td>43223.4</td><td>62957.8</td></tr><tr><td>StarGunner</td><td>10250.0</td><td>717344.0</td><td>448480.0</td></tr><tr><td>Surround</td><td>6.5</td><td>9.9</td><td>9.8</td></tr><tr><td>Tennis</td><td>-8.3</td><td>-0.1</td><td>23.9</td></tr><tr><td>TimePilot</td><td>5229.2</td><td>445377.3</td><td>444527.0</td></tr><tr><td>Tutankham</td><td>167.6</td><td>395.3</td><td>376.5</td></tr><tr><td>UpNDown</td><td>11693.2</td><td>589226.9</td><td>549355.4</td></tr><tr><td>Venture</td><td>1187.5</td><td>1970.7</td><td>2005.5</td></tr><tr><td>VideoPinball</td><td>17667.9</td><td>999383.2</td><td>979432.1</td></tr><tr><td>WizardOfWor</td><td>4756.5</td><td>144362.7</td><td>136352.5</td></tr><tr><td>YarsRevenge</td><td>54576.9</td><td>995048.4</td><td>973319.0</td></tr><tr><td>Zaxxon</td><td>9173.3</td><td>224910.7</td><td>168816.5</td></tr></table>

Peer review (iclr2020):
This paper presents a scalable reinforcement learning training architecture which combines a number of modern engineering advances to address the inefficiencies of prior methods. The proposed architecture shows good performance on a wide variety of benchmarks from ALE to DeepMind Lab and Google Research Football. Important to the community, authors also open source their code and provide an estimate which shows that the proposed framework is cheaper to run on cloud platforms. Pros: 1. This work is solid from the engineering perspective. It effectively addresses the problems with prior architectures and the accompanying source code is clear and well structured. It is also extensively tested on several RL benchmarks. 2. The proposed framework is especially suited for training large models as the model parameters are not transferred between actors and learners. 3. The paper is well written and organized. Cons: 1. The gain of the main algorithmic improvement (SEED architecture) over the baseline (IMPALA architecture) is obscured by the usage of different hardware. TPUv3 has different characteristics than Nvidia P100/V100 GPU chips which also might contribute to the speed up. Questions: 1. Is it possible to provide more “apple-to-apple” comparison by running SEED and IMPALA on the same hardware (TPUv3 or Nvidia P100/V100 GPU)?