Skip to content

Remove duplicate epoch_end hooks in the Lightning Module #6865

@ananthsub

Description

@ananthsub

🚀 Feature

This isn't a feature as much as API refinement we should do.

These 2 sets of hooks are redundant:

Both take the step outputs from that epoch for post-processing, which is confusing for users. Which ones should users implement for post-processing?

@kaushikb11 @tchaton @edenafek

Motivation

Clarify the API

Pitch

Turn it back how it used to be before:

  • {training/validation/test}_epoch_end gets the step outputs for post-processing. If the LightningModule implements this, then the Trainer retains the step outputs during execution. If not, we save memory and discard the step outputs.
  • on_{train/val/test}_epoch_end takes no arguments and runs after {training/validation/test}_epoch_end is called. The user has a chance to persist outputs from the first hook before the second runs, but it doesn't need to be passed through by the trainer.

Alternatives

Additional context

Metadata

Metadata

Assignees

Labels

designIncludes a design discussionfeatureIs an improvement or enhancementhelp wantedOpen to be worked onpriority: 0High priority task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions