Turn off ddp_sharded during evaluation #8534
Unanswered
zhu-y11
asked this question in
DDP / multi-GPU / multi-node
Replies: 1 comment 2 replies
-
Dear @zhu-y11, Using ddp_sharded doesn't have an impact on your data being splitted directly. Actually, this is the result of Lightning injecting a DistributedDataSampler within your DataLoader. Here are one option to resolve your problems: Rely on Lightning to perform metrics reduction as yours is wrongly implemented there.
If you do Best, |
Beta Was this translation helpful? Give feedback.
2 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 there,
I am using ddp_sharded with fairscale, and it works fine during training with the lightning Trainer. But I found that in evaluation for dev/test set, ddp_sharded is still turned on, i.e. the dataset is split into shards and evaluated separately, which is difficult to calculate evaluation metric (e.g. acc), or using early stopping. So is there anyway I can use ddp_sharded during training, but turn it off for evaluation only on a single GPU?
Here is code snippet of my trainer, and the model is a simple pytorch classifier using huggingface transformers.
pytorch: v1.8.1
pytorch lightning: v1.3.8
fairscale: v0.3.8
transformers: v4.6.1
Beta Was this translation helpful? Give feedback.
All reactions