-
Notifications
You must be signed in to change notification settings - Fork 5
237 copy purge model storage functionality for main #238
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
base: main
Are you sure you want to change the base?
237 copy purge model storage functionality for main #238
Conversation
Trigger CICD suite to run tests.
Add functionality from #230 to purge model storage after each meta - trail.
Add negative case test for purge_model_storage.
Trigger tests.
Syntax correction
Add positive case test for assert purge_model_storage_files.
Added corrected CICD test for positive case for purge_model_storage_files.
Add better CICD test for negative case for purge_model_storage_files.
Syntax correction / typo.
Syntax / typo.
Refactor best metric error handling to allow +/- inf metrics (these actually will work in current versions of pd.Series.min() / ....max() ), but still exclude other arbitrary types (str, Exception)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ What’s good
Fix for non-float metrics (e.g., "inf") avoids best-metric crashes.
New purge_model_storage_files=True option frees disk/RAM after picking best sub-trial model.
Tests include positive & negative cases to prove opt-in and back-compat.
Metric safety
Coerce values via a helper that treats NaN/±inf as non-finite and falls back cleanly.
Add a tiny table test for ["1.0","inf","-inf","nan", None].
Purge safety
Guard against symlinks and .. paths; don’t follow links.
Wrap purge in try/except so failure doesn’t break get_best_model().
Log simple stats: {dirs_deleted, files_deleted, bytes_freed, duration_ms}.
DX/Docs
One line in README: “Use purge_model_storage_files=True to reclaim space (especially in containers).”
👍 Nice-to-have (don’t block)
Warn if artifacts are on Docker overlay (no volume mount).
Env toggle CEREBROS_PURGE_DEFAULT for ops environments.
✅ Verdict
Approve with the above nits. The change is backward-compatible, fixes a real footgun, and gives operators a clean way to control disk/RAM.
Item 1: Bug fix:
When a Keras metric returns a non-float value like "inf", it would break casting to float / computing .min() / .max() for finding the best performing model.
Item 2:
Item 3:
Appended the 2 Ames CICD tests with a positive case and negative case test to endure this feature works when explicitly called and is not triggered unless called explicitly / proving backward compatibility.