Repository navigation
Description
Follow-up from the review of #3923. Not a defect — a gap in the checkpoint recovery matrix, and the specific question it would answer.
What is already covered
#3923 added test_sealed_siblings_survive_and_only_missing_siblings_redispatch, which runs 4 samplers × 3 scenarios and asserts that a partly generated group keeps its sealed siblings across a restart, redispatches only the missing generation indices, and that the matching staging rows survive the data-plane checkpoint. That is solid.
What is not covered
In every scenario the partly generated group sits at most one step behind the newest target:
| Scenario | Gap between the unfinished group's target and the newest |
|---|---|
S_PARTIAL, S_ZERO_LAG_PARTIAL, S_EVICTED, S_TRAINED_OUT_OF_ORDER |
0 steps |
S_LAG2 |
1 step |
S_STALE_ONLY |
7 steps, but both groups are fully generated |
"Sealed siblings" and "far behind" are each covered; never together.
Why that combination is the interesting one
A sibling that stalls does not age out. Staleness eviction only looks at slots that are ready:
RL/nemo_rl/algorithms/async_utils/staleness_sampler.py
Lines 225 to 229 in cfe85a5
| min_valid_version = max(0, current_train_weight - self._eviction_window()) | |
| stale_idxs = [ | |
| i | |
| for i, weight in enumerate(self._buffer.start_weight_list) | |
| if weight < min_valid_version and self._buffer.ready_list[i] |
An unfinished group lives in the recovery ledger, not as a ready buffer slot, so it can sit there for many steps — a straggler from step 5 is still around at step 10 by design.
But on redispatch it keeps its original weight version:
RL/nemo_rl/experience/rollout_manager.py
Line 2056 in cfe85a5
| start_version = recovery_group.start_weight_version |
Put those together and the open question is: once that long-stalled group is recovered, finishes, and commits, is it actually usable — or is it immediately evictable as stale and dropped before it is ever trained on?
Either answer may be the right one. Training on very stale rollouts is what the staleness policy exists to prevent, so dropping it could be correct. But then the recovery did work that was thrown away, and the prompt is already below the dataloader cursor, so it will never be served again. The matrix's must_survive() contract — "handed out, not trained, not deliberately evicted" — does not model a group evicted after restore, so today neither behaviour would fail a test.
Suggested test
Add a scenario with a partly generated group whose target and weight are several steps behind the newest, seal a subset of its siblings before the snapshot, and run it over the existing sampler list. Then assert whichever behaviour is intended:
- if a recovered stale group should still train, that it survives restore, completes, and is selectable;
- if it should be dropped, that it is dropped deliberately and accounted for the way
S_EVICTEDaccounts for a pre-checkpoint eviction, rather than silently disappearing.
Pinning down which of those is intended is the real value here; the test is the way to record it.
Repro for the table above, run at cfe85a53d: the largest newest_target - unfinished_group_target across all scenarios in _checkpoint_scenarios.py is 1.
Activity