Repository navigation
Conversation
1 task done
Member
Author
|
/ok to test 5fcdfa4 |
joyang-nv
force-pushed
the
joyang/sc-below-threshold-drop
branch
2 times, most recently
from
November 2, 2026 06:36
8cfcdd5 to
d96d0e7
Compare
Member
Author
|
/ok to test e191272 |
joyang-nv
force-pushed
the
joyang/sc-below-threshold-drop
branch
from
November 3, 2026 14:51
e191272 to
c88336b
Compare
jinglinglingling
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix. Deciding the threshold inside the finalize cut, before commit_finalized, closes both the dangling-slot bug and the train-pump race described in the second commit. No blocking issues.
Scope: the full diff at head c88336b.
Checked:
_finalize_with_actorhas one production caller, the rollout pump, which handles all three outcomes; the shortfall is credited once.- The rejected slot is never marked ready, and
abort()drops an unready slot. - The ledger discard, the spare's reservation,
_replacement_reserveand_batch_shortfallchange in one cut, and the last two are part of the rollout snapshot. - Rejected groups never populate
_finalizer_metrics_by_group/_finalizer_rewards_by_group, so dropping the old pops is safe.
nit
- Fix the "no spare prompt left" log, which is wrong under the default
on_dropped_prompt: shrink. - Drop the defaults on
target_step/replacements_usedso that a forgotten argument fails loudly.
The main CI test jobs have not run on this head; the last /ok to test was on e191272. Validation here was source inspection only. The changed unit tests could not run locally, because Ray failed to start on a node without GPUs, and no GPU training was run.
Generated by Claude
…e commit Dropping the slot after the row clears (previous commit) still left a window: while the clear RPCs are awaited the slot is ready, so a starved train pump can claim it and train on rows being cleared, and the later drop then fails with "unknown group_ids". Decide token_capture.min_valid_fraction_per_group inside the finalize cut, before commit_finalized. A rejected group is cleaned up like a structural finalizer drop (rows cleared, unready slot aborted), so it is never selectable and never enriched; drop_committed_group is no longer needed. Its replacement is taken in the same cut, and with rollout recovery the spare's ledger reservation is too (or the step is credited short), so no rollout snapshot sees the group gone without its replacement. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jonas Yang <[email protected]>
Review injected three regressions the suite missed; each now fails: - the pump dropping target_step / replacements_used when it calls _finalize_with_actor (replacement and shortfall silently disabled), - the pump crediting a rejected step short a second time, - reserving the spare's lineage with rollout recovery disabled, which the pump would then never discard. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Jonas Yang <[email protected]>
…ace test _finalize_with_actor now requires target_step and replacements_used so that a forgotten argument raises instead of silently disabling the replacement and shortfall handling. test_rollout_trace still called it with neither. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: ruit <[email protected]>
RayenTian
force-pushed
the
joyang/sc-below-threshold-drop
branch
from
November 13, 2026 02:27
c88336b to
b9df420
Compare
Contributor
|
/ok to test b9df420 |
This was referenced Nov 13, 2026
Contributor
|
closes since included in #5202 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
When a token-capture group falls below
token_capture.min_valid_fraction_per_group, the controller deletes its rows from TQ but leaves its replay-buffer slot in place, still marked ready. The buffer then holds a reference to data that no longer exists, and the sampler can select it for training.Why
commit_finalizedmarks the group's slot ready._discard_committed_group.TQReplayBuffer.abort().abort()only drops unready slots. It returnsFalsefor a ready slot, and the return value is not checked.The existing test mocked the buffer and only asserted that
abortwas called, so it never checked that the slot actually left the buffer.Impact
This only triggers when
min_valid_fraction_per_groupis set and a group falls below it. From reading the code (not reproduced in a training run):selectandpromote_ready_grouponly checktarget_stepand ready, so they can pick the dangling slot. The train fetch then asks TQ for cleared sample ids._validate_replay_inventoryfails on the missing sample ids.Fix
Decide the threshold inside the finalize mutation cut, before
commit_finalizedmarks the slot ready:_finalize_with_actorreturns_BelowValidFractionfor this case; the rollout pump dispatches the spare under the reserved lineage, or closes the step short.committed_groups_per_second/committed_output_tokens_per_second. Those now matchstats.committed, which already excluded it.The first commit dropped the ready slot after the row clears. Review found that still left a window: while the clear RPCs were awaited, a starved train pump could claim the still-ready group, train on rows being cleared, and the later drop then raised
unknown group_ids. The second commit replaces that approach, sodrop_committed_groupis gone.Testing
test_below_threshold_group_never_becomes_selectableuses a realTQReplayBufferand checks the slot is never ready during the clears, the group leaves the buffer, nothing is enriched, and the step is credited short.test_below_threshold_replacement_is_reserved_in_the_cleanup_cutchecks the ledger discard and the spare's reservation use the same cut, and that nothing is reserved when rollout recovery is off.test_below_valid_fraction_outcome_substitutes_or_closes_shortcovers the pump side with a stamped step: it passestarget_stepand the replacement count into the finalize cut and adds no shortfall credit of its own. The row/owner counting rule is tested directly on_valid_fraction_counts.test_finalizer_lifecycle.py,test_rollout_pump.py,test_tq_replay_buffer.pyandtest_checkpoint_dispatch_races.pypass locally (CPU), except one pump test that needs a HuggingFace download blocked in my environment.🤖 Generated with Claude Code