This repository was archived by the owner on Aug 3, 2026. It is now read-only.
validator: isolate hidden-eval in a subprocess so a CUDA fault can't crash the validator - #61
Closed
gho11123 wants to merge 2 commits into
Closed
validator: isolate hidden-eval in a subprocess so a CUDA fault can't crash the validator#61gho11123 wants to merge 2 commits into
gho11123 wants to merge 2 commits into
Conversation
…crash the validator op4_hidden_eval ran the canonical checkpoint's forward IN-PROCESS. A fatal CUDA fault there (e.g. an illegal memory access from a malformed/degenerate checkpoint) raises a C++ terminate -> SIGABRT that Python cannot catch, so the entire validator process core-dumps and judging halts until a manual restart. One submitted checkpoint can take the validator down (observed in production). Extract the subprocess spawn+parse the patched path already uses into _run_eval_subprocess(workdir, ckpt_path, ralph_root, label), and route BOTH the canonical op4 path (workdir = canonical RECIPE_DIR) and _patched_hidden_eval (workdir = patched copy) through it. A child crash (non-zero exit incl. SIGABRT) or timeout returns (False, reason, None) -> the bundle is rejected and the validator survives. The in-process CPU load_state_dict stays so a structural shape mismatch still routes to the patched path. Behavior-preserving for the patched path (label reproduces its exact messages). tests/test_eval_subprocess_isolation.py: a non-zero child exit (core dump) and a timeout are caught as rejections; a valid result line parses. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
After routing both eval paths through _run_eval_subprocess, the top-level eval.run_hidden_eval import and the subprocess import inside _patched_hidden_eval are no longer referenced (the helper imports subprocess itself). Removes both to satisfy ruff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bitzic
added a commit
that referenced
this pull request
Jun 28, 2026
validator: subprocess-isolate op4 canonical eval (corrected #61)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 (observed in production)
A validator core-dumped while scoring a submitted bundle:
Call path:
run_epoch → (score) → run_hidden_eval → compute_val_bpb → model.forward → F.linear.The hidden-eval runs a submitted checkpoint's forward in-process. A fatal CUDA fault there is a C++
terminate()→SIGABRT, which Python cannot catch — so the entire validator process dies and judging halts until a manual restart. One submission is enough to take the validator down.Fix — process isolation (reuse the pattern already in the tree)
_patched_hidden_evalalready runs the eval in a subprocess viaeval_in_workdir.py. This PR generalizes that to every checkpoint forward:_run_eval_subprocess(workdir, ckpt_path, ralph_root, label).op4_hidden_evalpath through it (workdir = RECIPE_DIR), not just the patched path.(False, reason, None)→ the bundle is rejected and the validator keeps running.load_state_dictstays, so a structural-patch shape mismatch still routes to_patched_hidden_eval.Behavior-preserving for the patched path (the
labelreproduces its exact messages); the only happy-path change is that the canonical forward now runs in a child.Tests
tests/test_eval_subprocess_isolation.py: a non-zero child exit (core dump) and a timeout are caught as rejections; a validRALPH_EVAL_RESULTline parses into aHiddenEvalResult.🤖 Generated with Claude Code