Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenAI gym and Python threading

I am working on a variation of A3C/ACER and I have several workers, each running on its own thread. I am using OpenAI gym environments.

Python threading works fine but it cannot fully utilize all cores. As there are no blocking I/O, it does not context switch.

I would like workers to somehow to release the GIL while executing actions in their respective environments.

I would appreciate your feedback: Does it make sense and it is possible?

like image 816
Juan Leni Avatar asked Jul 14 '26 20:07

Juan Leni


1 Answers

Answering my own question: I found that a quite efficient way is demonstrated in OpenAI universe-starter-agent: https://github.com/openai/universe-starter-agent.

The implementation uses Tensorflow and runs independent processes including a parameter server.

I think this can be useful as a reference to other people too.

like image 127
Juan Leni Avatar answered Jul 17 '26 19:07

Juan Leni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!