-
Notifications
You must be signed in to change notification settings - Fork 831
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
Q: reduced #process on GPU? #21
Comments
There was a bug in PyTorch that initialized cuda in every separate process (that wasn't needed). Apparently, it was fixed recently. Does it change performance in any way? |
Oh, I found I made a mistake: the single GPU process scenario is not an Atari game. (It's a game env that I created with no graphics/images). And I rerun the Atari game, it still use N+1 GPU processes, and performance is the same. So I guess it's the gym game env that create a GPU process for each game in training; because Atari game are video (image) games? thus N+1 (main). Comparing the two scenario, my next question is: so all the CNN network (CNNPolicy) are running on that single main CPU process, instead of each game's env GPU process? Then I wonder if it's possible to distribute CNN computation on each of the GPU process and get some performance gain? |
Each process just initializes (but doesn't use CUDA), it's a bug (feature?) in PyTorch. At the moment, all environments run in CPU threads. Then, the observations get concatenated and sent to GPU. |
gym doe not depend on PyTorch, so it's because of WrapPyTorch, is this absolute necessary? |
Yes. It's because of data format. |
Hi,
Previously (a few days ago) in training I saw (args.num_processes + 1) processes on GPU using nvidia-smi, and GPU utilization high 80~90%.
With the latest code, I saw only one process on GPU, and sometimes GPU utilization only a few percent.
I just wondering what changed? and it's intended.
Thanks.
The text was updated successfully, but these errors were encountered: