-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Labels
designIncludes a design discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementhelp wantedOpen to be worked onOpen to be worked onpriority: 0High priority taskHigh priority task
Description
🚀 Feature
This isn't a feature as much as API refinement we should do.
These 2 sets of hooks are redundant:
{training/validation/test}_epoch_end= defined inside the LightningModule: https://github.com/PyTorchLightning/pytorch-lightning/blob/b7a22ba046ba57072a71b12d16caff000e66f798/pytorch_lightning/core/lightning.py#L652-L691on_{train/val/test}_epoch_end= defined inside core/hooks: https://github.com/PyTorchLightning/pytorch-lightning/blob/b7a22ba046ba57072a71b12d16caff000e66f798/pytorch_lightning/core/hooks.py#L207-L211
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_endgets 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_endtakes no arguments and runs after{training/validation/test}_epoch_endis 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 discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementhelp wantedOpen to be worked onOpen to be worked onpriority: 0High priority taskHigh priority task