Setup is running more than one time on ddp in rank 0. That is not happening on ddp_spawn. #6441
Replies: 1 comment 1 reply
-
Hi, after doing some more tests I still do not understand why prepare_data runs two times in rank 0. In fact, after doing some more tests I observed that configuring optimizers is also running two times in rank 0. In fact, If increase the number of GPUs the numbers of runs of prepare_data and configuring_optimizers in rank 0 increases. Code
Output
As far as I understood the setup method is used to download just one time a dataset when you are doing ddp. Am I right? In the case of the optimizer, I was expecting to obtain one for each gpu, however, I see that just one on rank 0 is obtained (but is obtained multiple times for the same rank). Moreover, I observed that this is not happening on ddp_spawn. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am a newbie using pl and I am trying to understand how it works with the DDP mode. To do that I create this silly code to try to understand the behaviour (it is a bit messy is just to understand how pl works):
The output of this program is the following one:
Reading the documentation about setup and prepare_data I was expecting a different output.
I was expecting to have just one print of the prepare_data hook in the main process. And multiple prints of the prepare hook one for each rank process.
Am I doing something wrong or I misunderstood something?
Thanks for your time,
Beta Was this translation helpful? Give feedback.
All reactions