fix(rollout): guard round(None) in zero-std metric aggregation#2
Closed
DavidBellamy wants to merge 1 commit intomainfrom
Closed
fix(rollout): guard round(None) in zero-std metric aggregation#2DavidBellamy wants to merge 1 commit intomainfrom
DavidBellamy wants to merge 1 commit intomainfrom
Conversation
_compute_zero_std_metrics crashes with TypeError when any zero-std group's
leading sample has a None reward (typical for Status.ABORTED trials):
File "miles/ray/rollout.py", line 1266, in _compute_zero_std_metrics
interesting_rewards = [str(round(g[0].get_reward_value(args), 1)) ...]
TypeError: type NoneType doesn't define __round__ method
This crash fires on RolloutManager.generate() inside _log_rollout_data,
after the rollout collection + dynamic sampling filter have already
accepted the batch. With agentic tasks where some trials routinely abort
(Daytona sandbox timeout, tool-invocation loops, etc.), the trainer never
receives the batch and optimizer.step() never fires, so async RL training
silently stalls.
Fix: extract a _reward_label helper that buckets None-reward samples under
a dedicated 'none' label instead of passing None to round(). This keeps
the metric informative (zero_std/count_none shows the aborted-group count)
and preserves the existing behavior for numeric rewards.
Observed on LLM360/RL360 radixark#76 FAST_ITER smoke runs (job 1559799) with
GLM-4.7-Flash on agentic terminal-bench tasks.
Collaborator
Author
|
Re-opening against radixark/miles:main so the LLM360/miles deploy branch auto-builder picks it up (the workflow at .github/workflows/maintain-deploy.yml queries PRs on the radixark upstream with LLM360 head branches). Same branch, same diff. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
_compute_zero_std_metricsinmiles/ray/rollout.pycrashesRolloutManager.generate()with aTypeErrorwhen any zero-std group's leading sample has aNonereward:This fires inside
_log_rollout_data, after rollout collection anddynamic_sampling_filterhave already accepted the batch. The trainer actor never receives the batch, sooptimizer.step()never runs and async RL silently stalls.Samples with
Status.ABORTEDcarryreward=None(Daytona sandbox timeout, tool-invocation loops, agent LimitsExceeded, etc.), so any grouping of aborted trials triggers this path on GRPO-style runs.Fix
Extract a small
_reward_labelhelper that bucketsNonerewards under a dedicated"none"label instead of passingNonetoround(). Keeps the metric informative (zero_std/count_noneshows the aborted-group count) and preserves existing behavior for numeric rewards.Test
Smoke-checked the helper locally against numeric, float-rounding, and
Nonecases:Context
Observed on LLM360/RL360#76 FAST_ITER smoke runs (GLM-4.7-Flash, agentic terminal-bench tasks) on M2. Multiple iter jobs (1559799, 1559800) reached
Finish rolloutsuccessfully but crashed at this exact call site during metric aggregation. Post-fix, the trainer should receive the collected batch and fireoptimizer.step()as expected.