Move fully-async rollout from examples into miles/rollout - #1716
Conversation
There was a problem hiding this comment.
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.
| extra_env_vars={ | ||
| "FLASHINFER_DISABLE_VERSION_CHECK": "1", | ||
| "PYTHONPATH": f"{args.megatron_path}:{fully_async_dir}", | ||
| "PYTHONPATH": args.megatron_path, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
I suggest we directly add a args --fully-async to make sure all user know there is a fully async example.
There was a problem hiding this comment.
Also we need to add a fully async CI on dapo math, will submit a PR later.
86f7b4e to
b24c9dd
Compare
I am let codex doing this. |
guapisolo
left a comment
There was a problem hiding this comment.
Handle fully async flag name in later PR. So approve this as-is.
b24c9dd to
fa6d503
Compare
…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.
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 corearguments.pywhile 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).--rollout-function-path miles.rollout.fully_async_rollout.generate_rollout_fully_asyncand the example-dir PYTHONPATH entries are removed: the two qwen launch scripts, the two swe-agent-v2 async scripts (FULLY_ASYNC_DIRhack 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-filespasses. The moved module is import-compatible (same content, same imports).🤖 Generated with Claude Code