Track X · Agent RL Frameworks · 06/07

비동기 RL 시스템 비교 — staleness, 가중치 동기화, partial rolloutAsynchronous RL systems compared — staleness, weight sync, partial rollouts

동기 RL이 긴 꼬리 때문에 GPU를 놀리는 이유를 수식과 이산 사건 시뮬레이터로 보이고, one-step-off·fully async(staleness 상한)·partial rollout을 같은 GPU 예산에서 비교한다. 이어서 verl(V1 async trainer와 fully_async 레시피), AReaL, slime, prime-rl, SkyRL, OpenRLHF, ROLL이 staleness를 어떻게 묶고 가중치를 어떻게 동기화하는지 현재 코드 기준으로 정리한다.Why synchronous RL idles its GPUs on the long tail, shown with equations and a discrete-event simulator; one-step-off, fully async with a staleness bound, and partial rollouts compared on one GPU budget. Then how verl (V1 async trainer and the fully_async recipe), AReaL, slime, prime-rl, SkyRL, OpenRLHF and ROLL bound staleness and sync weights, checked against their current code.

verl’s lesson introduced its sync and async trainers; async and staleness treats the algorithmic side — what off-policy data does to the gradient and how labs correct for it. This lesson is the systems view: where the idle time in synchronous RL comes from, what each asynchronous design buys and costs, and how seven current frameworks implement the three mechanisms that matter — a staleness bound, weight synchronisation, and partial rollouts. Framework facts were checked against their default branches on 2026-12-02/03: verl 4525109 (0.10.0.dev; the fully-async recipe now lives in verl-recipe, pinned to verl v0.9.1), AReaL v2.1.1, slime v0.4.0, prime-rl v0.11.0, SkyRL 0.5.0, OpenRLHF v0.12.0, ROLL v0.4.0.

Where synchronous RL loses time

A synchronous step generates a batch of BB trajectories with the current weights, waits for all of them, trains, and syncs:

tstepsync=max⁡i≤B ℓi/v⏟generation: the slowest trajectory+ttrain+tsync+tswitch.t_{\text{step}}^{\text{sync}}=\underbrace{\max_{i\le B}\,\ell_i/v}_{\text{generation: the slowest trajectory}}+t_{\text{train}}+t_{\text{sync}}+t_{\text{switch}} .

If decoding streams are not saturated, generation time is set by the maximum length, not the mean. For log-normal lengths with spread σ\sigma, the maximum of BB draws sits near exp⁡(μ+σ2ln⁡B)\exp(\mu+\sigma\sqrt{2\ln B}), so with mean 1 and σ=1\sigma=1, B=256B=256, the slowest trajectory is about 12 times the mean (the NumPy run below measures 12.5). During that tail most decode streams are idle: the busy fraction of rollout capacity is roughly ℓˉ/max⁡iℓi\bar\ell/\max_i\ell_i. Reasoning and agent workloads make this worse — response lengths span orders of magnitude, and agent trajectories add tool latency (next lesson).

There are only a few ways out:

  • Overlap generation and training on disjoint GPUs: one-step-off (Noukhovitch et al.) trains batch kk while generating batch k+1k+1 with weights one version old.
  • Decouple completely (AReaL): rollout workers never wait; the trainer takes whatever has finished; a staleness bound keeps data from getting too old.
  • Stop waiting for the tail: partial rollouts interrupt unfinished trajectories at a weight update and continue them later (Kimi k1.5’s token budget, AReaL’s interruptible generation), or over-sample and abort stragglers (verl’s rollout.over_sample_rate).

The figure below runs a small discrete-event model of these options on one budget of 16 GPUs. It is a teaching model — constant per-stream decode speed, training cost linear in batch size — but its qualitative behaviour matches the published systems.

verl 레슨은 verl의 동기·비동기 trainer를 소개했고, 비동기와 staleness는 알고리즘 쪽 — off-policy 데이터가 gradient에 무슨 일을 하고 연구실들이 어떻게 보정하는지 — 를 다룬다. 이 레슨은 시스템 관점이다. 동기 RL의 유휴 시간이 어디서 오는지, 각 비동기 설계가 무엇을 얻고 무엇을 치르는지, 그리고 현재의 프레임워크 일곱 개가 중요한 세 메커니즘 — staleness 상한, 가중치 동기화, partial rollout — 을 어떻게 구현하는지 본다. 프레임워크 사실은 2026-12-02/03 기준 기본 브랜치와 대조했다. verl 4525109(0.10.0.dev, fully-async 레시피는 이제 verl v0.9.1에 고정된 verl-recipe에 있다), AReaL v2.1.1, slime v0.4.0, prime-rl v0.11.0, SkyRL 0.5.0, OpenRLHF v0.12.0, ROLL v0.4.0.

동기 RL은 어디서 시간을 잃는가

동기 스텝은 현재 가중치로 trajectory BB개를 생성하고, 전부 끝나기를 기다린 뒤 학습하고 동기화한다.

tstepsync=max⁡i≤B ℓi/v⏟생성: 가장 느린 trajectory+ttrain+tsync+tswitch.t_{\text{step}}^{\text{sync}}=\underbrace{\max_{i\le B}\,\ell_i/v}_{\text{생성: 가장 느린 trajectory}}+t_{\text{train}}+t_{\text{sync}}+t_{\text{switch}} .

