verl icon indicating copy to clipboard operation
verl copied to clipboard

[Feature Request] Add trainer and rollouter idle-ratio metrics to V1 separate_async

Open mikequan0425 opened this issue 3 months ago • 3 comments

Feature request

Under the experimental/fully_async_policy, there is an idle ratio metric that can be used to observe the specific idle rates of the rollouter and trainer.

But it seems this metric is missing under separate_async for trainer v1? I have only found some idle‑related metrics associated with switch.

I observed that when enable_switch is enabled, the hybrid engine trainer will actively switch to the rollouter based on switch_threshold_ratio and by weighing the benefit and cost time, so as to reduce trainer idle time.

Is it because under the current enable_switch=true setting, it is relatively difficult to collect statistics for this metric? Or does the existence of this feature enable adaptive adjustments, meaning there is no need to pay special attention to the idle ratio?

Motivation

Based on past experience, this metric can provide a basis for determining whether the bottleneck stems from the generation phase or the training phase. Such as:

  • High trainer/idle_ratio and low rollouter/idle_ratio: rollout is the bottleneck.
  • Low trainer/idle_ratio and high rollouter/idle_ratio: trainer is the bottleneck or rollout is over-provisioned.
  • High ratios on both sides may indicate synchronization, scheduling, or data-pipeline overhead.

Then adjust the resource ratio for training and inference under the separate mode and the staleness strategies in a targeted manner.

Your contribution

--

mikequan0425 avatar Aug 29 '26 04:08 mikequan0425

I’d like to work on this, but I want to pin down the accounting contract before changing code.

My reading of the current V1 path is:

  • trainer idle can match the existing fully_async definition: accumulated timing_s/gen / timing_s/step over one global step;
  • rollouter idle cannot be derived correctly from a point-in-time queue-depth sample. The shared router exposes per-replica in-flight counts, so the backend-independent option would be to integrate, over the same global-step window, the fraction of registered rollout replicas with zero in-flight requests. With hybrid switching enabled, only replicas registered during each interval would contribute capacity; trainer-owned replicas in TRAINER mode would be excluded.

That would measure replica idleness at the routing boundary, not vLLM/SGLang token-engine utilization or configured scheduler-slot utilization. It stays backend-independent and makes the denominator explicit, but a replica with one long request counts as active for the whole interval.

Would that replica-time definition be useful for V1 separate_async, or should this feature instead expose only trainer/idle_ratio and leave rollout utilization to the existing backend Prometheus/RL-Insight metrics?

If the replica-time definition is acceptable, I’ll keep the change scoped to time-integrated router state, CPU regression tests for integration/window reset and hybrid add/remove transitions, plus the V1 async observability docs.

This investigation and comment were AI-assisted; I reviewed the current trainer, router, tests, docs, and duplicate searches before posting.

hsusul avatar Sep 01 '26 20:09 hsusul

@hsusul Hello!

  1. First, enable_switch is already implemented, yet the original timing_s/gen only measures the time taken by replay_buffer.sample. There is a case where, when Hybrid Engine is in ROLLOUT MODE and actively running rollout tasks, this period should not be counted as trainer idle time.
  2. In my view, rollouter idle metrics should only account for standalone replicas. Calculating rollouter idle ratio by counting rollout replicas with zero in‑flight requests in the standalone resource pool seems feasible.
  3. I’m also unsure whether RL‑Insight already collects rollout‑idle metrics. cc @tardis-key @mengchengTang

mikequan0425 avatar Sep 02 '26 06:09 mikequan0425

@mikequan0425 In RL-Insight, we don't need numerical metrics because we can visually observe the busyness of training and inference nodes through the timeline visualization. Therefore, RL-Insight does not currently involve the calculation of such metrics.

I believe these two metrics are very necessary when scheduling visualization is not available. (for more efficient debugging of the async trainer, using RL-Insight is still recommended😁)

tardis-key avatar Sep 02 '26 06:09 tardis-key