fix: rescue lingering finished SWE episodes and mask infra failures - #2410
fix: rescue lingering finished SWE episodes and mask infra failures#2410tdene wants to merge 2 commits into
Conversation
|
/claude review |
|
SHIP — solid, well-tested reliability fix. One NOTE inline; nothing blocking. The core change is correct:
No async-HTTP, |
| # An agent command that died without producing output is an infrastructure failure, | ||
| # not a model failure; allow for it to be masked out of the gradient. | ||
| metrics.mask_sample = True | ||
| metrics.failure_reason = "agent_command_failure" |
There was a problem hiding this comment.
NOTE — failure_reason taxonomy is coarsened for timeouts/OOMs that flow through this path.
WHAT: This except block catches every agent-command failure, including wall-clock timeouts (ValueError("Command timed out")) and watchdog OOMs (the OOM RuntimeError at ~2550). It unconditionally sets metrics.failure_reason = "agent_command_failure" and persists it. Downstream in responses() (~3653), the specific-reason logic is guarded by if not failure_reason:, so it never overwrites — a genuine agent timeout now reports agent_command_failure instead of agent_timeout, and an agent OOM instead of agent_oom.
BLAST RADIUS: Observability only — mask_sample is still correctly True, and agent_timed_out/oom_killed bools remain set, so masking and the boolean signals are unaffected. But the failure_reason taxonomy this PR introduces is partly self-defeating for the two most common failure modes.
FIX: Either set the reason more specifically here (compute after agent_timed_out/watchdog stats), or set it to None/leave unset and let the downstream if not failure_reason: block classify it. Your call — telemetry granularity, not correctness.
There was a problem hiding this comment.
Thanks for catching this! Fixed.
|
/ok to test bbc003e |
bbc003e to
c132548
Compare
c132548 to
439bd44
Compare
Co-Authored-By: Jorge Albericio <jalbericiola@nvidia.com> Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
439bd44 to
cb2074f
Compare
This PR contains two fixes.
For the first, the harness will commonly be left running despite the model having finished the episode. This usually happens due to lingering commands. Currently this leads to a long timeout and failure. Rescuing these episodes from the harness allows them to complete early and retrieve rewards for what would otherwise be marked as a failure.
For the second, infra failures are now tagged so that the training backend can choose to mask out their gradients instead of training with them as 0 reward.