Skip to content

feat(serve): make BenchmarkResult sweep-aware for concurrency search runs#6098

Open
smouaa wants to merge 1 commit into
aws:masterfrom
smouaa:feat/benchmark-search-result-reader
Open

feat(serve): make BenchmarkResult sweep-aware for concurrency search runs#6098
smouaa wants to merge 1 commit into
aws:masterfrom
smouaa:feat/benchmark-search-result-reader

Conversation

@smouaa

@smouaa smouaa commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Issue / motivation
A concurrency search (--search-recipe) or magic-list sweep (--concurrency 1,10,100) benchmark does not produce a single top-level profile_export_aiperf.json. The benchmark container instead writes search_history.json at the artifact root plus per-trial profile exports nested in subdirectories.

BenchmarkResult.from_s3 matched profile_export_aiperf.json by filename suffix, so for a sweep it would either raise FileNotFoundError (no such root file) or — worse — silently return one arbitrary swept level's per-trial metrics as if they were the whole benchmark, since those per-trial files share the same name.

Changes
BenchmarkResult.from_s3 now checks for search_history.json first; when present it parses the sweep outcome instead of a headline profile.
New exported BenchmarkSearchResult dataclass: winning swept value (boundary_summary.feasible_max.value), the first constraint breach, and the raw history.
BenchmarkResult.search field + is_search property; str renders the sweep summary for search runs.
Single-run path is unchanged (regression-guarded by a test).

Testing
New unit tests: sweep layout parsing, the per-trial-filename collision, no-SLA-breach and null/absent boundary_summary edge cases, single-run regression guard, and str rendering.
pytest tests/unit/test_ai_inference_recommender/ → 154 passed; flake8 clean.

…runs

A concurrency search / magic-list sweep (--search-recipe or --concurrency
1,10,100) does not produce a single top-level profile_export_aiperf.json.
The benchmark container instead ships search_history.json at the artifact
root plus per-trial profile exports nested in subdirs. The existing reader
matched profile_export_aiperf.json by filename suffix, so for a sweep it
would either fail (no such root file) or silently return one arbitrary
level's per-trial metrics as if they were the whole benchmark.

BenchmarkResult.from_s3 now checks for search_history.json first and, when
present, parses the sweep outcome into a new BenchmarkSearchResult
(winning swept value from boundary_summary.feasible_max, the first
constraint breach, and the raw history). The single-run path is unchanged.

Adds BenchmarkSearchResult (exported), a BenchmarkResult.search field +
is_search property, and unit tests covering the sweep layout, the
per-trial-name collision, null boundary summaries, and the single-run
regression guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant