[RL][Frontend] Return token-level weight-version spans on final outputs (#59582)

Signed-off-by: Shuolei Wang <shuoleiwang123@gmail.com>
Signed-off-by: Shuolei Wang <948904026@qq.com>
Co-authored-by: aoshen02 <aoshen@inferact.ai>
This commit is contained in:
Shuolei Wang
2026-10-11 11:33:29 +08:00
committed by GitHub
co-authored by aoshen02
parent 3c062d391d
commit b89852aad0
14 changed files with 169 additions and 28 deletions
+7
View File
@@ -639,6 +639,11 @@ class EngineCore:
else:
eco.scheduler_stats.iteration_details = iteration_details
def _attach_weight_version(self, outputs: dict[int, EngineCoreOutputs]) -> None:
# Weight versions change only while generation is paused.
for eco in outputs.values():
eco.weight_version = self._weight_version
def _should_throttle_prefills(self) -> bool:
"""Whether to defer new prefills this step (DP prefill balancing).
Overridden by the DP engine core; never throttles otherwise."""
@@ -672,6 +677,7 @@ class EngineCore:
scheduler_output, model_output
)
self._attach_iteration_details(engine_core_outputs, iteration_details)
self._attach_weight_version(engine_core_outputs)
return engine_core_outputs, scheduler_output.total_num_scheduled_tokens > 0
@@ -773,6 +779,7 @@ class EngineCore:
scheduler_output, model_output
)
self._attach_iteration_details(engine_core_outputs, iteration_details)
self._attach_weight_version(engine_core_outputs)
# NOTE(nick): We can either handle the deferred tasks here or save
# in a field and do it immediately once step_with_batch_queue is