Skip to content

Add ci-proto foundation model adapter - #1

Merged
Benjamin-Walker merged 2 commits into
mainfrom
ci-proto
Nov 21, 2026
Merged

Benjamin-Walker merged 2 commits into
mainfrom
ci-proto

Conversation

@Benjamin-Walker

@Benjamin-Walker Benjamin-Walker commented Nov 21, 2026 •

Copy link
Copy Markdown

Add CIprotoAdapter for ContinuousIntelligence/ci-proto through continuousintelligence>=0.2.0, supporting a context window of up to 2 million observations and automatic selection between variants tuned for shorter and longer histories.

The adapter retains all supplied history by default (context_length=None). The backend's 16,384-observation threshold selects the tuned variant; it does not crop history. Shared foundation preprocessing, metadata and backtesting now accept unlimited history, while explicit positive context limits keep their existing behavior.

Support includes numeric, boolean, nullable and categorical past-only and known-future covariates, native quantile selection, lazy model loading, CPU/CUDA placement and Hub revision pinning. Each target is forecast independently, following the existing foundation adapter conventions. Capability and licence metadata, the user guide, release note, generated references and registration in the shared backend compatibility suite are included.

Unit tests use the existing shared lightweight Torch fixtures, while the shared backend compatibility suite exercises the real package and published weights. This avoids a macOS hang in the recording backend when copying the two-million-observation test context with a real PyTorch tensor. All history and covariate assertions are retained.

Validation

  • 1,229 regression tests passed with supported dependencies: 1,064 foundation-model cases (including 45 ci-proto cases), 116 ForecasterFoundation cases and 49 foundation-backtesting cases.
  • Full macOS unit-test matrix passed on Python 3.10, 3.11, 3.12, 3.13 and 3.14. Python 3.12 reported 7,882 passed, 44 skipped. A separate run of all 1,229 affected foundation tests also passed on macOS.
  • Existing shared real-backend contract and published-weight smoke suite: 10 passed, 1 skipped on both CUDA and an Ubuntu CPU runner. The skipped ignore-past-covariates case is inapplicable to this backend.
  • Fresh anonymous Hugging Face download through FoundationModel, without supplying model=, passed on two complete FEV tasks and exactly matched the injected-backend scores.
  • Paired comparison against the published nine-quantile paper XL export on 65 single-target FEV tasks, with a 16,384-observation context cap: 211,458 forecasts per path. All 122 sampled independent native forecasts matched exactly, and all metrics matched on the eight datasets containing one series. Across all 65 tasks, the geometric mean paired scaled-quantile-loss ratio was 1.0117247 (adapter 1.17% higher). The reference wrapper groups related series on the other 57 datasets; the adapter forecasts each series independently.
  • Regression coverage includes preserving explicit categorical types across differing historical and future category sets, and retaining full target/covariate histories at 20,000 and 2,000,000 observations.
  • Ruff, generated-reference and Git whitespace checks passed.

Validation environment: Python 3.13.14, continuousintelligence 0.2.0, torch 2.14.1+cu130, numpy 2.5.5, pandas 2.3.3, scikit-learn 1.9.1, pytest 9.2.0, NVIDIA H100 80GB. Published-weight smoke tests also passed on the GitHub Ubuntu CPU runner with torch 2.15.0+cpu. The FEV reference was pinned to Hub revision 350720e2dae262610ec6abb541177987d26f3347 and uses the nine-quantile export rather than the historical 99-head checkpoint.

The full 15-job unit-test matrix (Python 3.10 through 3.14 on Linux, macOS and Windows), minimum-dependency checks, and backend compatibility checks passed. The existing parallel Bayesian-search warning test needed one retry on Linux 3.13 and minimum dependencies; an isolated reproduction of the unchanged test body and fixture against the unchanged base commit also failed. Codecov uploads are the only remaining failed check and require a token configured for this fork.

@Benjamin-Walker
Benjamin-Walker merged commit 0423a51 into main Nov 21, 2026
47 of 50 checks passed
@Benjamin-Walker
Benjamin-Walker deleted the ci-proto branch November 21, 2026 16:19
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