Skip to content

fix(leaderboard): keep the sympy check working where SIGALRM is unavailable - #4325

Open
barlowa124 wants to merge 1 commit into
EleutherAI:mainfrom
barlowa124:leaderboard-sigalrm-4286
Open

barlowa124 wants to merge 1 commit into
EleutherAI:mainfrom
barlowa124:leaderboard-sigalrm-4286

Conversation

@barlowa124

Copy link
Copy Markdown

Refs #4286.

The SIGALRM timeout census on that issue lists six sites. Two open PRs cover five of them: #4287 guards minerva_math and putnam_axiom, and #4318 guards the two time_limit copies where a missed disarm leaves ITIMER_REAL armed. This PR covers the sixth, leaderboard/math/utils.py, which has the same unguarded signal.signal/signal.alarm pair and the same wrong-score failure mode on Windows and off the main thread.

The change mirrors #4287: if signal.signal raises AttributeError (no SIGALRM) or ValueError (not the main thread), the timeout stays unarmed and the comparison runs without a time limit rather than reaching the is_equiv catch-all and scoring 0.

New tests in tests/test_minerva_math.py cover both failure modes for the leaderboard copy: monkeypatch.delattr(signal, "SIGALRM") and a worker-thread call. Both fail on the unguarded code (is_equiv("\frac{1}{2}", "0.5") returns False) and pass with the fix. The three other failures in that file are the NORMS issue tracked in #4073 and occur identically on upstream/main.

…ilable

The leaderboard math is_equiv guards sympy with the same SIGALRM-based
timeout as minerva_math and putnam_axiom. Where the handler cannot be
installed (Windows, worker threads) the AttributeError or ValueError
reached the catch-all in is_equiv and scored every comparison that
needs sympy as wrong. Skip arming when the handler cannot be installed
instead of raising; the comparison then runs without a time limit.

Refs EleutherAI#4286.

This branch has not been deployed

No deployments
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