decode stream이 포화되지 않았다면 생성 시간은 평균이 아니라 최대 길이가 정한다. 퍼짐 σ\sigma인 로그정규 길이에서 BB개 중 최댓값은 대략 exp⁡(μ+σ2ln⁡B)\exp(\mu+\sigma\sqrt{2\ln B}) 근처에 있어, 평균 1, σ=1\sigma=1, B=256B=256이면 가장 느린 trajectory가 평균의 약 12배다(아래 NumPy 실행은 12.5를 잰다). 그 꼬리 동안 decode stream 대부분이 논다. rollout 용량 중 바쁜 비율은 대략 ℓˉ/max⁡iℓi\bar\ell/\max_i\ell_i다. 추론과 agent 작업은 이것을 더 악화시킨다. 응답 길이가 여러 자릿수에 걸치고, agent trajectory에는 tool 지연이 더해진다(다음 레슨).

빠져나갈 길은 몇 가지뿐이다.

  • 생성과 학습을 겹친다(서로 다른 GPU에서). one-step-off(Noukhovitch et al.)는 한 버전 낡은 가중치로 배치 k+1k+1을 생성하면서 배치 kk를 학습한다.
  • 완전히 분리한다(AReaL). rollout worker는 기다리지 않고, 학습기는 끝난 것을 가져가며, staleness 상한이 데이터가 너무 낡지 않게 한다.
  • 꼬리를 기다리지 않는다. partial rollout은 가중치 업데이트 때 끝나지 않은 trajectory를 중단했다가 나중에 이어 간다(Kimi k1.5의 토큰 예산, AReaL의 interruptible generation). 또는 과다 샘플링 후 낙오자를 abort한다(verl의 rollout.over_sample_rate).

아래 그림은 GPU 16개라는 하나의 예산에서 이 선택지들을 작은 이산 사건 모델로 돌린다. 교육용 모델이다 — stream당 decode 속도는 일정하고 학습 비용은 배치 크기에 선형이다 — 하지만 정성적 동작은 발표된 시스템들과 맞는다.

처리량throughput – traj/t GPU util: rollout – · trainer – · 전체all – staleness 평균mean – · max – · >η –
16 GPUs, 256 trajectories per step, log-normal lengths (mean 1 time unit). Top: fraction of rollout decode streams busy; bottom: trainer lane (train, weight sync, engine switch). Right: staleness of consumed trajectories (version lag of the first token). In sync mode the long tail leaves most streams idle. One-step-off overlaps generation and training at staleness exactly 1. Fully async admits work under the AReaL rule; untick partial rollout to see the drain bubble before every sync, tick it to see trajectories that outlive η. Move the GPU split to find where the trainer, not rollout, becomes the bottleneck. GPU 16개, 스텝당 trajectory 256개, 로그정규 길이(평균 1 시간 단위). 위: rollout decode stream 중 바쁜 비율. 아래: 학습기 레인(학습, 가중치 동기화, 엔진 전환). 오른쪽: 소비된 trajectory의 staleness(첫 토큰의 버전 차). sync 모드에서는 긴 꼬리 때문에 stream 대부분이 논다. one-step-off는 staleness를 정확히 1로 두고 생성과 학습을 겹친다. fully async는 AReaL 규칙으로 작업을 받는다. partial rollout을 끄면 동기화마다 drain 거품이 생기고, 켜면 η보다 오래 사는 trajectory가 보인다. GPU 분할을 옮겨 rollout이 아니라 학습기가 병목이 되는 지점을 찾아보자.

The admission rule, and what it does not bound

Let vv be the trainer’s current version (number of completed updates), BB the trajectories consumed per update, NaccN_{\text{acc}} the trajectories finished so far and NrunN_{\text{run}} those in flight. AReaL’s StalenessManager (and SkyRL’s copy of it) admits a new rollout only while

Nacc+Nrun<(η+v+1) BandNrun<max_concurrent_rollouts,N_{\text{acc}}+N_{\text{run}}<(\eta+v+1)\,B\quad\text{and}\quad N_{\text{run}}<\text{max\_concurrent\_rollouts},

with η\eta = rollout.max_head_offpolicyness (default 0 = synchronous). Why this bounds staleness: a rollout admitted at version v0v_0 is among the first (η+v0+1)B(\eta+v_0+1)B rollouts ever admitted. If rollouts are consumed roughly in admission order, it is consumed by update v0+ηv_0+\eta at the latest, so its lag v−v0≤ηv-v_0\le\eta. That proof has a hidden assumption — consumption in admission order — and two things break it: out-of-order completion (a long trajectory finishes after many short ones admitted later) and partial rollouts (a trajectory keeps running across updates). In the figure, untick partial rollout: the trainer must drain all in-flight work before each sync, lag never exceeds η, and the drain bubble costs throughput. Tick it: throughput jumps, the mean lag is still ≈ η, but the histogram grows a red tail beyond η — trajectories admitted long ago that were still running.

That is exactly why the systems differ in what they bound:

  • Count-based admission (AReaL, SkyRL, verl’s fully-async recipe) bounds how much work exists per version; it does not bound one trajectory’s lifetime. SkyRL documents this honestly: over-stale groups are still trained and counted in async/staleness_violation_count; dropping them is “not supported yet”.
  • Per-token version labels bound what is trained: prime-rl labels each token with the policy version that sampled it and masks tokens older than orchestrator.max_staleness (default 8) from every loss term; AReaL’s optional rollout.mask_stale_tokens does the same against η.
  • Per-trajectory age limits bound what is kept: verl’s V1 sampler evicts (drop) or waits for (wait) prompt groups older than trainer.v1.sampler.max_off_policy_threshold (default 8) model versions, counted from first generation; prime-rl’s strict_staleness drops whole rollouts whose dispatch version is too old, because a fresh token still attends to KV computed by old weights.

Partial rollouts: abort-and-resume vs keep

At a weight update, an in-flight request can be handled in two ways:

