Is model is multiprocessing really running in parallel?

Hello all,

I am trying to implement multiprocessing environments for parallel rollouts.

I call model.share_memory() and then use torch.multiprocessing to start several processes.

In each process, I use model(input) for feed-forward computation.

My question is:

Are the feed-forward in all the processes running in parallel (like parallel GPU computation)? Or actually the model is only used by one process at one time and all the processes share the model via some locks?

Well, if you are using GPU, then you are still doing computations on the same GPU, but on CPU, you areā€¦running some kind of multiprocessing parallel.

Please read multiprocessing tutorials first.

This question belongs to distributed and not RL