Skip to content

Select fully async rollout with --fully-async - #1924

Merged
yueming-yuan merged 1 commit into
yueming/fully-async-class-apifrom
review/pr-1716-fully-async-flag
Jul 30, 2026
Merged

Select fully async rollout with --fully-async#1924
yueming-yuan merged 1 commit into
yueming/fully-async-class-apifrom
review/pr-1716-fully-async-flag

Conversation

@guapisolo

@guapisolo guapisolo commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Selecting the fully async rollout should be part of the argument surface, not an environment variable. The previous approach (MILES_FULLY_ASYNC=1) rewrote sys.argv before parse_args() to inject --rollout-function-path, which meant a hand-rolled argparse prefix matcher to detect conflicts, validation split across two entrypoints, and configuration that never appears in --help or in the logged config table.

Retargeted onto #1717 (fully-async rewritten as FullyAsyncRolloutFn).

What this PR does

Adds --fully-async, resolved in miles_validate_args where the rest of the cross-argument checks already live:

- python3 train.py ...
+ MILES_EXPERIMENTAL_ROLLOUT_REFACTOR=1 python3 train_async.py ...
+   --fully-async

_validate_fully_async(args) asserts:

  • class-based rollout API requiredMILES_EXPERIMENTAL_ROLLOUT_REFACTOR=1, otherwise the class entry point cannot be loaded at all;
  • no simultaneous --rollout-function-path — detected by comparing against default_rollout_function_path() (the default is now a named helper instead of an inline conditional), so no argv scanning;
  • no --colocate — the async driver rejects colocation, and failing at argument time beats failing after the placement group is built.

It then sets rollout_function_path, and points eval_function_path at the standard inference rollout unless the user set it explicitly — FullyAsyncRolloutFn raises on eval, and eval otherwise inherits the rollout path. That makes the flag a complete switch: the launch scripts and the e2e harness no longer spell out two function paths by hand.

train.py asserts the flag is off, so choosing the wrong driver fails loudly instead of silently running synchronously.

Testing

Launch scripts, docs, and the 30B fully-async e2e case (#1717) converted to the flag, so the e2e run exercises it end to end. pre-commit run --all-files passes.

🤖 Generated with Claude Code

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@guapisolo
guapisolo marked this pull request as draft July 29, 2026 03:47
@yueming-yuan yueming-yuan changed the title feat: select fully async rollout with MILES_FULLY_ASYNC Select fully async rollout with --fully-async Jul 30, 2026
@yueming-yuan
yueming-yuan force-pushed the review/pr-1716-fully-async-flag branch from 6005e24 to 382c92f Compare July 30, 2026 01:04
@yueming-yuan
yueming-yuan changed the base branch from yueming/fully-async-eval-backend-refactor to yueming/fully-async-class-api July 30, 2026 01:04
@yueming-yuan
yueming-yuan force-pushed the review/pr-1716-fully-async-flag branch from 382c92f to b63a7e9 Compare July 30, 2026 01:10
Rollout selection belongs in the argument surface, not in an environment
variable that rewrites sys.argv before parsing.

--rollout-function-path now defaults to None, so "the user chose one" is a
plain is-None check instead of a comparison against a computed default, and
resolve_rollout_function_path() is the single place that maps arguments to a
rollout function. miles_validate_args rejects the configurations that cannot
work: no class-based rollout API, a competing --rollout-function-path, or
--colocate, which the async driver cannot honor. Evaluation keeps the standard
rollout function, since fully async does not serve eval.

train.py asserts the flag is off, so picking the wrong driver fails loudly.

Co-authored-by: yueming-yuan <yym022502@gmail.com>
@yueming-yuan
yueming-yuan force-pushed the review/pr-1716-fully-async-flag branch from b63a7e9 to 32fe00b Compare July 30, 2026 01:17
@yueming-yuan
yueming-yuan marked this pull request as ready for review July 30, 2026 01:43
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@yueming-yuan
yueming-yuan merged commit 67c5ca8 into yueming/fully-async-class-api Jul 30, 2026
31 of 41 checks passed
@yueming-yuan
yueming-yuan deleted the review/pr-1716-fully-async-flag branch July 30, 2026 02:01
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.

2 participants