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

Fix Loader checkpointing bug #5378

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Conversation

szkarpinski
Copy link
Collaborator

Category:

Bug fix (non-breaking change which fixes an issue)

Description:

Context

Loader checkpointing works the following way:

  • Every full epoch, a new snapshot of Loader state is taken and kept (as current_snapshot_)
  • Every iteration, age counter of the current snapshot is incremented.

When restoring from checkpoint, Loader first restores its state from the snapshot provided, and then fast-forwards age iterations.

Bug & fix

On restore, during fast-forwarding phase, the age counter is increased by ReadOne, resulting in incorrect value of age being kept in current_snapshot_. In this PR I fix the restore function to set age to a correct value.

Impact

For the first epoch after restoring from checkpoint, Loader's current_snapshot_ will have invalid age. As a result, checkpoints of the Loader saved during this first epoch will be incorrect. After the first epoch, age will be reset and the checkpoints will be correct again.

Additional information:

Affected modules and functionalities:

Loader checkpointing.

Key points relevant for the review:

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
@szkarpinski szkarpinski added the important-fix Fixes an important issue in the software or development environment. label Mar 18, 2024
@stiepan stiepan self-assigned this Mar 18, 2024
@szkarpinski
Copy link
Collaborator Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13636778]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13636778]: BUILD PASSED

Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
@szkarpinski
Copy link
Collaborator Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13932924]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13932924]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13932924]: BUILD PASSED

@szkarpinski szkarpinski merged commit d28d6cb into NVIDIA:main Apr 4, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
important-fix Fixes an important issue in the software or development environment.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants