Repository navigation
CCC Environment Compile Solutions Once Optimization - #3087
Conversation
Compile each generated solution once before distributing its tests. Add optional node-local compilation staging, then publish completed artifacts to shared storage so test execution can remain distributed across nodes. Signed-off-by: Aleksander Ficek <[email protected]>
Use /tmp/nemo-gym-compile when no local compile path is configured. Keep the path overridable and treat an explicit null value as disabling local staging. Signed-off-by: Aleksander Ficek <[email protected]>
Signed-off-by: Aleksander Ficek <[email protected]>
be122d5 to
f0370f9
Compare
|
/ok to test f0370f9 |
| command = f"cd {quoted_work_dir} && ./compile.sh" | ||
| else: | ||
| local_work_dir = os.path.join(local_compile_dir, os.path.basename(work_dir.rstrip(os.sep))) | ||
| quoted_local_work_dir = shlex.quote(local_work_dir) |
There was a problem hiding this comment.
should this have unique work dir per rollout?
There was a problem hiding this comment.
Yes its already unique work dir per rollout so that each node can compile multiple rollouts concurrently
| handle.write("\n") | ||
|
|
||
|
|
||
| class LocalSandbox: |
There was a problem hiding this comment.
There was a problem hiding this comment.
Thanks for pointing this out. It isn’t a drop-in replacement yet because the compiled artifacts for this env need to be accessible across sandbox nodes, while the new API provides sandbox-local storage. We should eventually migrate once artifacts can be distributed / shared.
|
/claude review |
Review: HOLDFocused, well-tested refactor of the CCC verifier: compile each solution once ( One blocker stops merge: BLOCKER (ccc_eval.py:215) — silent score corruption on shared filesystems. Compile success is RISK (ccc_eval.py:451) — Both are score-correctness issues in a verifier feeding evals/training, hence the grades. The |
Signed-off-by: Aleksander Ficek <[email protected]>
Signed-off-by: Aleksander Ficek <[email protected]>
|
/ok to test c538f50 |
|
/ok to test 3816f78 |
## What does this PR do? Previously, the same generated solution was compiled independently for every test case. At high rollout concurrency, this creates redundant compiler work and metadata-heavy temporary-file traffic on shared filesystems. This change reduces compilation to once per solution and allows compiler I/O to occur on node-local storage while retaining distributed test execution and per-test isolation. Additionally, I add warning logs for when `SHARED_TEMP_DIR` is not set to help with debugging. ## Summary - Compile each generated solution once and reuse the compiled artifact across its test cases. - Add optional `local_compile_dir` / `LOCAL_COMPILE_DIR` support for staging compilation on node-local storage (defaults to `tmp`). - Existing shared-storage behavior can be specified with `LOCAL_COMPILE_DIR` set to null. - Added warning logs for when `SHARED_TEMP_DIR` is not set to help with debugging. ## Checklist - [x] I have read the [contributing guidelines](https://docs.nvidia.com/nemo/gym/latest/contribute/development-setup). - [x] The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs. - [x] Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable). - [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so CI lint/format/copyright pass). - [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check passes). --------- Signed-off-by: Aleksander Ficek <[email protected]> Signed-off-by: Junkeun Yi <[email protected]>
Super 3.5 post-training launchers export CCC_SHARED_TEMP_DIR and mount it into the sandbox containers, but main reads only SHARED_TEMP_DIR. shared_dir then silently falls back to /tmp, which the sandbox cannot see, so every CCC compile fails and scores 0. Port #3113 (8ff4a09 on super-v3.5-posttraining) with backward compatibility, and give LOCAL_COMPILE_DIR (#3087) the same prefix: - shared_dir reads CCC_SHARED_TEMP_DIR, then SHARED_TEMP_DIR, then /tmp - local_compile_dir reads CCC_LOCAL_COMPILE_DIR, then LOCAL_COMPILE_DIR, then /tmp/nemo-gym-compile - drop the shared_dir overrides in benchmarks/ioi and benchmarks/ioi26; they duplicated the inherited CCC value and would have kept IOI on the old name - point the /tmp warning and the README at the prefixed names Add tests that resolve the CCC, IOI and IOI26 configs through GlobalConfigDictParser with the variables unset, legacy-only, prefixed-only, and both set. Signed-off-by: Peter Jin <[email protected]>
…NVIDIA-NeMo#3963) Super 3.5 post-training launchers export CCC_SHARED_TEMP_DIR and mount it into the sandbox containers, but main reads only SHARED_TEMP_DIR. shared_dir then silently falls back to /tmp, which the sandbox cannot see, so every CCC compile fails and scores 0. Port NVIDIA-NeMo#3113 (8ff4a09 on super-v3.5-posttraining) with backward compatibility, and give LOCAL_COMPILE_DIR (NVIDIA-NeMo#3087) the same prefix: - shared_dir reads CCC_SHARED_TEMP_DIR, then SHARED_TEMP_DIR, then /tmp - local_compile_dir reads CCC_LOCAL_COMPILE_DIR, then LOCAL_COMPILE_DIR, then /tmp/nemo-gym-compile - drop the shared_dir overrides in benchmarks/ioi and benchmarks/ioi26; they duplicated the inherited CCC value and would have kept IOI on the old name - point the /tmp warning and the README at the prefixed names Add tests that resolve the CCC, IOI and IOI26 configs through GlobalConfigDictParser with the variables unset, legacy-only, prefixed-only, and both set. Signed-off-by: Peter Jin <[email protected]>
What does this PR do?
Previously, the same generated solution was compiled independently for every test case. At high rollout concurrency, this creates redundant compiler work and metadata-heavy temporary-file traffic on shared filesystems.
This change reduces compilation to once per solution and allows compiler I/O to occur on node-local storage while retaining distributed test execution and per-test isolation. Additionally, I add warning logs for when
SHARED_TEMP_DIRis not set to help with debugging.Summary
local_compile_dir/LOCAL_COMPILE_DIRsupport for staging compilation on node-local storage (defaults totmp).LOCAL_COMPILE_DIRset to null.SHARED_TEMP_DIRis not set to help with debugging.Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).