Repository navigation
fix(scicode): use a pinned scientific grading environment - #4892
Conversation
Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
yaoyu-33
left a comment
There was a problem hiding this comment.
Thanks for tracking down the simps import failures. Moving grading into a pinned Python 3.11 env is the right fix, and the replay evidence on problems 2/15/17/28 is convincing.
We traced every grading path (verify → run_substep(..., executable)) and confirmed that the server process no longer imports numpy/scipy/h5py and that SciCode-Verified's explicit grading_interpreters path is unaffected. We also built the env for real with uv on macOS arm64: the simps smoke check passes, the fast path is reused, and a failed install leaves no marker. Inline comments cover two env-update edge cases and a stale README.
A few things are not inline, because resources_servers/scicode/README.md is not part of this diff:
resources_servers/scicode/README.mdL36-37 still says generated code runs in the server's own venv withscipy<1.14, which is the claim this PR corrects inbenchmarks/scicode/README.md. L32 also says "Ray subprocess", but the code uses a plainsubprocess.run.- Compatibility notes: could the PR body call out three changes?
step_outputs[].environmentchanges from"current"to"scicode"(app.py:202). Scores on problems 2/28 can move because the grader changes. And every server start now needsuvplus download access unless the env is prebuilt.
… lock Signed-off-by: Igor Gitman <[email protected]>
|
/ok to test ba6109f |
|
/ok to test 91a9513 |
Signed-off-by: Igor Gitman <[email protected]>
|
Merged upstream main |
|
/ok to test e80b5c3 |
|
💬 The author’s resolution preserves sandbox-first execution and the pinned local grader, with a startup regression. My unpublished candidate is no longer needed. Lint and component-lock checks passed on |
|
The model provider is unavailable. Work is paused and automatic retries have stopped. Send a new message or retry when the provider is available to resume. |
|
The label application does not own this session. |
|
I'll watch this ready-to-merge PR and report substantive progress. Running on |
Keep the pinned grading-environment tests and the stateless regrading tests. Preserve all automatically merged changes. Signed-off-by: svcnemo-autobot <[email protected]>
|
/ok to test 849b033 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42461911160 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42462896031 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42537087968 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42571463276 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42720312812 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42721595664 |
SciCode's default grader now executes generated code in a separate Python 3.11 environment with the original scientific APIs, including SciPy 1.10.1 and scipy.integrate.simps. The Gym server no longer needs those scientific packages in its own interpreter. SciCode-Verified's explicit grading_interpreters continue to take precedence. Sandbox mode uses the image's interpreters/data and bypasses local environment setup; this branch includes merged #5474.
Commit the full resolved grading-requirements.lock, generated from the six direct requirements with uv pip compile --python-version 3.11 --universal. Startup applies uv pip sync. A changed lock/Python fingerprint invalidates the marker and recreates the interpreter with uv venv --clear; failed setup never receives a ready marker. Matching prebuilt environments can start offline. Both benchmark and resources-server READMEs describe the execution environment and lock regeneration.
Compatibility: default step_outputs[].environment changes from "current" to "scicode". Scores can move on problems previously failing scientific API imports, including 2 and 28. Creating/updating the default environment requires uv, Python/package download access and a writable grading_venv_path; matching prebuilt environments or explicit interpreters avoid that startup download requirement. The runner uses subprocess.run, not a Ray subprocess.
No separate issue: fixes the reproduced scientific-library incompatibility in the existing benchmark.
Validation:
Latest validation (main
2ac7908c4, head461a46d3dcee25070b0bbeeb765908f1e5a2035a):Resolved the main conflict after #5474 merged. Sandbox grading takes precedence and never creates/preflights the local Python environment or reads image-only test data on the host. Added a startup regression covering that interaction; retained the sandbox dependencies while removing the local scientific stack from the server environment. 106 SciCode tests and full pre-commit passed.