jurgisp / pydreamer

PyTorch implementation of DreamerV2 model-based RL algorithm
MIT License
209 stars 48 forks source link

about the generators #8

Closed roger-creus closed 1 year ago

roger-creus commented 1 year ago

Hi!

I don't fully understand how the code manages the available hardware resources, and I could use some advice on how to accelerate training. e.g. in an environment with multiple GPUs and multiple CPUs, what changes should I do to make sure I make use of these resources?

Thank you very much!

jurgisp commented 1 year ago

Hi! The code only supports standard single GPU training out-of-the-box. To parallelize it over multiple GPUs you would need to check the general PyTorch documentation about multi-GPU training and do the required changes. Although, I have tried some experiments in that direction, and it did not seem to provide a speed-up, because the neural nets are not that big.

Regarding multiple CPUs - each actor worker uses a separate CPU, so a good way to use them is to launch more actors (generator_workers setting).