Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed auto val reduce #2462

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions pytorch_lightning/trainer/evaluation_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,6 @@ def _evaluate(
elif self.is_overridden('validation_epoch_end', model=model):
eval_results = model.validation_epoch_end(outputs)

# aggregate ddp stats across
has_content = eval_results is not None and len(eval_results) > 0
if has_content and (self.use_ddp or self.use_ddp2):
self.reduce_eval_ddp(eval_results)

# enable train mode again
model.train()

Expand All @@ -354,19 +349,6 @@ def _evaluate(

return eval_results

def reduce_eval_ddp(self, eval_results):
# ignore bad inputs
if eval_results is None or len(eval_results) == 0:
return

for k, v in eval_results.items():
if isinstance(v, dict):
self.reduce_eval_ddp(v)
elif isinstance(v, torch.Tensor):
dist.all_reduce(v, op=dist.reduce_op.SUM)
v = v / self.world_size
eval_results[k] = v

def run_evaluation(self, test_mode: bool = False):
# hook
model = self.get_model()
Expand Down