Repository navigation
[WIP] Adapter: InferenceBench - #71
zhumengzhiren wants to merge 7 commits into
Conversation
Generates the benchmark's 12 tasks from a pinned upstream commit. The oracle and parity have not been run yet. Signed-off-by: Yuanfan Chen <yuanfan0504@gmail.com>
Signed-off-by: Yuanfan Chen <yuanfan0504@gmail.com>
|
The offline checks look good at de70da23: all 27 tests passed, all 12 tasks generated, and 156 evaluator and scenario files matched upstream. Could you fix the speedup calculation before starting the GPU pilot? A run can currently contribute a speedup without a valid judge verdict. Both Let’s start with scenario A, seeds |
…vironment The verifier writes a reward only after the judge returns two valid verdicts. Otherwise the trial is ungraded: ungraded.json keeps the reason and the measurement, and the scorer counts it separately. INFERENCE_BENCH_JUDGE=off runs an unscored diagnostic. The oracle now loads upstream's vLLM runtime shims, without which it failed on every task. Each trial records its environment in verifier/environment.json, the model is pinned to a commit, and INFERENCE_BENCH_ORACLE=pytorch-reference recomputes the quality reference. Nothing has run on a GPU yet. Signed-off-by: Yuanfan Chen <yuanfan0504@gmail.com>
|
Thanks for the careful review. 4f3abbf addresses it; the PR description lists every change. Nothing has run on a GPU yet, so the pilot is still ahead. Judge gate. The verifier now writes One case does not get the 1× outcome. If an agent removes or renames its task directory, Harbor cannot run the collect hook or the verifier, because it runs both in that directory. The trial ends as an error without a reward, where the original would count a failed run. The scorer names the trial and reports no aggregate. I do not see a fix inside the task, because the hook has no option for its working directory. Oracle. The offline review could not show this: at de70da2 the oracle would have failed on every task. vLLM 0.11.0 does not start with the transformers release in upstream's lock, and upstream measures its vLLM baseline with runtime shims that the oracle did not load. It loads them now. The oracle is judged like any other run, and every configuration runs one trial at a time. Pins and records. The model repository is pinned to commit Quality reference. Proposed launch config
(cd src/inferencebench && uv run inferencebench --output-dir ../../datasets/inferencebench)
ib_run() {
uv run --project src/inferencebench --with 'harbor[daytona]==0.25.0' harbor run \
-c src/inferencebench/inferencebench_daytona.yaml -p datasets/inferencebench "$@"
}
# 0. PyTorch quality reference; not judged, not a benchmark trial (probably 1-2 H100-hours)
ib_run -i inferencebench-a-mistral-7b-21-1337 --ae INFERENCE_BENCH_ORACLE=pytorch-reference \
--ve INFERENCE_BENCH_JUDGE=off --agent-timeout-multiplier 3
# 1. Scenario A, seed pair 21:1337 (about 1 H100-hour)
ib_run -i inferencebench-a-mistral-7b-21-1337
# 2. Scenarios B, C, D of that seed pair (about 4.5 H100-hours)
ib_run -i 'inferencebench-[bcd]-mistral-7b-21-1337'
# 3. The other two seed pairs (about 11 H100-hours)
ib_run -x 'inferencebench-*-21-1337'
uv run --project src/inferencebench inferencebench-score --pool jobs/<job 1> jobs/<job 2> jobs/<job 3>Each stage starts only after the one before it has passed, and a trial passes with What blocks the pilot
Should the pilot run on Daytona or on Modal? |
|
On October 19, Harbor updated its new-task template to use a separate verifier by default. I noticed the tasks generated by this adapter still run the grader in the agent’s workspace. Could you switch them to a separate verifier and rerun the oracle on the latest stable Harbor release? Harbor #3712 If you find the full oracle run to be too costly time-wise or compute-wise, maybe you can start with rerunning one representative task? For that task, try the reference solution first, then with a submission you know is wrong. Once you are done, could you please share the task ID and both scores so we can check that the new verifier can grade submissions as expected? If you’ve already run parity or in the middle of running parity, could you keep the original submissions, agent logs, and grading results, preferably in your Hugging Face fork? If only the grading environment changes and those files contain everything the verifier needs, we may be able to regrade the saved submissions without running the agents again. |
Harbor's task template runs the verifier in its own sandbox by default since harbor#3712, and the review asked the adapter to do the same. Harbor now makes the verifier's sandbox from a copy of [environment], and the agent's work reaches it through the trial directory. collect.sh stops the agent's processes, removes known credential files, and packs /home/agent and the /tmp targets of the task directory's links into one tar stream in /var/lib/ib_handoff, which only root can write. task.toml declares the manifest and up to 40 parts of 2 GiB as artifacts, so Harbor moves each file on its own. Model files that the healthcheck downloaded and the agent left unchanged, and hard links to or copies of them, are recorded instead of packed; the verifier downloads the pinned revision again and puts them back. test.sh checks the hand-off and pipes the stream to handoff.py, which unpacks it as user agent, refuses members that would leave their destination or pass through a symbolic link, and keeps the hand-off closed to the agent's processes and the judge. environment.json records the GPUs of both sandboxes; a trial whose GPUs differ or are not H100s is graded with a warning, and the scorer lists it. The configurations target Harbor 0.26.0. Nothing has run on a GPU yet. Signed-off-by: Yuanfan Chen <yuanfan0504@gmail.com>
A review of the separate verifier found three cases that the tests did not cover. If collect.sh cannot finish packing, it now removes the parts, so that Harbor does not carry up to 80 GiB to a verifier that cannot use them. A /tmp target that is a hard link to an unchanged model file is put back as a copy: root keeps the /tmp snapshot for every server start, and a hard link would let the agent's processes change it through the file in the home. test.sh makes sure that the task directory exists when it ends, because Harbor starts its later commands there, also after a hand-off that could not be unpacked. The tests now change a model file in place without changing its size, which only the content hash detects, compare the whole home after the end-to-end run, and check that a failed pack leaves no parts. The README says which copies are recorded instead of packed and how to search the stream for a credential. Signed-off-by: Yuanfan Chen <yuanfan0504@gmail.com>
|
The CPU check for the oracle’s PyTorch reference path passed on our local machine. We started the PyTorch server with a small public model, sent it eight synthetic questions, and confirmed that all eight responses reached the scorer. On Modal, we tried the H100 oracle for We noticed that upstream gives each job a writable directory and mounts it at We’ve only checked these permissions on Modal, and another sandbox provider could have the same issue. Would you be able to run the same task on a Daytona H100 and share the trial’s |
The review ran the oracle for scenario A on a Modal H100. The hand-off reached the separate verifier and the judge passed, but vLLM, started as user agent, stopped with "Permission denied" at /tmp/xdg_cache/vllm: /tmp/xdg_cache already existed in a fresh sandbox of that image, owned by root with mode 0755. Upstream's image points the caches of the agent's tools at /tmp (XDG_CACHE_HOME and six more variables), and run_task.sh mounts a directory of the job's own user there and empties it before the final evaluation, so those directories can always be created. A sandbox's /tmp comes with the image, and whatever ran as root with the image's environment can leave one of them behind as root's. reset_cache_dirs (agent_tmp.sh) now makes each of them an empty directory of user agent: in the healthcheck, before the agent's budget starts, and in test.sh before the judge and again before the evaluation server. It only touches a name directly in /tmp, removes a link instead of following it, and fails the healthcheck or leaves the trial without a reward if it cannot replace a path. The verifier's eval.log names what it replaced. Not run in a sandbox: the tests run the function in a scratch tree with a stand-in for chown. Signed-off-by: Yuanfan Chen <yuanfan0504@gmail.com>
|
Thanks for running both checks, and for tracing the failure to the directory's owner. Yes: the server now gets writable cache directories, in both sandboxes. The fix is a347976. Cause. Upstream's image sets Fix. Checked. The 121 unit tests pass with Harbor 0.25.0 and 0.26.0. Three are new: two run the function in a scratch tree with a stand-in for Daytona. I can't run that trial yet. I still have no Daytona or Modal access with an H100 and no judge credential, as in my comment of November 16. Who should I ask for a Daytona key and a judge key? Once I have them, I'll run |
|
/review-adapter |
|
Structural validation of commit a347976 at 2026-12-01 04:00:04 UTC Adapter contract v1 ( ❌ Adapter Validation:
|
The dataset PR and the parity PR can exist only after the parity runs. The validator reports an empty list for them as an error and null as a warning, and /review-adapter skips its AI review when the validation has an error. With null, the validation of this adapter passes with 0 errors and 6 warnings; it had 2 errors and 4 warnings. Nothing in the adapter's code or in its generated tasks reads this file. Signed-off-by: Yuanfan Chen <yuanfan0504@gmail.com>
|
The two errors are the ab82754 sets both links to The commit changes only I can't trigger Still open from my last comment: I have no Daytona key with an H100 and no judge key, so I can't run the Daytona trial yet. |
Adds an adapter for InferenceBench (paper). It has 12 tasks (4 scenarios × 3 seed pairs). In each one, an agent deploys and optimizes an inference server for Mistral-7B-Instruct-v0.3 on one H100 within 2 hours. The score is the speedup over a naive PyTorch server.
No oracle trial has passed yet, so there is no pass evidence. On November 30 the reviewers ran the oracle for
inferencebench-a-mistral-7b-21-1337on a Modal H100 (comment): the hand-off reached the separate verifier and the judge passed, but the evaluation server could not start, because/tmp/xdg_cachebelonged to root in that sandbox. a347976 fixes that; the fix has not run in a sandbox. I have not run anything on a GPU myself, because I have no H100 sandbox and no judge credential. The staged oracle pilot from the review is described below.Status
Checked locally, without a GPU or a container runtime:
aisa-group/InferenceBench@108ec74.harbor lint(Harbor 0.26.0) reports onlyunpinned-image, for the base image in upstream's Dockerfile.scripts/validate_adapter.py(the version onmain) reports no errors and six warnings at ab82754. All six wait for the parity runs: the dataset and parity PR links, which arenulluntil those PRs exist, the two run lists, the parity cost, and the reproduction commands.collect.sh,test.sh, andagent_tmp.shpass shellcheck. A unit test runscollect.shand the hand-off step oftest.shfrom start to finish in a scratch tree, with stand-ins for the switch to useragentand for the model download, and checks that the agent's home comes back as the agent left it; others check that a missing or damaged hand-off gets no reward and that a pack that fails leaves no parts behind. The judge and evaluation steps oftest.share unchanged since 4f3abbf, for which they ran from start to finish in seven cases; a347976 only adds the two calls that reset the cache directories before them.huggingface_hubrelease (1.12.0): it caches a pinned commit, and a lookup by name finds it offline.Run by the reviewers on November 30 (comment):
inferencebench-a-mistral-7b-21-1337on Modal: Harbor moved the hand-off to the separate verifier, and the judge passed. vLLM, started as useragent, then stopped withPermission deniedat/tmp/xdg_cache/vllm, so nothing was measured./review-adapterat a347976 (result): the structural validation reported two errors, the empty dataset and parity PR links, so the AI review was skipped.Not run yet:
Changes since beb73ab
Found by the reviewers' Modal run:
/tmp. Upstream's image points the caches of the agent's tools at/tmp:XDG_CACHE_HOME=/tmp/xdg_cacheand six more variables. The original benchmark mounts a directory of the job's own user at/tmpand empties it before the final evaluation, so the agent and its server can always create those directories. A sandbox's/tmpcomes with the image, and in the Modal sandbox/tmp/xdg_cachealready existed as root's, so vLLM could not create its cache there. I could not find what created it: nothing in the Dockerfile or in the adapter's scripts writes to that path as root, so I suspect the image build or the sandbox's start.reset_cache_dirs(environment/agent_tmp.sh) now makes each of the seven an empty directory of useragent: in the healthcheck, before the agent's budget starts, and intest.sh, before the judge and again before the evaluation server. It touches only a name directly in/tmpand removes a symbolic link instead of following it. If it cannot replace a path, the healthcheck fails, or the trial ends without a reward, instead of a server that could not start being scored as 1×. The verifier'seval.lognames what it replaced. The healthcheck does it too because a server that the agent starts in its own sandbox would stop at the same directory.Found by
/review-adapter:dataset_prandparity_prinparity_experiment.jsonwere empty lists. The validator reports that as an error, and/review-adapterskips its AI review when the validation has an error. Those PRs can exist only after the parity runs, so ab82754 sets both tonull, which the validator reports as a warning. The adapter's code does not read this file, so the generated tasks are the same as at a347976.Changes from 4f3abbf to beb73ab
Requested in review:
environment_mode = "separate", so Harbor makes the verifier's sandbox from a copy of[environment]: the same image, GPU, resources, and variables. The evaluation restarts the agent's own server, so the agent's work is handed over:collect.shstops the agent's processes, removes known credential files, and packs/home/agent, and the/tmptargets of the task directory's links, into one tar stream in/var/lib/ib_handoff, which only root can write.task.tomldeclares the manifest and up to 40 parts of 2 GiB as artifacts. Harbor downloads each file on its own to the trial directory and uploads it to the same path in the verifier's sandbox, so no transfer passes through Harbor's directory archives or exceeds what Harbor can download from a Modal sandbox in one file (harbor#3924).collect.shchecks each against the content hash that the Hub names it after, and the verifier downloads the pinned revision again (29 GB) and puts the unchanged files back. Hard links to them and copies of the weight files are recorded instead of packed.test.shchecks the hand-off against its manifest, empties/home/agent, and pipes the stream tohandoff.py unpack, which runs as useragent. It refuses members that would leave their destination, pass through a symbolic link, or link to anything but a file of the stream; clears set-user-ID bits; and sets directory modes last. The hand-off itself stays closed to useragentand the judge. A missing, damaged, or foreign hand-off gets no reward.Found while making the change:
environment.jsonrecords the GPUs, memory, and driver of both sandboxes, whether they match, and whether both are H100s. If not, the verifier logs a warning andinferencebench-scorelists the trial; it is graded all the same.Changes from de70da2 to 4f3abbf
Requested in review:
reward.jsononly after the judge returned two valid verdicts. If the judge cannot run or fails three times, the trial is ungraded: the final evaluation still runs, as it does inrun_task.sh, andungraded.jsonkeeps the reason and the measurement, but there is no reward file. Without a judge credential the verifier skips the evaluation, so a forgotten key does not cost hours of GPU time. The diagnostic mode is explicit:INFERENCE_BENCH_JUDGE=offmeasures the server and leaves the trial unscored. A judged run that fails a gate, ships no working server, or is flagged keeps the paper's 1×.inferencebench-scorelists every trial as valid, failed (1×), ungraded, error, or reference; only the first two enter a mean, and it does not accept a reward whosejudge_validis not 1.inferencebench-score --poolscores the stages as one run.environment.json: GPU model, memory and driver, CPUs, memory, disk, the image's packages and CUDA toolkit, the packages that the server uses, the tokenizer's content hashes, the data checksums, and the judge's CLI version and model. It copies no credential and has five minutes, so a GPU that does not answer cannot hold up the verifier. Every judge attempt keeps its verdict files, and every evaluation attempt keeps its metrics.--ae INFERENCE_BENCH_ORACLE=pytorch-referencerecomputes the PyTorch reference inside a task's image as upstream'srun_precompute_all_baselines.shdoes for the torch backend: upstream's reference server andprecompute_quality_baselineat concurrency 1, on the cached question set whose checksum the image build verifies. The packages of upstream's torch baseline container go into a virtual environment under upstream's lock, so that torch loads the CUDA libraries it was installed with, as in upstream's container; the run records the libraries that torch loaded and stops if any comes from elsewhere.Found in my own reviews:
src/eval/inference/runtime_shims), and the oracle now loads the same shims. I reproduced the failure and the fix with transformers 5.4.0 and a copy of vLLM's function. At de70da2 the oracle would have failed on every task.agent's processes with a checked, retried kill before root goes on. It takes ownership of/testsand/logs/verifier, starts the evaluation server and the judge withno_new_privs, and builds its requests from a copy of the tokenizer that only root can write. These still apply in the separate verifier, where the agent's server and the judge's CLI run as useragent.inferencebench-scorereads only Harbor's trial results and the verifier's own files, and it reports the aggregate only for a complete 4 × 3 run. The adapter refuses a modified copy of the pinned upstream checkout, and it records another checkout's commit with-dirtyif its files differ.Design notes
Oracle. Upstream ships no reference solution, and the score is an unbounded speedup. The oracle installs vLLM 0.11.0, uses upstream's untuned
vllm_runninglauncher, and then goes through the sametest.shas an agent, including the judge. A trial passes ifvalidandjudge_validare 1. The paper's "vLLM default" row (A 1.25×, B 2.25×, C 48.69×, D 1.96×) is a sanity check, not a threshold.Verifier. The final evaluation runs in a separate sandbox, which receives the agent's home through the trial directory; the "Separate verifier" note in the README describes the hand-off. Upstream's own adapter also uses a second sandbox, and passes
/home/agentthrough a Modal volume. Two limits remain:Oracle pilot
One trial at a time with Harbor 0.26.0, on one H100 with 16 CPUs, 180 GB of memory, and 400 GB of disk per sandbox:
The estimates for stages 2–4 assume the paper's vLLM default numbers, and each trial's verifier also spends a few minutes downloading the model. The commands are in the README under "Oracle pilot" and "Recomputing the PyTorch quality reference".