Skip to content

wall time and cost#27

Merged
TianyiPeng merged 3 commits intomainfrom
overhead_modelselection
Mar 20, 2026
Merged

wall time and cost#27
TianyiPeng merged 3 commits intomainfrom
overhead_modelselection

Conversation

@Wenyueh
Copy link
Copy Markdown
Collaborator

@Wenyueh Wenyueh commented Mar 20, 2026

Summary

Track wall-clock time and actual API cost of the model selection process on SelectionResults
Cached (reused) responses are excluded from cost calculation — only fresh API calls count
Wall-clock time naturally reflects savings from parallel execution
Both metrics are displayed in the summary table output

Test plan

All 45 existing tests pass
Run a selection with warm cache and verify selection_cost drops to ~$0 while per-combo prices remain unchanged
Run with parallel=True and confirm selection_wall_time_seconds reflects actual elapsed time (not sum of sequential times)

@Wenyueh Wenyueh linked an issue Mar 20, 2026 that may be closed by this pull request
@Wenyueh Wenyueh requested review from TianyiPeng and Copilot and removed request for TianyiPeng March 20, 2026 02:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds selection-level wall-clock timing and total selection cost reporting to model selection results, so users can see end-to-end overhead in addition to per-model accuracy/latency/price.

Changes:

  • Extend SelectionResults with selection_wall_time_seconds and selection_cost.
  • Print selection overhead in the SelectionResults.__str__() summary output.
  • Measure wall time and compute aggregate (non-cached) cost in BaseModelSelector.select_best().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/agentopt/model_selection/base.py
Comment thread src/agentopt/model_selection/base.py Outdated
Comment thread src/agentopt/model_selection/base.py
Comment thread src/agentopt/model_selection/base.py Outdated
Wenyueh and others added 2 commits March 19, 2026 22:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TianyiPeng TianyiPeng merged commit d1d795a into main Mar 20, 2026
@TianyiPeng TianyiPeng deleted the overhead_modelselection branch March 20, 2026 03:02
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.

panel to present cost and time recording for the optimization process

3 participants