validation_epoch_end and ddp
I am using Pytorch lightning with the ddp backend using 4 GPUs. I have early stopping set as follows:
# Setup early stopping if we have validation set
    early_stop_callback = False
    if 'val_data_path' in hparams:
        early_stop_callback = pl.callbacks.EarlyStopping(
            monitor='val_loss',
            min_delta=0.00,
            patience=10,
            verbose=False,
            mode='min'
        )

trainer = Trainer(gpus=-1,
                            distributed_backend='ddp)
trainer.configure_early_stopping(early_stop_callback)

Now, I have validation steps as follows:
def validation_step(self, batch, batch_idx):
    anchor, positive, negatives = batch
    negatives = negatives.transpose(0, 1)
    losses = []
    for i in range(len(negatives)):
        anchor_out, positive_out, negative_out = self.forward_train(anchor,
                                                                                                           positive,
                                                                                                           negatives[i])
        loss_val = self.lossfn(anchor_out, positive_out, negative_out)
        losses.append(loss_val)

        loss_val = torch.stack(losses).mean()
        return {'val_loss': loss_val}

def validation_epoch_end(self, outputs):
    loss_val = torch.stack([x['val_loss'] for x in outputs]).mean()
    log_dict = {'validation_loss': loss_val, 'step': self.current_epoch}
    print('Mean Val loss: ', loss_val.item())
    return {'log': log_dict, 'val_loss': log_dict['validation_loss'], 'progress_bar': log_dict}

Now when I run this, I see4 print statements for every epoch as:
Mean Val loss:  0.24644988775253296
Mean Val loss:  0.25091350078582764
Mean Val loss:  0.25268322229385376
Mean Val loss:  0.27601054310798645

So, I am assuming validation is split  between  each GPU.
However, I am not sure if the early stopping will actually collate these and combine them? I think  what should happen is we should consider the mean of these sub-batches while considering early stopping our logging. Is this what actually happens? Looking at the logged validation error, it seems it takes one of them randomly but this is equivalent to not using the whole validation set in the evaluation?