Skip to content

fix(load_ml): report liveness during training - #4682

Open
romain-intel wants to merge 1 commit into
springfall2008:mainfrom
romain-intel:pr/load-ml-liveness
Open

fix(load_ml): report liveness during training#4682
romain-intel wants to merge 1 commit into
springfall2008:mainfrom
romain-intel:pr/load-ml-liveness

Conversation

@romain-intel

Copy link
Copy Markdown
Contributor

The component marks itself successful once per loop iteration, at the end - but a curriculum retrain is five passes of thirty epochs and routinely runs longer than the sixty minute window components.is_alive() allows between successes. is_all_alive() then fails, is_running() returns False, and the dashboard shows the whole of Predbat as "(unhealthy)" while nothing is actually wrong.

Restarting the component appears to fix it because that resets the clock, which is exactly why this looked like a crash and stayed hidden - there is nothing in the log, because nothing failed.

train() and train_curriculum() take an optional progress_callback, invoked once per epoch, and the component passes its own update_success_timestamp. On the observed hardware an epoch is around forty seconds, so the pulse has two orders of magnitude of headroom against the window. The hook is guarded: a progress callback must never be able to abort an hour of training.

Both of _do_training's train_curriculum call sites are wired, and the test drives the real _do_training for is_initial True and False, asserting on every call rather than the last - with is_initial the initial curriculum is followed by a fine-tune pass, so recording only the most recent call would let an unwired first one hide behind a correct second. Verified by deleting each call site in turn and confirming the test fails.

…lled dead

The component marks itself successful once per loop iteration, at the end - but a curriculum
retrain is five passes of thirty epochs and routinely runs longer than the sixty minute window
components.is_alive() allows between successes. Measured on a live system, all seven retrains in a
day ran over: 63, 67, 69, 73, 78, 88 and 90 minutes, leaving the component reported dead for the
last 3 to 30 minutes of each. is_all_alive() then fails, is_running() returns False, and the
dashboard shows the whole of Predbat as "(unhealthy)" while nothing is actually wrong.

Restarting the component appears to fix it because that resets the clock, which is exactly why this
looked like a crash and stayed hidden - there is nothing in the log, because nothing failed.

train() and train_curriculum() take an optional progress_callback, invoked once per epoch, and the
component passes its own update_success_timestamp. On the observed hardware an epoch is around forty
seconds, so the pulse has two orders of magnitude of headroom against the window. The hook is
guarded: a progress callback must never be able to abort an hour of training.

Both of _do_training's train_curriculum call sites are wired, and the test drives the real
_do_training for is_initial True and False, asserting on every call rather than the last - with
is_initial the initial curriculum is followed by a fine-tune pass, so recording only the most recent
call would let an unwired first one hide behind a correct second. Verified by deleting each call
site in turn and confirming the test fails.

This is a separate fault from the log rotation race fixed earlier. That one killed the thread for
good and left a traceback; this one leaves no trace and clears itself when training finishes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit f046506219693059f20b8e279f35fa145ba22ab7)
@springfall2008

Copy link
Copy Markdown
Owner

Change looks fine, but its not hooked up to anything?

@romain-intel

Copy link
Copy Markdown
Contributor Author

Wdym? It passes the self.update_success_timestamp down which is then called periodically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants