Hand off final_model to the verifier via a Harbor shared volume instead of the workspace tar - #66
Open
surelyMersad wants to merge 1 commit into
Conversation
…ad of the workspace tar The trained weights previously traveled inside the single workspace artifact: tarred in the agent env, downloaded to the host, re-uploaded into the separate verifier env. On multi-GB workspaces this is the transfer path that died with tar exit code -1 / empty stderr (2026-05-27 and 2026-06-27 trials) and forced the aggressive-excludes workaround. final_model is now a harbor task-declared shared volume ([[environment.volumes]], name "model"): the agent writes weights to the volume mounted read-write at /home/agent/workspace/final_model, the verifier attaches the SAME per-trial volume read-only at /mnt/model, and harbor creates/deletes the volume per trial. On Modal the weights move as a Modal Volume, locally as a Docker named volume — never through the tar/host path. - task.toml: volume declarations on both [environment] and [verifier.environment]; final_model (and stray weight-file patterns) added to the workspace-artifact excludes, so the tar now carries only the contamination-judge inputs (agent source code). - tests/test.sh: evaluate against read-only /mnt/model; treat an empty volume as "no model"; updated tamper-resistance notes. - instruction.md: note that final_model is a pre-created mounted volume (write into it; don't delete/rename the mountpoint). - README: model hand-off section + harbor install pin. Requires harbor's task-declared shared volumes feature (upstream PR to harbor-framework/harbor); until it lands, install harbor from git+https://github.com/surelyMersad/harbor@feat/task-shared-volumes.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Builds on #8. The trained weights currently travel inside the single workspace
artifact: tarred in the agent env, downloaded to the host, re-uploaded into the
separate verifier env. That's the transfer path that died with tar exit code -1 /
empty stderr on multi-GB workspaces (2026-05-27 and 2026-06-27 trials, see the
task.toml comments) and forced the aggressive-excludes workaround — while still
carrying the multi-GB
final_modelthrough it.What this PR does
final_modelbecomes a Harbor task-declared shared volume(
[[environment.volumes]], namemodel):/home/agent/workspace/final_model/mnt/modelHarbor creates one volume per trial (
harbor-<trial>-model), both containersattach the same volume, and Harbor deletes it at trial cleanup. On Modal the
weights move as a Modal Volume, locally as
a Docker named volume — never through the tar/host path.
Consequences:
agent's source code) —
final_modeland stray weight-file patterns(
*.safetensors,*.pt,*.ckpt, …) are added to the excludes, so theagent-side tar stays small regardless of model size.
cannot modify the evidence it grades. The mountpoint can't be deleted, renamed,
or unmounted by the agent — worst case it empties its own deliverable, which
test.sh scores as reward 0.
artifacts/workspace/final_model/on thehost. Run with harbor's
delete=Falseif you need to inspect weights after atrial.
Changes (4 files, +89/−45)
template/task.toml— volume declarations on[environment]and[verifier.environment];final_model+ weight-file patterns added to theworkspace-artifact excludes; comments updated (the "final_model is deliberately
kept in the tar" rationale is retired).
template/tests/test.sh— evaluate against read-only/mnt/model; an emptyvolume is treated as "no model" (the mountpoint always exists, so the old
-dcheck alone would pass vacuously); tamper-resistance notes updated.
template/instruction.md— one added line:final_modelis a pre-createdmounted volume; write into it (
save_pretrained("final_model")/ copy filesin), don't delete or rename the folder itself. Avoids agents hitting a
confusing
EBUSYon the commonrm -rf final_model && mv checkpoint final_modelpattern.README.md— "Model Hand-off via Shared Volume" section + harbor install pin.No changes to
adapter.pyortests/Dockerfile— the existing separate-verifiermachinery (pristine
/testsimage,_copy_eval_files, judge-from-/tests) isuntouched.
Validated end-to-end on Modal
Full trial of
posttrainbench-gsm8k-qwen3-1.7b(claude-code / claude-sonnet-4-6,agent budget reduced to 30 min for the test): 31m 9s total, zero exceptions,
reward 0.207.
harbor-fb557659f03e-modelobserved live on Modal mid-run; deleted after cleanup (Volume.objects.list()empty)final_modelon the volume/mnt/model, full 1,319-sample gsm8k evalaccuracy 0.2070 ± 0.011vs the official Qwen3-1.7B base-model gsm8k score of 20.4 (leaderboard, HTCondor pipeline) — a 0.3-point difference, well inside the eval's own ±1.1 stderr. The 30-min minimal SFT is expected to move the score barely, so landing this close to the base-model number is evidence the volume-fed eval reproduces the original pipeline's scoring, not an artifact of a different eval pathDependency
Requires Harbor's task-declared shared volumes feature:
harbor-framework/harbor#2603. Until it lands:
The feature is capability-gated in Harbor (docker + modal direct-sandbox mode);
tasks fail fast with a clear error on unsupported providers. Upstream validation:
5,434 unit tests passing (40 new for this feature), plus live smoke trials on both
docker and modal.