Coding agents tasked with real software-engineering workloads often run rollouts that consume hours, hundreds of model and tool turns, and close to 1M tokens. This "XLong-horizon" regime is becoming the central bottleneck of agentic RL. GPUs sit idle waiting for the slowest rollout, or pile up empty bubbles of compute. Meanwhile, agents that mimic Claude Code compress context, spawn sub-agents and retry mid-run, so a single execution turns into a branching tree of shared-prefix trajectories, which explodes memory and compute if fully expanded. Alibaba's Qwen team just released QwenGyre to address both problems head-on.

Elastic scheduling: hardware follows the work

QwenGyre splits multi-node GPUs into cells that share a training layout. Each cell can either serve rollouts on SGLang or run a full training step on Megatron. A core cell owns the authoritative weights and optimizer state; satellite cells serve rollouts by default and switch into the training role as soon as the scheduler judges that the remaining cells still cover all live requests.

The switch does not require the agent to cooperate. Every model call is routed through a proxy, and the proxy migrates KV-cache blocks over RDMA so prefix reuse stays high. Mooncake's Transfer Engine pulls core weights into a satellite so it can join an ongoing batch, and streaming training lets cells claim micro-steps as data lands. Average role switches took 8.52 seconds (rollout to training) and 3.46 seconds (training to rollout) in the team's runs.

End-to-end speedups came in cleanly. Under matched GPU budgets and staleness, three benchmarks ran on Qwen 3.6 122B and Qwen 3.8 2.4T models: 1.38x–1.78x over an Async setup, and 1.21x–1.85x over a Colocate setup, with TerminalBench hitting the top 1.85x.

Trajectory processor: bounded samples out of a branching tree

Elastic scheduling fixes GPU utilization; the trajectory processor fixes training-sample explosion. At the proxy layer, QwenGyre uses token-in/token-out (TITO) to capture token IDs and the policy's behavior log-probs, and stores each execution as a prefix-shared trajectory tree.

Notably, timeouts and evaluator errors are not punished as zero reward. A rollout that times out but whose workspace survives is still scored on the preserved state, and an evaluator crash causes the sample to be dropped rather than poisoning the gradient. Each execution keeps at most 5 trajectories, ranked main > main-summary > sub-agent > sub-agent-summary; shared targets are deduplicated, and only tokens the policy actually emitted contribute to the loss. Losses are averaged within each execution so expanding a tree does not silently inflate its weight.

Constraining the cap to 5 preserved matched training scores from the uncapped run while cutting forward-backward time by 25.2%.

Real results on Qwen 3.8 2.4T

The 2.4T run is the most telling. Over 48 training steps, QwenGyre finished in 75.42 hours versus 134.55 hours for Async and 91.47 hours for Colocate, while lifting NL2RepoBench pass rate from 52.48% to 58.54% — about 5.4 hours per percentage point, marginal cost that is hard to imagine on a 2.4T MoE. Training used an adapted GSPO objective with 16 rollouts per group.

Set against veRL, AReaL and Microsoft's Agent Lightning, QwenGyre is the framework that pulls exclusive elastic GPU scheduling into agent training and aggressively bounds branched trajectories. It is also the only one publishing comparable end-to-end numbers at the 2.4T scale. For teams trying to train agents that can really carry hours of coding or ops work, the question is no longer whether this is an optimization — it is whether the model can be trained at all.