PR #5241 ยท permalinks at head 96c48d50, removed code at base 68bd259c
CheckpointReleaseError from it always reached the caller and stopped checkpointing._run_capture_phases, which raises some other error first in two cases.Two pages on this PR. This one: an error the new phase runner loses.
A TQ capture copies TransferQueue's state into memory while the barrier is held, so the slow disk write can happen after rollouts resume. The copy (the "view") stays in the storage actors' memory until it is written and released.
A TQ capture keeps a view on the storage actors. If the code cannot confirm the view was released, it raises CheckpointReleaseError: "storage actors may still retain it, so stop checkpointing". The snapshot pump retries an OSError or a timeout, and stops only on other errors. So which error comes out of the phase runner decides whether a possibly held view triggers another snapshot.
Case A needs two failures at once, for example a full disk while the capture's own cleanup fails. It could not happen before, because a failing check meant the capture never started. Case B is a plain regression. Trainer checkpoints go through the same runner but are not retried, so case A matters less there.
๐ด review comment C1 โ snapshots.py:475
Where the fix lands: RL only, one function. _run_capture_phases in snapshots.py, plus two tests in test_checkpointing.py. Nothing below is implemented.
# controller event loop, barrier held tasks = {name: create_task(phase) for name, phase in phases} def raise_release_error(done): # "stop checkpointing" beats any other error for t in done: if t raised CheckpointReleaseError: raise it try: await wait(tasks) # all phases run to the end except CancelledError: cancel all; wait until all are done raise_release_error(tasks) # case B release the capture's view if it has one raise failed = [t for t in tasks if t failed] if failed: raise_release_error(failed) # case A release the capture's view if it has one failed[0].result() # first phase error, as today
Real code: _run_capture_phases, _release_captured_view.
CheckpointReleaseError exists so a run stops instead of piling up more views. In both cases above it is replaced by an error that either retries or looks like a normal shutdown. The fix is a few lines and keeps everything else the PR does.