Skip to content

fix(rollout): make dynamic refills granular#2218

Open
EazyReal wants to merge 1 commit into
THUDM:mainfrom
EazyReal:fix/granular-rollout-refills
Open

fix(rollout): make dynamic refills granular#2218
EazyReal wants to merge 1 commit into
THUDM:mainfrom
EazyReal:fix/granular-rollout-refills

Conversation

@EazyReal

Copy link
Copy Markdown
Contributor

Problem

Dynamic sampling currently requires over_sampling_batch_size to be at least rollout_batch_size, even though the rollout state machine supports any positive refill granularity. A single rejected prompt group can therefore launch a full replacement wave.

At rollout completion, non-partial generation tasks are also left running while SGLang is drained. Multi-turn custom generation can issue new requests during that drain, delaying or preventing it from reaching idle.

Change

  • accept any positive over_sampling_batch_size
  • cancel and await non-partial generation tasks before draining SGLang
  • preserve partial-rollout prefixes through server drain
  • make the complete abort lifecycle exception-safe while re-raising the original failure
  • align English and Chinese dynamic-sampling documentation
  • add CPU regressions for validation, cancellation ordering, partial preservation, and failure cleanup

The existing scheduler remains unchanged: rejected groups decrement accepted-plus-pending coverage, and the configured refill granularity restores it.

Validation

  • python tests/test_sglang_rollout_abort.py -q — 4 passed
  • focused Python 3.10 suite — 33 passed
  • python .github/workflows/generate_github_workflows.py
  • pre-commit run --all-files
  • git diff --check

No live GPU or distributed rollout was run; the affected lifecycle boundaries are covered with CPU and mocked regressions.

Allow positive refill sizes smaller than the target rollout batch, and cancel unfinished non-partial generation tasks before waiting for SGLang to drain. This prevents one rejected prompt group from launching a full replacement wave or keeping the drain loop alive through new agent turns.

Make the complete abort lifecycle exception-safe: failures during worker discovery, server drain, or partial collection cancel and await remaining groups before the original failure is re-raised.
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.

1 participant