-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about Multi-Processing Training #129
Comments
Hello, Thanks for reaching out! When you say multiple devices for training, you mean for collection or for actual gradient updates? When it comes to collection, it should be simple to allow to collect from multiple processes for non-vectorized environments. It might be as simple as changing the BenchMARL/benchmarl/experiment/experiment.py Line 421 in dc793b5
ParallelEnv . Ofc this is not very useful in vectorized environments like VMAS as for those it is faster to use a huge batch size on one GPU.
When it comes to training, I never thought about it. The way I remember RLlib did it was with multiple collection workers that feed to one trainer. We could envision the gradient update to be split to different devices, but untill now I did not see a use-case for it. Happy to think about it, how does RLlib do it? |
Thank you for your reply! I'm referring to both aspects. It seems that to adjust the settings from the arguments, I can modify this line:
by using --experiment.on_policy_n_envs_per_worker=20. I’m not fully familiar with the specific details of how MARllib implements multi-GPU training. I just saw from Marllib that they can set the number of GPUs to use. Seems they directly use the implementation from Ray |
I see
Yes, by changing that you can use more workers for collections. To enable multi-process collection we just have to allow users to change
Here https://docs.ray.io/en/latest/rllib/rllib-training.html#specifying-resources it says
and here https://docs.ray.io/en/latest/rllib/package_ref/doc/ray.rllib.algorithms.algorithm_config.AlgorithmConfig.learners.html it says
if you ask me to interpret this I would say that ray only ever uses max 1 GPU for training but i might be wrong Anyway, for BenchMARL, I do not envision training on multiple processes as of yet, but collecting in multiple processes is definitely possible and will be implemented |
Thank you for your reply and explanation! I am currently designing a new multi-agent environment. Currently, I am integrating my environment into the Pettingzoo and then testing different algorithms on Benchmarl. After my environment is finished, I think I will also include it in the Benchmarl. Hope that won't take much time. :D Thank you again for this great work. I saw a lot of other multi-agent libraries are no longer maintained. I believe more and more people will benefit from your work. |
Hi, Thank you for your great work!
I would like to know if BenchMARL supports multi-cpu/gpu for training. Another similar library like Marllib uses Ray for parallel training. I did not find BenchMARL to have the support of this. If not, is there any plan to implement multi-process training in the future?
The text was updated successfully, but these errors were encountered: