Skip to content

Fix(validator): HF Hub flake in foreground baseline must not kill the process - #192

Open
present42 wants to merge 1 commit into
masterfrom
fix/foreground-eval-hf-resilience
Open

Fix(validator): HF Hub flake in foreground baseline must not kill the process#192
present42 wants to merge 1 commit into
masterfrom
fix/foreground-eval-hf-resilience

Conversation

@present42

Copy link
Copy Markdown
Contributor

Fix: HF Hub flake in foreground baseline was process-fatal.

On 2026-07-10 (round 8590274) a transient huggingface.co read timeout inside the foreground baseline dataloader build escaped every handler and killed the validator — the round finalized with 0 scores and the cycle degraded to fallback weights. The background worker already survives these blips via bounded retry + degrade; this PR gives the foreground path the same policy (retry 0/10/30s, then skip the round's foreground pass instead of raising) plus a catch-and-continue at the run.py call site as a safety net for any other failure in that path. Foreground eval is best-effort by design — bg-eval covers the roster and finalize never required it. Tests pin the degraded path, the completed_out aliasing contract, and retry-recovery. (The 4 failing suite tests are pre-existing on staging.)

…he process

2026-07-10 10:30 UTC, round 8590274: a transient `requests.ConnectionError
(huggingface.co Read timed out)` inside the foreground baseline dataloader
build (`_evaluate_on_fresh_loader_sync` → `load_streaming_shard` →
`datasets.load_dataset`) propagated uncaught through
`evaluate_foreground_round` and `_bounded_foreground_eval` into run()'s
top-level "Quit training" handler — killing the validator. Cost: the whole
round finalized scored_count=0 and the cycle fell back to even weights.

Two layers, mirroring the background worker's existing policy
(DATALOADER_BUILD_RETRY_DELAYS_SEC), which already survives these blips:

- evaluator.py: retry the baseline build with backoff (0/10/30s); on
  exhaustion, skip the foreground pass for the round and return cleanly —
  bg-eval still covers the roster and finalize proceeds. CancelledError is
  re-raised so the outer validate-phase deadline keeps working.
- run.py: catch non-timeout exceptions at the foreground call site and
  continue the round with partial scores — foreground eval is best-effort;
  nothing downstream requires it to have succeeded. Safety net for any
  future non-HF failure in the same path.

Tests pin the degraded path (returns [] / the completed_out alias instead
of raising), retry-then-recover, and no spurious retries on success.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant