Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds model.toml configs for saving model state checkpoints.
Adds save_ckpt to model harness.
Driver saves ckpts at the end of continual learning.
Motivation & Context
Teams need model weight after drift adaptation.
Approach
In a model.toml under
[model],set the
max_ckpts, the number of checkpoints to keep. Remove based on file age.set the
ckpts_path, directory checkpoints will be stored.The model harness now has a property to check if checkpointing is enabled.
Checkpointing is disabled if
max_ckptsis set to 0 or ifckpts_pathis unspecified.Default config is disables checkpointing.
The model harness now has a
save_ckptmethod whichensures the checkpoint directory exists, saves the the current model, and
removes the oldest checkpoints to keep
max_ckpts.checkpoint files are the model state graph saved to
{ckpts_path}/drift_adaptation_{event_id}.ptThe number of checkpoints to keep depends on disk space.
Future PR should consider more comprehensive checkpointing,
a directory with the config (reproducing experiment), driver states (dataloaders, drift detector),
and model state. Checkpoints should restore training at the point the driver decides to
save a checkpoint such as in the case of restoring training runs across sequential jobs.
Screenshots / Logs (optional)
API / CLI Changes
Breaking Changes
Performance (optional)
Security & Privacy
Dependencies
Testing Plan
python -m app --helpDocumentation
Checklist
ruff format --checkruff check .mypy srcpytest -qRisk & Rollback Plan
Probably not needed in the beginning
Notes for Reviewers