Skip to content

feat(models): add TimeH2O (h2oai/timeh2o-v1) - #77

Merged
AzulGarza merged 10 commits into
mainfrom
feat/timeh2o
Oct 26, 2026
Merged

AzulGarza merged 10 commits into
mainfrom
feat/timeh2o

Conversation

@AzulGarza

@AzulGarza AzulGarza commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Adds a TimeH2O wrapper for H2O.ai's TimeH2O via the h2ofm package (fev-bench #3 by skill score, #1 by win rate; zero-shot on GIFT-Eval). Also adds replication on GIFT-Eval and fev-bench against the official results.

Library

  • foundationforecast/models/timeh2o.py: forecast / CV / anomalies, quantiles and level, and native known-future exog (future_covariates) on h2oai/timeh2o-v1. Non-numeric covariates keep their dtype, so h2ofm encodes them as categorical. h2oai/timeh2o-v1-tiny has no covariate support and raises with X_df. Requested quantiles are passed straight through: h2ofm extrapolates outside its 0.1 to 0.9 grid with Gaussian tails.
  • clip_nonnegative and snap_integer options (off by default, as in h2ofm). The official runs enable both.
  • Dependencies: h2ofm>=0.43.0 (Python >= 3.12 only) and timecopilot-timesfm>=0.4.1, which drops the safetensors<0.6 cap that conflicted with h2ofm (TimeCopilot/timesfm#1).
  • Tests: both checkpoints are registered in tests/models/conftest.py (py >= 3.12) for the cross-model suite. tests/models/test_timeh2o.py has mocked tests plus a live smoke test on tiny.
  • Docs: model hub, API reference, exog table, README matrix and license notes.

Replication

  • GIFT-Eval: h2oai--timeh2o-v1 and -tiny in configs/models.yaml, against results/TimeH2O-v1* in the official Space. Settings match the official notebook: context 16384, batch 64 / 128, clip_nonnegative and snap_integer on. CI subset: v1 on m4_weekly/short.
  • fev-bench: h2oai--timeh2o-v1 against timeh2o-v1.csv, with the settings from the official models/timeh2o-v1/model.py. CI subset: epf_pjm and entsoe_1H.
  • Modal Python per model: a models.yaml entry can set python: "3.12". Both harnesses build a 3.12 image with its own Modal function and route jobs by that field. Every other model stays on the existing 3.11 image, so their environment is unchanged.

Notes

  • Gated, non-commercial weights. The HF_TOKEN accounts used by GitHub CI and by the Modal hf-secret must accept the terms on timeh2o-v1 and timeh2o-v1-tiny.
  • Not run locally against real weights (no HF token here). Local runs covered the wrapper's mocked tests, the experiment config tests, the Modal app imports and pre-commit. The rest, including the Modal replication runs, is left to CI.

AzulGarza and others added 4 commits October 26, 2026 12:20
….4.1

timecopilot-timesfm 0.4.1 drops the safetensors<0.6 cap, which conflicted
with h2ofm's safetensors>=0.6.2.

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

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 18:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@codspeed

codspeed Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 10.86%

1 warning, 1 note

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

ℹ️ 13 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

⚡ 1 improved benchmark
✅ 16 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ CPU Simulation test_timeseries_dataset_from_df_with_panel 45.5 µs 41 µs +10.86%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/timeh2o (4775113) with main (5d833ee)

Open in CodSpeed

AzulGarza and others added 5 commits October 26, 2026 12:35
Expose clip_nonnegative and snap_integer (enabled in the official
GIFT-Eval and fev-bench runs) and pass covariate rows with their dtype so
h2ofm encodes non-numeric ones as categorical.

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

Co-authored-by: Cursor <cursoragent@cursor.com>
Models can set python in models.yaml; Modal dispatches them to a
Python 3.12 image (h2ofm requires 3.12+) while the rest stay on 3.11.

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

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.77778% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
foundationforecast/models/timeh2o.py 97.61% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

codspeed Bot commented Oct 26, 2026

Copy link
Copy Markdown

Unable to generate the performance report

Your organization has exceeded its Macro Runners budget. Because this run uses tokenless mode, CodSpeed needs to wait for the GitHub Actions workflow to complete to validate the upload. Since the walltime jobs will never run, the workflow stays pending and we are unable to process this run.

To run these benchmarks again, update your plan or increase your Macro Runners budget.

If you need help, please contact us at support@codspeed.io or on Discord.

@AzulGarza
AzulGarza marked this pull request as ready for review October 26, 2026 20:51
@AzulGarza
AzulGarza merged commit eaf044d into main Oct 26, 2026
10 of 13 checks passed
@AzulGarza AzulGarza mentioned this pull request Oct 26, 2026
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.

2 participants