Add Harbor Framework Support - #8
Conversation
This comment was marked as duplicate.
This comment was marked as duplicate.
| RUN uv pip install --system --no-cache \ | ||
| accelerate \ | ||
| boto3 \ | ||
| bitsandbytes \ | ||
| datasets \ | ||
| evaluate \ | ||
| lm-eval \ | ||
| openai \ | ||
| pandas \ | ||
| scikit-learn \ | ||
| shortuuid \ | ||
| tokenizers \ | ||
| transformers \ | ||
| trl \ | ||
| peft \ | ||
| tiktoken \ | ||
| inspect-ai \ | ||
| matplotlib \ | ||
| certifi | ||
|
|
||
| # Note: flash_attn requires GPU to compile - install at runtime if needed: |
There was a problem hiding this comment.
pin versions like the current images
|
things that are remaining to get full parity with the original PTB implementation:
|
|
after discussing with Alex from Harbor/tbench:
|
|
Added modal storage for hf-cache for harbor in the branch Although there are some other changes as well, so you can probably clone the repo with this branch in another directory and ask your agent:
|
|
Also there is an upcoming change to the judge which will need to be integrated. Will post here. |
|
We need to hardcode baseline values to a json, instead of fetching them from the This is needed for harbor integration (harbor should output the baseline value, in case the judge flags the run). |
|
Merged main into Harbor branch, @rank-and-file maybe we should push the new judge to main soon so we can pull it here. The new judge would require some major changes for Harbor |
|
Apologies for lurking, but I noticed this comment:
In case it's useful, we have flash-attn kernels available on the Hub (link) which are matched to the hardware at runtime and skip the annoying / long / brittle install of |
Hey Lewis, thanks for your comment! I didn't know about this, it would be very useful for us, especially when running on cloud providers and having full parity with the local version. Adding it to our todo for Harbor :) |
…h Healthcheck and ENTRYPOINT, add log streaming and system monitor
updatePushed a substantial round of changes to the harbor adapter since last review. end to end run is now working at parity with our local pipeline for everything except verifier sandbox isolation, which is being addressed natively upstream (harbor-framework/harbor#1607). main changes
build
log streaming
timer (now reliable)Old design was New design (native Harbor healthcheck):
tamper resistance:
|
|
Hi @schneidergithub, currently the way artifact download works in harbor causes the runs to fail in PostTrainBench. Since we need to download the posttrained model weights to the host (and then upload them to the verifier sandbox for evaluation), the artifact download for the model weight fails because of the large size. The current way of downloading the artifacts for Modal is done via their SDK, and I think the file download through it is a bit flaky. We are now thinking of skipping the artifact download completely and instead use Modal volumes as persistent storage across the agent and the verifier sandbox. However there are some things that are missing in Harbor natively that would help in this:
|
|
hey @hrdkbhatnagar any timeline to have this PR merged? respect and appreciated 🙏 |
|
n00b q @hrdkbhatnagar , possible to let the verifier sandbox reuse the agent container? so that it avoids the weights download |
|
Sorry for the delayed response. The harbor maintainers are aware of this PR, just a crazy amount of work happening at the moment with trying to get some new benchmarks out in the next week or two. |
We are currently talking with Harbor folks to get native features relevant for this PR upstreamed very soon
Unfortunately we cannot allow that, as that's not how the original setup of the benchmark is, and that is by design. I talk about it more in my earlier comment in this PR #8 (comment) |
Thanks @hrdkbhatnagar that makes sense; Pier, a Harbor variant, supports the patch-isolation feature and maybe can use that, in case Harbor takes too much time to adopt this feature |
|
@hrdkbhatnagar have you considered using modal snapshots? Lets you pull only the files in a separate sandbox for verification. If your verifiers are not in the task harbor image then you can pull them from a registry during verification time as well. Though volumes are perfectly good as well, have noticed models sometimes don't save at the right location. |
…dal volumes instead of artifact transfer Harbor's artifact download caps files at 5 GiB on Modal, so the trained weights now reach the separate verifier via a shared Modal volume: a collect hook (ptb_collect.sh) copies final_model onto it after the agent exits and stages a size-budgeted code snapshot into /logs/artifacts for the contamination judge. The whole-workspace artifact is dropped. - test.sh reads the model from $PTB_MODEL_DIR and judges the snapshot - judge model gpt-5.1-codex -> gpt-5.4, claude-code CLI 2.1.76 -> 2.1.251 - run_modal_task.sh creates the per-run volume and launches the task - python-socks for Modal behind an HTTP proxy Validated on stock harbor 0.22.0: gsm8k/qwen3-1.7b 1h run scores 0.683 on the full benchmark (base 0.12), judge clears the run.
…o.json, eval fixes) into add_harbor_support
…, decontamination tool, opus_5 pins, fix agent env keys)
…d-off, judge tools, 5h verifier timeout)
….py; close codex stdin in the verifier judges)
…cli-version; document thinking-display difference)
…nch knobs; document judge-input and other-agent parity
…and allowed keys; tested end to end with zai/glm-5
73ebe78 to
839d155
Compare
Status update: end to end on Harbor, full v1.1 pipeline parityBig update since the last round: the adapter now runs the complete PostTrainBench v1.1 pipeline (new judging system) on stock Harbor 0.22 on Modal, with no Harbor patches, and has been tested end to end with Claude Code, Codex, and OpenCode. The model hand off (the old blocker) is now solvedThe The adapter now hands weights to the separate verifier through a shared Modal Volume instead:
Volumes are created per run by the v1.1 parity
Validation on Modal (all on Harbor 0.22)
Remaining / known differences
Full details and some known issues are in |
Adds Harbor framework support to PostTrainBench, enabling anyone to run our benchmark on cloud GPUs (Modal, Daytona) without needing access to our internal HTCondor cluster.
At the moment:
Tested:
Usage
See
src/harbor_adapter/README.mdfor detailed parity tracking. Key points:result.jsontimer.sh:Minor difference (created at task generation vs job start)Note: Right now I have skipped the installation of flash-attn in the container as we need to have a CUDA runtime for it. In modal the GPU is attached to the sandbox after the container is built, so installation doesn't occur.
Note: I have added a uv environment for us to use in PTB. This is used for using modal and harbor, and is useful in general for reproducibility
Todos: