From 9166e2208574f61eea3454b28ca0f2e0a45186e8 Mon Sep 17 00:00:00 2001 From: internetcoffeephone Date: Thu, 11 Jun 2020 10:06:04 +0200 Subject: [PATCH] Add doc explanation about synchronous algorithm shared GPU utilization between workers and driver. (#8400) --- doc/source/rllib-training.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/source/rllib-training.rst b/doc/source/rllib-training.rst index 6ea6dea34..f42a1cde7 100644 --- a/doc/source/rllib-training.rst +++ b/doc/source/rllib-training.rst @@ -83,6 +83,14 @@ Specifying Resources You can control the degree of parallelism used by setting the ``num_workers`` hyperparameter for most algorithms. The number of GPUs the driver should use can be set via the ``num_gpus`` option. Similarly, the resource allocation to workers can be controlled via ``num_cpus_per_worker``, ``num_gpus_per_worker``, and ``custom_resources_per_worker``. The number of GPUs can be a fractional quantity to allocate only a fraction of a GPU. For example, with DQN you can pack five trainers onto one GPU by setting ``num_gpus: 0.2``. +For synchronous algorithms like PPO and A2C, the driver and workers can make use of the same GPU. To do this for an amount of ``n`` GPUS: + +.. code-block:: python + + gpu_count = n + num_gpus = 0.0001 # Driver GPU + num_gpus_per_worker = (gpu_count - num_gpus) / num_workers + .. Original image: https://docs.google.com/drawings/d/14QINFvx3grVyJyjAnjggOCEVN-Iq6pYVJ3jA2S6j8z0/edit?usp=sharing .. image:: rllib-config.svg