Fix failed rollouts counted as completed in AgentModeDaemon#480
Fix failed rollouts counted as completed in AgentModeDaemon#480Mr-Neutr0n wants to merge 1 commit into
Conversation
When vLLM returns HTTP 400 errors, the resulting rollouts have None reward and empty triplets. Previously these were still counted as completed, which caused the task count to exceed the total queued (e.g. "Completed 33/32 tasks") and triggered assertion failures in get_train_data_batch. This change: - Adds _is_failed_rollout() to detect rollouts with no reward and no triplets, indicating a backend error rather than a real result - Skips failed rollouts instead of storing them, allowing the task to be re-claimed and retried - For v1 mode, only polls for pending (not yet completed) rollout IDs so that successful retries are properly picked up - Removes the early "already processed" skip that could prevent a successful retry from overwriting a stale entry Fixes microsoft#355
|
Friendly bump! Let me know if there's anything I should update or improve to help move this forward. |
| else: | ||
| # Only wait for rollout IDs that have not yet successfully completed, | ||
| # so that re-runs of previously failed tasks are picked up. | ||
| pending_ids = [ |
There was a problem hiding this comment.
I think we already have retried the failed rollouts. Why this change?
|
@ultmaster — good question. The bug is more subtle than just "should we count failed rollouts": without this change, the first failed rollout is added to Concretely: the symptom in the PR description is "Completed 33/32 tasks", which only happens when failed rollouts have been added to the completed set. So the change is doing two things at once:
Happy to split into two PRs if that's clearer; the two changes do interact (without #1, #2 alone doesn't help; without #2, #1 just shifts the off-by-one to the next failure). |
Summary
Fixes #355
Nonereward and empty triplets. These were previously counted as "completed" in_async_run_until_finished, causing the completed count to exceed_total_tasks_queued(e.g. "Completed 33/32 tasks") and triggering assertion failures inget_train_data_batch._is_failed_rollout()helper that detects rollouts with no reward and no triplets, identifying them as backend failures rather than real results.wait_for_rolloutsnow only polls for rollout IDs that have not yet successfully completed, so successful retries are properly picked up.Test plan
get_train_data_batchno longer hits theassert len(self._completed_rollouts_v0) == self._total_tasks_queuedassertion