Repository navigation
feat(evals): add SPACE text map sketching with official scoring - #4540
kellyang135 wants to merge 13 commits into
Conversation
Reuse SingleCallAgent for original-question requests without observations or tools. Allow explicit request limits and close owned tracing clients. Cover both OpenAI request formats, failures, timeouts, and existing eval agents.
Acquire pinned SPACE inputs and run a fixed subset through EvalRunner. Score saved replies with the unmodified official evaluator. Include setup instructions and tests for acquisition, scoring, and failures.
|
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #4540 +/- ##
==========================================
+ Coverage 80.44% 80.56% +0.12%
==========================================
Files 1655 1675 +20
Lines 155298 156914 +1616
Branches 13120 13245 +125
==========================================
+ Hits 124922 126424 +1502
- Misses 26830 26921 +91
- Partials 3546 3569 +23
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
| raise SystemExit(128 + signum) | ||
|
|
||
|
|
||
| def main(argv: Sequence[str] | None = None) -> int: |
There was a problem hiding this comment.
I don't think we should have random executable files in the repo.
It's best to add it as a subcommand in dimos. Something like dimos evals setup space (just an idea, not sure about the exact command).
| return reader.bytes_read | ||
|
|
||
|
|
||
| def setup(paths: SpacePaths) -> dict[str, Any]: |
There was a problem hiding this comment.
I don't think we should be cloning repos. A better alternative is for us to package their repo and publish it to PyPI.
It looks like they don't even specify versions for their dependencies: https://github.com/apple-aiml-research/ml-space-benchmark/blob/main/requirements.txt . This is bound to give us headaches in the future.
There was a problem hiding this comment.
ok, I understand! I’ve prepared and tested the SPACE package and updated dimOS to depend on it, following the edgetam-dimos approach I saw in a previous PR.
Where would you like me to submit the packaging changes for review and a PyPI release?
There was a problem hiding this comment.
Maybe just link it here, I'll have a quick look.
But yes, please release to PyPI. (For the package name, you usually want to prefix/suffix it with your name/identifier so an official version of SPACE can be released by them if they choose to.)
There was a problem hiding this comment.
So here is the published ml-space-benchmark-ky135 0.1.1; package source and docs. It preserves Apple’s SPACE source and adds dependency version bounds.
This PR now installs it through the space extra instead of cloning the repository.
| ] | ||
|
|
||
| # Benchmark dependencies for SPACE runs and self-hosted integration tests. | ||
| space = [ |
There was a problem hiding this comment.
I don't think we should list their dependencies. It's best to package their repo and publish it to PyPI and just depend on the package.
| state = ProviderState() | ||
| state.release.set() | ||
|
|
||
| class Handler(BaseHTTPRequestHandler): |
There was a problem hiding this comment.
You can use httpx.MockTransport like test_llm_trace.py instead of creating an HTTP server
hvent90
left a comment
There was a problem hiding this comment.
Really good. Left a few comments. Thanks for the great PR, Kelly!
| from dimos.evals.agents.base import Agent | ||
|
|
||
|
|
||
| class Prompt(Environment): |
| max_output_tokens: int | None = Field(default=2048, gt=0) | ||
|
|
||
|
|
||
| class TextQuestion(SingleCallAgent): |
There was a problem hiding this comment.
Let's have SingleCallAgent fulfill this role - just taking in the prompt with no special processing and sending it to the LLM provider. I don't think we need to throw an error if streams or mcp_urp exist, it will just ignore it.
And then dimos/evals/agents/question_answer.py extends SingleCallAgent and continues to do the processing of streams and adding that to the request sent to the LLM
|
|
||
| ```bash skip | ||
| uv sync --locked --no-default-groups --extra space | ||
| uv run --no-sync dimos evals setup space |
There was a problem hiding this comment.
Lets co-locate functionality with the domain by doing [noun] [verb] sequencing, so it would be:
dimos evals space setup
dimos evals space score
Why do we need this?
Map sketching tests how a model combines observations from a walk into an
overhead layout. SPACE's text presentation fits the existing eval framework
and provides objective grading without an image pipeline or simulator.
What is this feature?
Adds SPACE's
MapSketchingBEVTexttask toEvalRunnerwith a fixed 20-questionsubset. The prompt-only agent reuses dimOS's single-call and tracing path;
questions and answer order are unchanged.
The
spaceextra installsml-space-benchmark-ky135==0.1.1, an unofficialpackage of unchanged upstream source. Setup verifies the installed scorer and
downloads pinned task data. SPACE's unmodified evaluator scores saved replies.
An
exclude-newer-packageexception permits this new release under therepository's seven-day cutoff; the version remains pinned.
See task selection and setup.
How to manually run this
With Linux or macOS, Python 3.12, and an OpenAI API key configured:
Setup prints the 20 selected cases. Use the directory printed by the run
command for scoring. The score command writes
report.jsonin a newspace-score-*subdirectory with the official accuracy, per-case scores, andinvalid-response and failure counts. Scoring makes no provider calls.
Evaluation report
Configuration:
gpt-5.6-lunaalias, medium reasoning, a 16,384-token output cap,original question only, no system prompt or tools, zero retries, and a 60-second
provider timeout.
The fixed subset contains two variants of each of ten layouts, balanced across
answer positions. Official accuracy was 20/20 (100%) in one recorded model
run, with no invalid replies, timeouts, or infrastructure failures. These related
cases do not establish performance across SPACE.
The output cap was increased after a lower cap produced truncated replies
without answers. Repeat runs at intermediate caps would test token efficiency;
evaluating the remaining task variants would extend coverage beyond this subset.
Which issue(s) does this PR close?
Addresses #3399.
Checklist