abort and resumekeep (pause in place)
mechanismabort, return partial tokens + log-probs, resubmit prompt + prefix with the remaining budgetfreeze requests in the scheduler, swap weights, continue
prefix KVrecomputed by the new weights (extra prefill)computed by the old weights (stale KV)
used byverl V1 (FullyAsyncLLMServerClient retries aborted requests; prefix re-prefilled), AReaL (SGLang abort, then resubmit), slime --flush-cache-interval 1, ROLL RLVRprime-rl (vLLM pause_generation(mode="keep")), SkyRL fully async (KEEP pause), OpenRLHF --train.partial_rollout_enable, slime --flush-cache-interval ≤ 0 (in place)

Either way the trajectory is generated by several policy versions, and the recorded per-token log-probs are those of the version that sampled each token. This is why per-token rollout correction (previous lesson) is the natural partner: its ratio πtrain(yt)/πrollout(yt)\pi_{\text{train}}(y_t)/\pi_{\text{rollout}}(y_t) uses each token’s own behaviour probability. verl exposes the spread as training/off_policy/trajectory_spans/*; the legacy recipe as fully_async/partial/max_partial_span.

The sweep: η buys staleness, not speed

입장 규칙, 그리고 그것이 묶지 않는 것

학습기의 현재 버전(완료된 업데이트 수)을 vv, 업데이트당 소비하는 trajectory 수를 BB, 지금까지 끝난 trajectory 수를 NaccN_{\text{acc}}, 진행 중인 것을 NrunN_{\text{run}}이라 하자. AReaL의 StalenessManager(그리고 그것을 옮긴 SkyRL)는 다음이 성립할 때만 새 rollout을 받는다.

Nacc+Nrun<(η+v+1) B그리고Nrun<max_concurrent_rolloutsN_{\text{acc}}+N_{\text{run}}<(\eta+v+1)\,B\quad\text{그리고}\quad N_{\text{run}}<\text{max\_concurrent\_rollouts}

여기서 η\eta = rollout.max_head_offpolicyness(기본 0 = 동기)다. 이것이 staleness를 묶는 이유: 버전 v0v_0에서 들어온 rollout은 지금까지 들어온 처음 (η+v0+1)B(\eta+v_0+1)B개 안에 있다. rollout이 대략 들어온 순서대로 소비된다면 늦어도 업데이트 v0+ηv_0+\eta에서 소비되므로 lag v−v0≤ηv-v_0\le\eta다. 이 증명에는 숨은 가정 — 들어온 순서대로 소비 — 이 있고, 두 가지가 그것을 깬다. 순서가 뒤바뀐 완료(나중에 들어온 짧은 것들 뒤에 긴 trajectory가 끝난다)와 partial rollout(trajectory가 업데이트를 가로질러 계속 돈다)이다. 그림에서 partial rollout을 끄면 학습기는 동기화 전마다 진행 중인 작업을 모두 drain해야 하고, lag는 η를 넘지 않으며, drain 거품이 처리량을 깎는다. 켜면 처리량이 뛰고 평균 lag는 여전히 ≈ η이지만, 히스토그램에 η 너머의 빨간 꼬리가 자란다. 오래전에 들어와 아직 돌던 trajectory들이다.

시스템들이 무엇을 묶는지가 갈리는 이유가 바로 이것이다.

  • 개수 기반 입장(AReaL, SkyRL, verl fully-async 레시피)은 버전당 존재하는 작업량을 묶을 뿐, trajectory 하나의 수명은 묶지 않는다. SkyRL은 이것을 솔직하게 문서화한다. 너무 낡은 group도 여전히 학습되고 async/staleness_violation_count로 세어지며, 버리는 기능은 “아직 지원하지 않는다”.
  • 토큰별 버전 라벨은 학습되는 것을 묶는다. prime-rl은 토큰마다 그것을 샘플한 정책 버전을 붙이고 orchestrator.max_staleness(기본 8)보다 낡은 토큰을 모든 손실 항에서 mask한다. AReaL의 선택 옵션 rollout.mask_stale_tokens도 η에 대해 같은 일을 한다.
  • trajectory별 나이 제한은 남기는 것을 묶는다. verl V1 sampler는 첫 생성부터 센 모델 버전이 trainer.v1.sampler.max_off_policy_threshold(기본 8)를 넘은 prompt group을 버리거나(drop) 기다린다(wait). prime-rl의 strict_staleness는 dispatch 버전이 너무 낡은 rollout을 통째로 버린다. 새 토큰도 옛 가중치가 계산한 KV를 attend하기 때문이다.

Partial rollout: abort 후 재개 vs keep

가중치 업데이트 때 진행 중인 요청은 두 방식으로 다룰 수 있다.

abort 후 재개keep (제자리 일시정지)
방식abort하고 부분 토큰 + log-prob을 돌려받아, prompt + prefix를 남은 예산으로 다시 제출scheduler 안에서 요청을 얼리고 가중치를 바꾼 뒤 계속
prefix KV새 가중치로 다시 계산(추가 prefill)옛 가중치로 계산된 것(stale KV)
쓰는 곳verl V1(FullyAsyncLLMServerClient가 abort된 요청을 재시도, prefix를 다시 prefill), AReaL(SGLang abort 후 재제출), slime --flush-cache-interval 1, ROLL RLVRprime-rl(vLLM pause_generation(mode="keep")), SkyRL fully async(KEEP pause), OpenRLHF --train.partial_rollout_enable, slime --flush-cache-interval ≤ 0(in place)

어느 쪽이든 trajectory는 여러 정책 버전이 생성하고, 기록된 토큰별 log-prob은 각 토큰을 샘플한 버전의 것이다. 그래서 토큰 단위 rollout correction(이전 레슨)이 자연스러운 짝이다. 그 ratio πtrain(yt)/πrollout(yt)\pi_{\text{train}}(y_t)/\pi_{\text{rollout}}(y_t)는 토큰마다 자기 behaviour 확률을 쓴다. verl은 이 퍼짐을 training/off_policy/trajectory_spans/*로, 레거시 레시피는 fully_async/partial/max_partial_span으로 보여 준다.

Sweep: η는 속도가 아니라 staleness를 산다

Left: throughput against the staleness bound η for fully-async with partial rollout and with drain-before-sync; dashed lines are colocated sync (black) and one-step-off (violet). Right: mean (solid) and maximum (dotted) first-token lag; the grey diagonal is lag = η. Notice that throughput saturates after η ≈ 1–2 once the trainer is the bottleneck, so a large η buys staleness, not speed; and that with partial rollouts the maximum lag exceeds η, because the admission rule bounds how many trajectories exist, not how long one of them lives. Raise the sync cost to see why drain mode suffers more. 왼쪽: staleness 상한 η에 따른 처리량. fully async를 partial rollout으로 돌릴 때와 동기화 전 drain으로 돌릴 때. 점선은 colocated sync(검정)와 one-step-off(보라). 오른쪽: 첫 토큰 lag의 평균(실선)과 최댓값(점선), 회색 대각선은 lag = η. 볼 것: 학습기가 병목이 되면 처리량은 η ≈ 1–2에서 포화하므로 큰 η는 속도가 아니라 staleness만 산다. 그리고 partial rollout에서는 최대 lag가 η를 넘는다. 입장 규칙은 trajectory가 몇 개 존재하는지를 묶을 뿐, 하나가 얼마나 오래 사는지는 묶지 않기 때문이다. 동기화 비용을 올리면 drain 모드가 왜 더 손해인지 보인다.

Two regimes show up as soon as you move the GPU split. While rollout is the bottleneck (few rollout GPUs), a larger η lets the rollout side run further ahead and fill the tail, so throughput rises with η. Once the trainer is the bottleneck, throughput is pinned at B/(ttrain+tsync)B/(t_{\text{train}}+t_{\text{sync}}) and extra η only adds lag. The verl recipe’s tuning advice says the same in operational terms: balance rollout and trainer resources first (watch rollouter/idle_ratio vs trainer/idle_ratio), keep staleness_threshold below 1. The slime docs give the analytic version of the ceiling: speedup ≲(tR+tT+tW)/(max⁡(tR,tT)+tW)\lesssim(t_R+t_T+t_W)/(\max(t_R,t_T)+t_W) for rollout, train and weight-update times — overlap can at best hide the shorter of the two phases.

What the systems actually do (Dec 2026)

systemmodesstaleness controlin-flight requests at a weight updateweight sync
verl V1 trainer (main)trainer.v1.trainer_mode: sync, colocate_async, separate_async (+ optional hybrid replicas lent to rollout, enable_switch)max_off_policy_threshold (8 versions, from first generation) with drop (evict + refill one prompt) or wait; prompts dispatched ahead = num_warmup_batches × train batchabort → retry with retained tokens/log-probs, prefix re-prefilledcheckpoint engine; separate_async needs a non-naive backend (nccl, nixl, mooncake; others include delta_sharded); parameter_sync_step mini-batches per sync
verl fully_async_policy (verl-recipe, v0.9.1)separate Rollouter / Trainer, streaming one sample at a timestaleness_threshold S: at most (1+S)⋅T⋅R⋅Bmini(1+S)\cdot T\cdot R\cdot B_{\text{mini}} samples per sync window (TT = trigger_parameter_sync_step, RR = require_batches)partial_rollout: sleep/resume keeps partial samples; otherwise wait for active tasksNCCL (checkpoint-engine style)
AReaL v2.1.1max_head_offpolicyness 0 = sync, >0 = asyncadmission rule above; optional mask_stale_tokensalways interruptible: abort, resubmit with prefix, tokens tagged with versionsweight_update_mode: xccl (bucketed NCCL, default), disk, awex
slime v0.4.0--colocate or disaggregated; fully-async rollout functionno hard bound — staleness is measured and logged; backpressure via --sglang-server-concurrency and the output queue--flush-cache-interval: 1 = abort, flush, requeue; ≤0 = pause in placeNCCL (disaggregated), CUDA IPC (colocated), disk; --update-weight-mode delta
prime-rl v0.11.0always disaggregated, one step overlapped (TARGET_LAG = 1 dispatch gate)per-token max_staleness (8) masks old tokens; strict_staleness drops whole rolloutsvLLM keep-mode pause; prefix cache salted per versionfilesystem, nccl, modelexpress (NIXL)
SkyRL 0.5.0colocated sync, one-step-off example, trainer.fully_async.enabledAReaL-style admission with max_staleness_steps (4); violations logged, not droppedKEEP pause; clear_kv_cache_on_weight_sync off by defaultCUDA IPC (colocated) / NCCL; delta via shared storage
OpenRLHF v0.12.0hybrid engine (sync) or --train.async_enablequeue backpressure: --train.async_queue_size (1) batches ahead--train.partial_rollout_enable: vLLM keep-mode pausevLLM weight-transfer API: IPC (hybrid) / NCCL
ROLL v0.4.0sync when colocated; async_generation_ratio > 0 when separatedgroups older than the ratio (in steps) are aborted / droppedRLVR: abort and resume with kept tokens; agentic: the turn is regeneratedCUDA IPC (colocated) / NCCL broadcast

Reported speedups, with their setups: the verl V1 benchmark (Qwen3.5-35B-A3B, Megatron + vLLM, 4 nodes, 32k responses) took 22.79 h for 150 steps sync vs 14.72 h colocate_async and 14.10 h separate_async; the verl fully-async recipe reports 2.35–2.67× on 128 GPUs for Qwen2.5-Math-7B with staleness 0.5 and partial rollout; AReaL’s v0.3 blog reports 41.0 h → 14.8 h (1.5B, 16 nodes) and 57.7 h → 25.4 h (7B, 24 nodes) for 1000 PPO steps at unchanged AIME24; SkyRL measures 23–35% shorter steps for colocated partial rollouts on Qwen3-4B. None of these are comparable to each other: different models, lengths and baselines.

Weight sync arithmetic

A full sync moves 2P2P bytes for PP BF16 parameters to every rollout replica; with a broadcast tree the trainer-side cost is roughly 2P/BW2P/\text{BW}. For P=32×109P=32\times10^9 that is 64 GB — about 1.3 s at an assumed 50 GB/s effective bandwidth, 6.4 s at 10 GB/s (estimates). In a synchronous colocated loop this is pure stall; in an async loop it stalls in-flight decoding (keep mode) or forces an abort (abort mode), and in drain mode it is preceded by the tail. Three lines of work shrink it: bucketed, pipelined broadcast (AReaL’s 1 GB chunks, slime’s 512 MiB buffers, verl’s checkpoint engines in the style of Moonshot’s checkpoint-engine), delta sync (verl’s delta_sharded sends only changed elements; its doc reports ~1–3% of BF16 parameter bytes change per step and a 1.3–21× win over the full broadcast from 0.5B to 235B), and relay tiers that let rollouts pull weights without stalling the trainer (Laminar). Raise the sync cost in the sweep to see how quickly it eats the async gain in drain mode.

NumPy Discrete-event model: sync vs one-step-off vs fully async
import numpy as np, heapq

N, C, B, ALPHA, T_SYNC, T_SWITCH = 16, 16, 256, 0.25, 0.3, 0.3   # GPUs, streams/GPU, batch, train cost, sync, switch

def lengths(sigma, n, seed=3):
    return np.random.default_rng(seed).lognormal(-sigma**2 / 2, sigma, n)   # mean 1

def makespan(lens, M, t0):
    """List-schedule jobs on M identical streams starting at t0; return (finish time, busy stream-time)."""
    free = [t0] * M; heapq.heapify(free)
    for l in lens:
        heapq.heappush(free, heapq.heappop(free) + l)
    return max(free), float(np.sum(lens))

def sim_sync(L, steps):
    t, busy = 0.0, 0.0
    for k in range(steps):
        end, b = makespan(L[k*B:(k+1)*B], N*C, t); busy += b
        t = end + T_SWITCH + ALPHA*B/N + T_SYNC
    return dict(thr=steps*B/t, util=(busy/C + steps*ALPHA*B)/(N*t), lag=np.zeros(steps*B))

def sim_oneoff(L, steps, Gr):
    Gt = N - Gr; gen_end, train_end, ready, busy = 0.0, 0.0, [0.0], 0.0
    for k in range(steps):
        start = max(gen_end, ready[max(0, k-1)])          # batch k uses weights v = k-1
        gen_end, b = makespan(L[k*B:(k+1)*B], Gr*C, start); busy += b
        train_end = max(gen_end, train_end) + ALPHA*B/Gt + T_SYNC
        ready.append(train_end)
    lag = np.r_[np.zeros(B), np.ones((steps-1)*B)]
    return dict(thr=steps*B/train_end, util=(busy/C + steps*ALPHA*B)/(N*train_end), lag=lag)

def sim_async(L, steps, Gr, eta, partial):
    """AReaL-style admission: submit while running < M and accepted+running < (eta+v+1)*B."""
    M, Gt = Gr*C, N - Gr
    run, done, lags = [], [], []          # run: heap of (end - shift, start_version)
    v = acc = i = 0; t = shift = busy = 0.0
    trainer_free, state, paused_until, admit = 0.0, 'idle', 0.0, True
    while v < steps:
        if admit and t >= paused_until:
            cap = min(M - len(run), (eta + v + 1)*B - (acc + len(run)))
            for _ in range(max(0, cap)):
                heapq.heappush(run, (t + L[i] - shift, v)); busy += L[i]; i += 1
        cands = [run[0][0] + shift] if run else []
        if state in ('train', 'sync'): cands.append(trainer_free)
        if paused_until > t: cands.append(paused_until)
        t = min(cands)
        while run and run[0][0] + shift <= t + 1e-12:
            done.append(heapq.heappop(run)); acc += 1
        if state in ('train', 'sync') and t >= trainer_free:
            state = 'need_sync' if state == 'train' else 'idle'
        if state == 'need_sync':
            if partial or not run:
                if partial:
                    shift += T_SYNC                     # in-flight streams stall during the update
                admit = True
                paused_until = trainer_free = t + T_SYNC; state = 'sync'; v += 1
                continue
            admit = False                               # drain: stop admitting until in-flight work ends
        if state == 'idle' and len(done) >= B:
            batch, done = done[:B], done[B:]
            lags += [v - r[1] for r in batch]
            trainer_free, state = t + ALPHA*B/Gt, 'train'
    T = trainer_free
    return dict(thr=steps*B/T, util=(busy/C + steps*ALPHA*B)/(N*T), lag=np.array(lags))

steps, Gr = 24, 6
for sigma in [0.4, 1.0]:
    L = lengths(sigma, B*(steps + 12))
    rows = [('sync (colocated)', sim_sync(L, steps)), ('one-step-off', sim_oneoff(L, steps, Gr))]
    for eta in [1, 2, 4]:
        rows.append((f'async eta={eta} drain', sim_async(L, steps, Gr, eta, False)))
        rows.append((f'async eta={eta} partial', sim_async(L, steps, Gr, eta, True)))
    base = rows[0][1]['thr']
    print(f'length tail sigma={sigma}:  max/mean of 256 lengths ~ {np.mean([L[k*B:(k+1)*B].max() for k in range(steps)]):.1f}')
    for name, r in rows:
        print(f"  {name:22s} thr {r['thr']:5.1f} ({r['thr']/base:4.2f}x)  GPU util {r['util']:4.0%}  "
              f"lag mean {r['lag'].mean():4.2f} max {int(r['lag'].max())}")
 

Read the two blocks of output. With a mild tail (σ=0.4\sigma=0.4) everything is within ~10% because generation is short compared with training and asynchrony has little to hide. With a heavy tail (σ=1.0\sigma=1.0, slowest trajectory ≈ 12.5× the mean) synchronous training wastes most of its GPU time; one-step-off and drain-mode async recover the same 1.3×, because both still wait for the slowest trajectory before each update; only interrupting the tail (partial rollout) reaches the trainer-bound ceiling (2.5×) — and that is also the only configuration whose maximum lag exceeds η.

확인 문제Check yourself

Fully async training with partial rollouts and an AReaL-style admission bound η = 2 shows some trajectories with first-token lag 6. Which explanation is right?

The bound Nacc+Nrun<(η+v+1)BN_{\text{acc}}+N_{\text{run}}<(\eta+v+1)B limits the amount of work per version, and implies lag ≤ η only if rollouts are consumed in admission order. With partial rollouts a trajectory survives updates and completes late. Systems that need a hard guarantee add a per-token or per-trajectory rule: prime-rl’s token masking (max_staleness) or strict_staleness, AReaL’s mask_stale_tokens, verl V1’s max_off_policy_threshold with drop/wait.

Summary

  • Synchronous RL waits for the slowest trajectory; with heavy-tailed lengths the slowest is an order of magnitude above the mean and most decode capacity idles.
  • One-step-off and drain-mode async overlap training with generation but still wait for the tail before each sync; partial rollouts (abort-and-resume or keep) remove that wait.
  • AReaL’s admission rule Nacc+Nrun<(η+v+1)BN_{\text{acc}}+N_{\text{run}}<(\eta+v+1)B bounds work per version, not trajectory lifetime; hard guarantees need token masks (prime-rl, AReaL) or age-based drop/wait (verl V1).
  • Once the trainer is the bottleneck, larger η adds staleness without throughput; balance GPUs first.
  • Weight-sync cost scales with 2P2P bytes; bucketed broadcast, delta sync and relay tiers attack it.

GPU 분할을 옮기자마자 두 영역이 드러난다. rollout이 병목인 동안(rollout GPU가 적을 때)에는 η가 클수록 rollout 쪽이 더 앞서 달려 꼬리를 메우므로 처리량이 η와 함께 오른다. 학습기가 병목이 되면 처리량은 B/(ttrain+tsync)B/(t_{\text{train}}+t_{\text{sync}})에 고정되고 η를 더 줘도 lag만 늘어난다. verl 레시피의 튜닝 조언도 운영 언어로 같은 말을 한다. 먼저 rollout과 학습기 자원의 균형을 맞추고(rollouter/idle_ratio와 trainer/idle_ratio를 본다), staleness_threshold는 1 아래로 둔다. slime 문서는 상한의 분석적 형태를 준다. rollout·학습·가중치 업데이트 시간에 대해 속도 향상 ≲(tR+tT+tW)/(max⁡(tR,tT)+tW)\lesssim(t_R+t_T+t_W)/(\max(t_R,t_T)+t_W) — 겹치기는 기껏해야 두 단계 중 짧은 쪽을 숨길 뿐이다.

시스템들이 실제로 하는 일 (2026년 12월)

시스템모드staleness 제어가중치 업데이트 때 진행 중 요청가중치 동기화
verl V1 trainer (main)trainer.v1.trainer_mode: sync, colocate_async, separate_async (+ 선택적으로 hybrid replica를 rollout에 빌려줌, enable_switch)max_off_policy_threshold(첫 생성부터 8 버전)와 drop(버리고 prompt 하나 보충) 또는 wait; 미리 dispatch하는 prompt = num_warmup_batches × train batchabort → 남긴 토큰/log-prob으로 재시도, prefix 다시 prefillcheckpoint engine; separate_async는 naive가 아닌 backend 필요(nccl, nixl, mooncake; 그 밖에 delta_sharded 등); 동기화당 parameter_sync_step개 mini-batch
verl fully_async_policy (verl-recipe, v0.9.1)Rollouter / Trainer 분리, 샘플 하나씩 스트리밍staleness_threshold S: 동기화 구간당 최대 (1+S)⋅T⋅R⋅Bmini(1+S)\cdot T\cdot R\cdot B_{\text{mini}} 샘플(TT = trigger_parameter_sync_step, RR = require_batches)partial_rollout: sleep/resume으로 부분 샘플 유지; 아니면 진행 중 작업을 기다림NCCL(checkpoint-engine 방식)
AReaL v2.1.1max_head_offpolicyness 0 = 동기, >0 = 비동기위의 입장 규칙; 선택 옵션 mask_stale_tokens항상 interruptible: abort 후 prefix와 함께 재제출, 토큰에 버전 태그weight_update_mode: xccl(bucket NCCL, 기본), disk, awex
slime v0.4.0--colocate 또는 분리; fully-async rollout 함수단단한 상한 없음 — staleness는 재고 기록만; --sglang-server-concurrency와 출력 큐로 backpressure--flush-cache-interval: 1 = abort, flush, 재큐잉; ≤0 = 제자리 pauseNCCL(분리), CUDA IPC(colocate), disk; --update-weight-mode delta
prime-rl v0.11.0항상 분리, 한 스텝 겹침(TARGET_LAG = 1 dispatch gate)토큰별 max_staleness(8)로 옛 토큰 mask; strict_staleness는 rollout 통째로 버림vLLM keep 모드 pause; prefix cache는 버전별 saltfilesystem, nccl, modelexpress(NIXL)
SkyRL 0.5.0colocate 동기, one-step-off 예제, trainer.fully_async.enabledmax_staleness_steps(4)의 AReaL식 입장; 위반은 기록만, 버리지 않음KEEP pause; clear_kv_cache_on_weight_sync 기본 꺼짐CUDA IPC(colocate) / NCCL; 공유 저장소를 통한 delta
OpenRLHF v0.12.0hybrid engine(동기) 또는 --train.async_enable큐 backpressure: --train.async_queue_size(1) 배치만큼 앞서감--train.partial_rollout_enable: vLLM keep 모드 pausevLLM weight-transfer API: IPC(hybrid) / NCCL
ROLL v0.4.0colocate면 동기; 분리하면 async_generation_ratio > 0ratio(스텝)보다 낡은 group은 abort / 버림RLVR: 토큰을 남긴 채 abort 후 재개; agentic: 그 turn을 다시 생성CUDA IPC(colocate) / NCCL broadcast

보고된 속도 향상과 그 설정: verl V1 벤치마크(Qwen3.5-35B-A3B, Megatron + vLLM, 4노드, 32k 응답)는 150 스텝에 sync 22.79시간, colocate_async 14.72시간, separate_async 14.10시간. verl fully-async 레시피는 Qwen2.5-Math-7B, GPU 128개, staleness 0.5 + partial rollout에서 2.35–2.67배. AReaL v0.3 블로그는 PPO 1000 스텝에 41.0시간 → 14.8시간(1.5B, 16노드), 57.7시간 → 25.4시간(7B, 24노드), AIME24는 그대로. SkyRL은 Qwen3-4B colocate partial rollout에서 스텝이 23–35% 짧아졌다고 잰다. 이 숫자들은 서로 비교할 수 없다. 모델, 길이, 기준선이 다 다르다.

가중치 동기화 산수

BF16 파라미터 PP개를 전부 동기화하면 rollout replica마다 2P2P 바이트가 간다. broadcast tree를 쓰면 학습기 쪽 비용은 대략 2P/BW2P/\text{BW}다. P=32×109P=32\times10^9이면 64 GB — 유효 대역폭 50 GB/s로 가정하면 약 1.3초, 10 GB/s면 6.4초(추정치)다. 동기 colocate 루프에서 이것은 순수한 정지이고, 비동기 루프에서는 진행 중인 decode를 멈추거나(keep 모드) abort를 강요하며(abort 모드), drain 모드에서는 그 앞에 꼬리 대기가 붙는다. 이것을 줄이는 세 갈래가 있다. bucket으로 나눈 파이프라인 broadcast(AReaL의 1 GB chunk, slime의 512 MiB buffer, Moonshot checkpoint-engine 방식의 verl checkpoint engine), delta 동기화(verl의 delta_sharded는 바뀐 원소만 보낸다. 문서에 따르면 스텝당 BF16 파라미터 바이트의 약 1–3%만 바뀌고, 0.5B에서 235B까지 전체 broadcast보다 1.3–21배 빨랐다), 그리고 rollout이 학습기를 멈추지 않고 가중치를 가져가게 하는 relay 계층(Laminar)이다. sweep에서 동기화 비용을 올려 drain 모드의 비동기 이득이 얼마나 빨리 사라지는지 보자.

NumPy 이산 사건 모델: sync vs one-step-off vs fully async
import numpy as np, heapq

N, C, B, ALPHA, T_SYNC, T_SWITCH = 16, 16, 256, 0.25, 0.3, 0.3   # GPUs, streams/GPU, batch, train cost, sync, switch

def lengths(sigma, n, seed=3):
    return np.random.default_rng(seed).lognormal(-sigma**2 / 2, sigma, n)   # mean 1

def makespan(lens, M, t0):
    """List-schedule jobs on M identical streams starting at t0; return (finish time, busy stream-time)."""
    free = [t0] * M; heapq.heapify(free)
    for l in lens:
        heapq.heappush(free, heapq.heappop(free) + l)
    return max(free), float(np.sum(lens))

def sim_sync(L, steps):
    t, busy = 0.0, 0.0
    for k in range(steps):
        end, b = makespan(L[k*B:(k+1)*B], N*C, t); busy += b
        t = end + T_SWITCH + ALPHA*B/N + T_SYNC
    return dict(thr=steps*B/t, util=(busy/C + steps*ALPHA*B)/(N*t), lag=np.zeros(steps*B))

def sim_oneoff(L, steps, Gr):
    Gt = N - Gr; gen_end, train_end, ready, busy = 0.0, 0.0, [0.0], 0.0
    for k in range(steps):
        start = max(gen_end, ready[max(0, k-1)])          # batch k uses weights v = k-1
        gen_end, b = makespan(L[k*B:(k+1)*B], Gr*C, start); busy += b
        train_end = max(gen_end, train_end) + ALPHA*B/Gt + T_SYNC
        ready.append(train_end)
    lag = np.r_[np.zeros(B), np.ones((steps-1)*B)]
    return dict(thr=steps*B/train_end, util=(busy/C + steps*ALPHA*B)/(N*train_end), lag=lag)

def sim_async(L, steps, Gr, eta, partial):
    """AReaL-style admission: submit while running < M and accepted+running < (eta+v+1)*B."""
    M, Gt = Gr*C, N - Gr
    run, done, lags = [], [], []          # run: heap of (end - shift, start_version)
    v = acc = i = 0; t = shift = busy = 0.0
    trainer_free, state, paused_until, admit = 0.0, 'idle', 0.0, True
    while v < steps:
        if admit and t >= paused_until:
            cap = min(M - len(run), (eta + v + 1)*B - (acc + len(run)))
            for _ in range(max(0, cap)):
                heapq.heappush(run, (t + L[i] - shift, v)); busy += L[i]; i += 1
        cands = [run[0][0] + shift] if run else []
        if state in ('train', 'sync'): cands.append(trainer_free)
        if paused_until > t: cands.append(paused_until)
        t = min(cands)
        while run and run[0][0] + shift <= t + 1e-12:
            done.append(heapq.heappop(run)); acc += 1
        if state in ('train', 'sync') and t >= trainer_free:
            state = 'need_sync' if state == 'train' else 'idle'
        if state == 'need_sync':
            if partial or not run:
                if partial:
                    shift += T_SYNC                     # in-flight streams stall during the update
                admit = True
                paused_until = trainer_free = t + T_SYNC; state = 'sync'; v += 1
                continue
            admit = False                               # drain: stop admitting until in-flight work ends
        if state == 'idle' and len(done) >= B:
            batch, done = done[:B], done[B:]
            lags += [v - r[1] for r in batch]
            trainer_free, state = t + ALPHA*B/Gt, 'train'
    T = trainer_free
    return dict(thr=steps*B/T, util=(busy/C + steps*ALPHA*B)/(N*T), lag=np.array(lags))

steps, Gr = 24, 6
for sigma in [0.4, 1.0]:
    L = lengths(sigma, B*(steps + 12))
    rows = [('sync (colocated)', sim_sync(L, steps)), ('one-step-off', sim_oneoff(L, steps, Gr))]
    for eta in [1, 2, 4]:
        rows.append((f'async eta={eta} drain', sim_async(L, steps, Gr, eta, False)))
        rows.append((f'async eta={eta} partial', sim_async(L, steps, Gr, eta, True)))
    base = rows[0][1]['thr']
    print(f'length tail sigma={sigma}:  max/mean of 256 lengths ~ {np.mean([L[k*B:(k+1)*B].max() for k in range(steps)]):.1f}')
    for name, r in rows:
        print(f"  {name:22s} thr {r['thr']:5.1f} ({r['thr']/base:4.2f}x)  GPU util {r['util']:4.0%}  "
              f"lag mean {r['lag'].mean():4.2f} max {int(r['lag'].max())}")
 

출력의 두 블록을 읽자. 꼬리가 약하면(σ=0.4\sigma=0.4) 생성이 학습보다 짧아 비동기가 숨길 것이 적으므로 모두 ~10% 안에 있다. 꼬리가 무거우면(σ=1.0\sigma=1.0, 가장 느린 trajectory ≈ 평균의 12.5배) 동기 학습은 GPU 시간 대부분을 버린다. one-step-off와 drain 모드 비동기는 똑같이 1.3배를 되찾는데, 둘 다 업데이트 전에 여전히 가장 느린 trajectory를 기다리기 때문이다. 꼬리를 끊는 것(partial rollout)만이 학습기 병목 상한(2.5배)에 닿고 — 최대 lag가 η를 넘는 것도 이 구성뿐이다.

확인 문제Check yourself

partial rollout과 AReaL식 입장 상한 η = 2로 fully async 학습을 하는데, 첫 토큰 lag가 6인 trajectory가 보인다. 맞는 설명은?

상한 Nacc+Nrun<(η+v+1)BN_{\text{acc}}+N_{\text{run}}<(\eta+v+1)B는 버전당 작업량을 제한하고, rollout이 들어온 순서대로 소비될 때만 lag ≤ η를 함의한다. partial rollout에서는 trajectory가 업데이트를 넘어 살아남아 늦게 끝난다. 단단한 보장이 필요한 시스템은 토큰별 또는 trajectory별 규칙을 더한다. prime-rl의 토큰 masking(max_staleness)이나 strict_staleness, AReaL의 mask_stale_tokens, verl V1의 max_off_policy_threshold와 drop/wait.

정리

  • 동기 RL은 가장 느린 trajectory를 기다린다. 길이 꼬리가 무거우면 가장 느린 것이 평균보다 한 자릿수 크고 decode 용량 대부분이 논다.
  • one-step-off와 drain 모드 비동기는 학습과 생성을 겹치지만 동기화 전마다 여전히 꼬리를 기다린다. partial rollout(abort 후 재개 또는 keep)이 그 대기를 없앤다.
  • AReaL의 입장 규칙 Nacc+Nrun<(η+v+1)BN_{\text{acc}}+N_{\text{run}}<(\eta+v+1)B는 버전당 작업량을 묶지 trajectory 수명을 묶지 않는다. 단단한 보장에는 토큰 mask(prime-rl, AReaL)나 나이 기반 drop/wait(verl V1)가 필요하다.
  • 학습기가 병목이면 큰 η는 처리량 없이 staleness만 더한다. GPU 균형을 먼저 맞추자.
  • 가중치 동기화 비용은 2P2P 바이트에 비례한다. bucket broadcast, delta 동기화, relay 계층이 이것을 공략한다.

더 읽을거리Further reading