async_deep_reinforce icon indicating copy to clipboard operation
async_deep_reinforce copied to clipboard

use Multiprocessing instead of Threading?

Open mw66 opened this issue 8 years ago • 3 comments

The current implementation use Python Threading. I just wonder if this can be switched using Multiprocessing?

Multiprocessing performs much better on multi-core CPUs than Threading in Python.

Is this possible? did I miss something?

mw66 avatar Jan 22 '17 07:01 mw66

It doesn't matter on single machine since most computations are produced in tensorflow and environment emulator which both don't suffer from GIL. But it could be really nice to investigate the ability to get a distributed async agent learning implementation somehow.

ei-grad avatar Jan 25 '17 19:01 ei-grad

Nowadays even a single machine have multiple cores, but python Threading only use 1, for many application (e.g. in my case) I want to use the extra core to speed up data-generating / loading.

mw66 avatar Feb 20 '17 17:02 mw66

@mingwugmail python threading does not just use 1 core. Although it just very often use fewer cores than similar code written in multiprocessing. In the case of A3C I've tried both and multiprocessing is indeed faster.

ppwwyyxx avatar Feb 21 '17 02:02 ppwwyyxx