Skip to content

feat: add CodSpeed benchmarks for core pipeline and models - #23

Merged
AzulGarza merged 1 commit into
mainfrom
feat/codspeed-benchmarks
Sep 11, 2026
Merged

AzulGarza merged 1 commit into
mainfrom
feat/codspeed-benchmarks

Conversation

@AzulGarza

@AzulGarza AzulGarza commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Add pytest-codspeed and a benchmark pytest marker, excluded from the default test run
  • Add core benchmarks (maybe_infer_freq, TimeSeriesDataset, QuantileConverter, SeasonalNaiveModel) and model benchmarks (Chronos-Bolt, TimesFM 1.0, Toto, Moirai 1.1)
  • Add a dedicated .github/workflows/codspeed.yml workflow with simulation (core) and walltime/macro runner (models) jobs

Test plan

  • uv run pytest tests/benchmarks/test_core.py --codspeed -m benchmark -o addopts=
  • uv run pytest tests/benchmarks/test_models.py --codspeed -m benchmark -o addopts=
  • Install CodSpeed GitHub App on TimeCopilot/foundationforecast before expecting CI reports
  • Confirm benchmarks-core and benchmarks-models jobs pass on this PR

Made with Cursor

Introduce pytest-codspeed benchmarks and a dedicated CI workflow to track
performance regressions in core utilities and a representative model subset.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codspeed-hq

codspeed-hq Bot commented Sep 11, 2026

Copy link
Copy Markdown

Congrats! CodSpeed is installed 🎉

🆕 8 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


Open in CodSpeed

@AzulGarza
AzulGarza merged commit 8e5e745 into main Sep 11, 2026
12 of 13 checks passed
@AzulGarza
AzulGarza deleted the feat/codspeed-benchmarks branch September 11, 2026 19:20
AzulGarza added a commit that referenced this pull request Sep 11, 2026
Document PR #23 after rebasing feat/model-weight-cache onto main.

Co-authored-by: Cursor <cursoragent@cursor.com>
AzulGarza added a commit that referenced this pull request Sep 11, 2026
* feat: add process-wide model weight cache for all forecasters

Reuse loaded checkpoint weights across repeated forecast() calls via a
global LRU cache (default max_cached_models=1). All local weight-loading
models accept reuse_loaded_model and expose clear_model_cache().

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: add model weight cache guide

Document reuse_loaded_model, set_max_cached_models(), clear_model_cache(),
and FoundationForecast clean_cache for long-lived GPU workers.

Co-authored-by: Cursor <cursoragent@cursor.com>

* release: v0.1.5

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: fix pre-commit formatting and docs link

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: fix model weight cache examples for mktestdocs

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: address cache review feedback and refresh gift-eval lock

Add thread-safe LRU eviction before load, bounded prefix cleanup, and
zero-capacity release paths. Include fallback models in clean_cache,
drop Toto/TimesFM v3 cache-key pitfalls, and refresh the editable
gift-eval lock metadata so CI benchmarks run against current source.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: fix mypy and pre-commit formatting

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: document reuse_loaded_model on all model constructors

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: coordinate concurrent cache loads and singleton init

Use per-key in-flight loading so concurrent misses share one loader,
evict outside the lock before loading, and protect cache singleton
creation with double-checked locking.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: add CodSpeed benchmarks to v0.1.5 changelog

Document PR #23 after rebasing feat/model-weight-cache onto main.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: sort uv.lock with toml-sort

Fix pre-commit toml-sort-fix failure after rebasing onto main.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
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