Skip to content

test(sc): cover a long-stalled sibling group across a checkpoint restore #4047

Closed

Description

@terrykong

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:

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:

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_EVICTED accounts 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.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions