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

Allow to terminate an epoch without firing Events.EPOCH_COMPLETED #3313

Merged
merged 9 commits into from
Dec 9, 2024

Conversation

bonassifabio
Copy link
Contributor

This pull request addresses #3312

Description

Engine.terminate_epoch() can now be called with the flag skip_epoch_completed=True, which allows to prevent Events.EPOCH_COMPLETED to be fired after the termination of the epoch.

TODOs

  • Adapt existing tests
  • Add new tests to ensure that handlers behave as expected when an epoch is terminated with the flag skip_epoch_completed=True.
  • Documentation is updated (if required)

Other minor changes

@github-actions github-actions bot added the module: engine Engine module label Dec 4, 2024
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR @bonassifabio !
I left a comment, otherwise it looks good to me

ignite/engine/engine.py Outdated Show resolved Hide resolved
@bonassifabio
Copy link
Contributor Author

Thanks @vfdev-5 for the positive feedback! I still want to include some additional test to make sure handlers are working as expected when terminate_epoch(True) is called.

…ion".

- Merged flags "should_terminate_single_epoch" and "_skip_epoch_completed_after_termination".
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, @bonassifabio !

ignite/engine/engine.py Outdated Show resolved Hide resolved
ignite/engine/engine.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nits, otherwise, it looks good to me!
Thanks a lot for working on this feature!

ignite/engine/engine.py Outdated Show resolved Hide resolved
ignite/engine/engine.py Outdated Show resolved Hide resolved
@vfdev-5 vfdev-5 enabled auto-merge (squash) December 9, 2024 13:18
@vfdev-5 vfdev-5 merged commit b636374 into pytorch:master Dec 9, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: engine Engine module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants