-
Notifications
You must be signed in to change notification settings - Fork 23
feat: swe bench scorer #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tianmu-li
wants to merge
33
commits into
mlcommons:main
Choose a base branch
from
tianmu-li:feat/swe_bench_scorer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
e550d1e
feat: add swe-bench scorer
tianmu-li ad876df
fix: harden swe-bench scorer integration
tianmu-li e85f4c0
docs: document swe-bench scorer workers flag
tianmu-li cfa87a5
docs: require --mode both for swe_bench_scorer run examples
tianmu-li 00a360a
fix: pin litellm==1.91.0 in swe-bench accuracy subproject
tianmu-li 389c3ee
fix: address PR review comments on swe-bench scorer
tianmu-li 9d4fe57
fix: handle swe-bench setup timeouts
tianmu-li 71853e2
test: simplify swe-bench review coverage
tianmu-li 56a6a7c
fix: address swe-bench review comments
tianmu-li 9f6a966
fix: harden swe-bench review follow-up
tianmu-li 165b5dc
fix: address swe-bench review nits
tianmu-li e8548dc
Add service-backed SWE-bench scoring
tianmu-li 827f8e8
Add SWE-bench service cancellation and progress reporting
tianmu-li 916f39b
Clean up stale SWE-bench service artifacts
tianmu-li f295359
fix: resolve swe-bench rebase fallout
tianmu-li fa541d2
fix: serialize swe-bench run submission
tianmu-li a9732c2
test: fix accuracy scoring test context
tianmu-li 0d1df32
fix: address swe-bench review feedback
tianmu-li e65a8da
docs: remove redundant SWE-bench accuracy config
tianmu-li bf191e6
fix: address SWE-bench review follow-up
tianmu-li 71cdf8e
fix: restore inline performance scoring
tianmu-li feb66d9
fix: address remaining SWE-bench review feedback
tianmu-li 8e61bef
Address SWE-bench review findings
tianmu-li 6079043
Fix SWE-bench cleanup and tool validation
tianmu-li 455751a
Harden SWE-bench service configuration
tianmu-li 899c08c
Merge branch 'main' into feat/swe_bench_scorer
tianmu-li 7ecb12d
fix: address final SWE-bench review findings
tianmu-li 52d9f8d
docs: trim SWE-bench implementation comments
tianmu-li e69fe9e
fix: restore config-driven accuracy scoring
tianmu-li 606497d
fix: address remaining SWE-bench review findings
tianmu-li 72a81b8
fix: isolate SWE-bench subprocess environments
tianmu-li e9c1a6a
fix: skip external scorers in perf mode
tianmu-li a63957b
Merge remote-tracking branch 'upstream/main' into HEAD
tianmu-li File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # SWE-bench Accuracy Smoke-Test Runbook | ||
|
|
||
| End-to-end validation for the SWE-bench accuracy pipeline. Unit tests mock all | ||
| subprocesses, so running the real pipeline is the only way to catch Docker, | ||
| HuggingFace access, or mini-swe-agent wiring issues. | ||
|
|
||
| ## 0. Preconditions | ||
|
|
||
| - Docker daemon running on the SWE-bench service host. | ||
| - Docker Hub auth or a pre-seeded image cache on the service host. | ||
| - Network egress to PyPI and HuggingFace Hub from the service host. | ||
| - Endpoint URL reachable from the service host. | ||
| - `uv` binary on PATH (`curl -LsSf https://astral.sh/uv/install.sh | sh`). | ||
| - Parent endpoints env already synced (`uv sync --extra dev` from repo root). | ||
|
|
||
| ## 1. Start the SWE-bench service | ||
|
|
||
| From the repo root: | ||
|
|
||
| ```bash | ||
| uv run --project src/inference_endpoint/evaluation/swebench_service \ | ||
| python -m swebench_service --host 0.0.0.0 --port 18080 | ||
| ``` | ||
|
|
||
| Sanity check: | ||
|
|
||
| ```bash | ||
| curl http://localhost:18080/health | ||
| ``` | ||
|
|
||
| ## 2. End-to-end test (requires live endpoint) | ||
|
|
||
| Select the config for the model under test: | ||
|
|
||
| ```bash | ||
| CONFIG=examples/10_Agentic_Inference/qwen_agentic_benchmark.yaml | ||
| # For Kimi, use examples/10_Agentic_Inference/kimi_agentic_benchmark.yaml. | ||
|
|
||
| # PERF (default): agentic performance only; skips SWE-bench. | ||
| uv run inference-endpoint benchmark from-config --config "$CONFIG" | ||
|
|
||
| # BOTH: agentic performance followed by SWE-bench. | ||
| uv run inference-endpoint benchmark from-config --config "$CONFIG" --mode both | ||
|
|
||
| # ACC: SWE-bench only. | ||
| uv run inference-endpoint benchmark from-config --config "$CONFIG" --mode acc | ||
| ``` | ||
|
|
||
| Both configs include a performance dataset and the SWE-bench accuracy dataset. | ||
| The default `PERF` mode skips external evaluation, so it does not require a | ||
| running SWE-bench service. Client preflight and submission require `--mode acc` | ||
| or `--mode both`; `ACC` also skips the performance dataset. | ||
|
|
||
| Scorer preflight calls the service `/health` endpoint. It does not check Docker | ||
| or pre-pull images on the benchmark client. | ||
|
|
||
| The service is trusted infrastructure. It receives one endpoint URL and optional | ||
| endpoint credentials, runs Docker-backed evaluations, and serves artifacts. For | ||
| non-loopback deployments, bind it on a private network or start it with | ||
| `--auth-token TOKEN` and set | ||
| `accuracy_config.extras.swebench_service_auth_token: TOKEN`. | ||
|
|
||
| Qwen SWE-bench configs opt in with | ||
| `accuracy_config.extras.swebench_template: qwen_tools`. The service loads its | ||
| packaged Qwen template and activates `QwenToolsModel` through mini-swe-agent's | ||
| `model_class` hook. Omit this setting for Kimi and other non-Qwen runs. | ||
|
|
||
| ## Common failure modes | ||
|
|
||
| | Symptom | Likely cause | Fix | | ||
| | ------------------------------------ | ----------------------------------------- | -------------------------------------------------- | | ||
| | `swebench_service_url is required` | Client config missing service URL | Set `accuracy_config.extras.swebench_service_url` | | ||
| | Service health check fails | Service not running or unreachable | Start the service or fix client-to-service routing | | ||
| | Docker error during `run_evaluation` | Docker daemon not running on service host | Start Docker on the service host and retry | |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: "qwen-agentic-benchmark" | ||
| version: "1.0" | ||
| type: "online" | ||
|
|
||
| model_params: | ||
| name: "Qwen/Qwen3.6-35B-A3B" | ||
| temperature: 1.0 | ||
| top_k: 20 | ||
| top_p: 0.95 | ||
| repetition_penalty: 1.0 | ||
| presence_penalty: 1.5 | ||
| max_new_tokens: 8192 | ||
| chat_template_kwargs: | ||
| preserve_thinking: true | ||
|
|
||
| datasets: | ||
| - name: agentic_coding | ||
| type: performance | ||
| path: ./agentic_combined.jsonl | ||
| accuracy_config: | ||
| eval_method: agentic_inference_inline # required benchmark default. | ||
| agentic_inference: | ||
| turn_timeout_s: 14400.0 | ||
| enable_salt: true # do not change. | ||
| inject_tool_delay: true # do not change. | ||
| - name: swe_bench # Default PERF skips external evaluation; use ACC or BOTH. | ||
| type: "accuracy" | ||
| accuracy_config: | ||
| eval_method: "swe_bench_scorer" | ||
| num_repeats: 1 | ||
| extras: | ||
| swebench_service_url: "http://localhost:18080" | ||
| num_instances: 200 | ||
| workers: 10 | ||
| max_eval_workers: 10 | ||
| swebench_template: "qwen_tools" | ||
|
|
||
| settings: | ||
| runtime: | ||
| min_duration_ms: 0 | ||
| max_duration_ms: 36000000 | ||
|
|
||
| load_pattern: | ||
| type: agentic_inference | ||
| target_concurrency: 8 # Submission-specific concurrency. | ||
|
|
||
| endpoint_config: | ||
| endpoints: | ||
| - "http://localhost:30000" | ||
| api_type: openai | ||
|
|
||
| report_dir: logs/qwen_agentic | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/tianmu-li/endpoints/blob/e9c1a6a82ce999f3162c3574e48ce38bc99c8493/examples/10_Agentic_Inference/kimi_agentic_benchmark.yaml#L44-L46
I saw that Kimi's yaml has this warmup connection settings but Qwen does not, from the code, it looks like this will create a HTTP connection that "warms up" the connection from Endpoint client to the LLM server but does not seem to do much in this case. Kimi effectively does not send any request for this. I believe this should be the same for Qwen as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is to bypass some port/connection limit issue that Harshil faced during experiments. I haven't run into this issue from my end, hence not specifying them for Qwen to keep the example yaml minimal.