Skip to content

Add SciCode - #153

Merged
finbarrtimbers merged 53 commits into
mainfrom
finbarr/scicode
Apr 29, 2026
Merged

finbarrtimbers merged 53 commits into
mainfrom
finbarr/scicode

Conversation

@finbarrtimbers

@finbarrtimbers finbarrtimbers commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Adds SciCode as an ExternalEval.

Verification:

  1. Reproduces Artificial Analysis's 41% target on google/gemma-4-31b-it with enable_thinking=true: sub_step_accuracy = 42.01% (121/288).
  2. microsoft/Phi-4-mini-instruct gets 9.375% vs AA's 10.8% target.
  3. Post-review re-run on microsoft/Phi-4-mini-instruct (commit 28cda45, 2026-04-29): sub_step_accuracy = 10.07% (29/288), matching AA's 10.8% target. Beaker

h5py_host_path is required

The eval expects the SciCode reference numerics file (test_data.h5) to be available on the host and bind-mounted into the sandbox. There is no default — pass -A h5py_host_path=... at launch. Running without it raises ValueError. Ai2 internal users (detected by BEAKER_TOKEN in env) get a hint in the error message pointing at /weka/oe-adapt-default/finbarrt/scicode/test_data.h5.

Sandbox image changes

This PR also reworks src/olmo_eval/harness/sandbox/image.py to support SciCode's verifier:

  • SciCode's verifier runs uv sync --active --frozen --no-dev --project ... inside the sandbox to install per-problem dependencies. uv sync --active requires a real venv pointed to by VIRTUAL_ENV, which the previous /root/python raw-interpreter layout did not provide. The Dockerfile now bakes a venv at /root/venv and exports VIRTUAL_ENV, so SciCode's runtime uv sync lands deps in the right place.
  • Switches from a pinned python-build-standalone tarball (x86_64-only, ~2-year-old build) to COPY --from=ghcr.io/astral-sh/uv:0.11.7 /uv /uvx ... as a build stage. This is multi-arch, maintained, and lets uv pick the Python interpreter (uv venv --python 3.12).
  • Drops the redundant second pip install uv step now that uv is the bootstrap.
  • Bumps SWEREX_IMAGE_VERSION so the cache key reflects the new on-disk layout (/root/python → /root/venv).

JSON round-trip for -a / -K args

The Beaker launcher passes parsed eval args to the inner run-external CLI as repeated -a key=value strings, and the inner CLI re-parses them via _coerce_value. Before, the launcher used Python's default str() formatting, so:

  • ["13.1", "13.2"] became "['13.1', '13.2']" — Python repr with single quotes is not valid JSON, so _coerce_value returned a literal string instead of a list.
  • True / None similarly became "True" / "None" rather than JSON's true / null.

This bit the SciCode smoke test concretely: --problem-ids is list-typed, and the GPU-side eval received a string. The fix is symmetric: json.dumps on the way out (job_assembler.py), json.loads on the way in (cli/utils.py). tests/cli/test_arg_round_trip.py pins the round-trip for str / bool / int / float / list / dict / None.

Reproducing

Phi-4 Mini (non-reasoning, AA-compliant, ~14m on 1×H100):

uv run olmo-eval beaker launch -m microsoft/Phi-4-mini-instruct -E scicode \
  -A with_background=true -A max_tokens=16384 -A temperature=0 \
  -A h5py_host_path=/weka/oe-adapt-default/finbarrt/scicode/test_data.h5 \
  -K max_model_len=131072 \
  -p urgent -w ai2/open-instruct-dev -B ai2/oe-adapt -c h100

Gemma-4-31b-it (reasoning, ~1h 48m on 2×H100):

uv run olmo-eval beaker launch -E scicode \
  -I finbarrt/olmo-eval-cu1281-trc290-amd64-sandbox-vllm \
  -K 'chat_template_kwargs={"enable_thinking":true}' \
  -A with_background=true -A max_tokens=16384 -A temperature=0.6 \
  -A h5py_host_path=/weka/oe-adapt-default/finbarrt/scicode/test_data.h5 \
  -m google/gemma-4-31b-it \
  -p urgent -w ai2/open-instruct-dev -c h100 -B ai2/oe-adapt -G 2

Stacked PRs

The bake-once sandbox image / launch-host pre-bake mechanism has been split into a follow-up PR that depends on this one.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e47c6b9c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@finbarrtimbers finbarrtimbers changed the title Add SciCode external eval (42% sub_step_accuracy on gemma-4-31b-it) Add SciCode Apr 24, 2026
@finbarrtimbers
finbarrtimbers changed the base branch from main to finbarr/roundtrip April 27, 2026 20:06
@finbarrtimbers
finbarrtimbers changed the base branch from finbarr/roundtrip to main April 27, 2026 20:06
@finbarrtimbers
finbarrtimbers requested a review from undfined April 27, 2026 20:17

@undfined undfined left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a few cases that will likely raise exceptions that we should fix and just one hygiene request to avoid adding Ai2 paths in source when possible.

Comment thread src/olmo_eval/harness/sandbox/image.py Resolved
@finbarrtimbers
finbarrtimbers requested a review from undfined April 29, 2026 17:49

@undfined undfined left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice.

@finbarrtimbers
finbarrtimbers merged commit 7c4bf3a into main Apr 29, 2026
10 checks passed
@gregorybchris
gregorybchris deleted the finbarr/scicode branch October 7, 2026 21:12
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.

2 participants