Skip to content

Move fully-async rollout from examples into miles/rollout - #1716

Merged
yueming-yuan merged 1 commit into
mainfrom
yueming/fully-async-to-core
Jul 31, 2026
Merged

Move fully-async rollout from examples into miles/rollout#1716
yueming-yuan merged 1 commit into
mainfrom
yueming/fully-async-to-core

Conversation

@yueming-yuan

Copy link
Copy Markdown
Collaborator

Motivation

Fully-async rollout is used by production runs (the swe-agent-v2 GLM-4.7 async scripts) but its implementation lives in examples/fully_async/, wired up via a PYTHONPATH hack in every launch script. Core arguments it consumes (--max-weight-staleness) are already defined in core arguments.py while their only consumer sits in examples. First step of moving it into the core library.

What this PR does

Pure mechanical move — no logic changes:

  • git mv examples/fully_async/fully_async_rollout.py → miles/rollout/fully_async_rollout.py (100% rename similarity; blame/history preserved).
  • All references switch to --rollout-function-path miles.rollout.fully_async_rollout.generate_rollout_fully_async and the example-dir PYTHONPATH entries are removed: the two qwen launch scripts, the two swe-agent-v2 async scripts (FULLY_ASYNC_DIR hack deleted), and the docs pages that referenced the old path.
  • examples/fully_async/ keeps the launch scripts + README, now pointing at the core module.

A follow-up PR (stacked) rewrites the module on the class-based rollout API.

Testing

Pure rename + path updates; pre-commit run --all-files passes. The moved module is import-compatible (same content, same imports).

🤖 Generated with Claude Code

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request moves the fully_async_rollout.py module from the examples directory to the core library at miles/rollout/fully_async_rollout.py, updating all corresponding documentation, scripts, and launch configurations. The reviewer identified a potential ModuleNotFoundError in run_qwen3_30b_a3b_fully_async.py due to the omission of the repository root from PYTHONPATH after removing the local directory, and provided a code suggestion to resolve it.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 159 to 163
extra_env_vars={
"FLASHINFER_DISABLE_VERSION_CHECK": "1",
"PYTHONPATH": f"{args.megatron_path}:{fully_async_dir}",
"PYTHONPATH": args.megatron_path,
},
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Omitting the repository root (U.repo_base_dir) from PYTHONPATH can lead to a ModuleNotFoundError when attempting to import miles (such as miles.rollout.fully_async_rollout) if the script is executed from a different directory or in environments where the package is not installed globally. Adding U.repo_base_dir to PYTHONPATH ensures consistency with other launch scripts and prevents potential import issues.

Suggested change
extra_env_vars={
"FLASHINFER_DISABLE_VERSION_CHECK": "1",
"PYTHONPATH": f"{args.megatron_path}:{fully_async_dir}",
"PYTHONPATH": args.megatron_path,
},
)
extra_env_vars={
"FLASHINFER_DISABLE_VERSION_CHECK": "1",
"PYTHONPATH": f"{args.megatron_path}:{U.repo_base_dir}",
},
)

- python3 train.py ...
+ python3 train_async.py ...
+ --rollout-function-path fully_async_rollout.generate_rollout_fully_async
+ --rollout-function-path miles.rollout.fully_async_rollout.generate_rollout_fully_async

@guapisolo guapisolo Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we directly add a args --fully-async to make sure all user know there is a fully async example.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we need to add a fully async CI on dapo math, will submit a PR later.

@yueming-yuan
yueming-yuan force-pushed the yueming/fully-async-to-core branch from 86f7b4e to b24c9dd Compare July 29, 2026 01:46
@guapisolo

Copy link
Copy Markdown
Collaborator

I suggest we directly add a args --fully-async to make sure all user know there is a fully async example.

I am let codex doing this.

@guapisolo

Copy link
Copy Markdown
Collaborator

Submitted to #1924 stack on #1782 to avoid cascade rebase

@guapisolo guapisolo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle fully async flag name in later PR. So approve this as-is.

@yueming-yuan
yueming-yuan force-pushed the yueming/fully-async-to-core branch from b24c9dd to fa6d503 Compare July 30, 2026 02:09
@yueming-yuan
yueming-yuan merged commit 6fe5e6c into main Jul 31, 2026
41 checks passed
@yueming-yuan
yueming-yuan deleted the yueming/fully-async-to-core branch July 31, 2026 21:28
Zhichenzzz added a commit that referenced this pull request Aug 3, 2026
…izer refactors

The launcher predates two main-side moves: #1716 replaced the
examples/fully_async module with miles.rollout.fully_async_rollout
(selected by --fully-async + MILES_EXPERIMENTAL_ROLLOUT_REFACTOR=1), and
the NVMe optimizer streaming merged as --stream-optimizer-state-to-disk /
--offload-train-disk-dir rather than --optimizer-state-nvme-dir. Point the
script at the current interfaces and drop the stale knob from run_inkling.
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