dataloaders and ddp #15696
Unanswered
mosheliv
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
dataloaders and ddp
#15696
Replies: 1 comment
-
Just if someone is looking for this.... the process id is held in the RANK or NODE_RANK environment variable. It seems like the GPUS are assigned to the process based on the PCI id (device id order) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
From the documentation, it looks like under ddp, every gpu only sees a subset of the dataset. How is this implemented?
My code looks approximately like this:
is this the correct way of doing it? will every process get a different, mutually exclusive subset of indexes of the dataset?
currently, it seems not to work this way.
Also, suppose I would like to change this behaviour and load different batch sizes into different GPU, how would I go about it? if i set, for example, batch size to 10 and in self.device==0 use the first 6 in the batch and if self.device==1 use the last 4, will this work?
Probably not, if the indexes are mustually exclusive between the gpus, so how do I do that?
Sorry for the slightly messy question, hope its clear enoug. this is confusing and not entirely clear.
Beta Was this translation helpful? Give feedback.
All reactions