Downloads · 30 days
49
35% of all-time downloads
theforecastingcompany/t0-alpha-onnx-fp16
t0-alpha-onnx-fp16 is a time series forecasting model from theforecastingcompany. Use it for the time series forecasting task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as apache-2.0.
<p align="center" <img class="dark:hidden" src="https://www.theforecastingcompany.com/logo/logohorizontallight.png" alt="The Forecasting Company" width="280" / <img class="hidden dark:block" src="https://www.theforeca…
Downloads · 30 days
49
35% of all-time downloads
All-time downloads
141
Public
Repo size
828 MB
Likes
0
Public
Click a slice to open those files.
.onnx204 MB · 100%
From the Hugging Face model README
This first-party ONNX export stores FP16 weights and uses FP32 calculations. It preserves the grouped, dynamic interface of the INT8 graph.
Update (2026-10-18): numerical fix. This revision fixes a float32 precision issue in the graph's built-in input normalization. It affected long histories whose values sit far from zero relative to how much they vary (for example, a sensor reading about 50,000 that moves by less than 1): earlier revisions could return shifted or badly scaled forecasts for such series, and in extreme cases non-finite values. The input/output interface is unchanged. We recommend updating if you use an earlier revision; see CHANGELOG.md.
Model family: t0-alpha (PyTorch/MLX) · ONNX FP16 · ONNX INT8 · Collection
This derivative is intended for local ONNX Runtime inference. Provider coverage and accuracy should be
validated on the target hardware before deployment. For production or
consequential use, we recommend
t0-alpha. Provided
as-is.
CPU and WebGPU usage notes are below. Other accelerator providers have not been validated for this replacement.
| Artifact | Size | Purpose |
|---|---|---|
t0-alpha-grouped-fp16.onnx | 204.0 MB | FP16 weights, FP32 compute |
| Input/output | Type | Shape | Notes |
|---|---|---|---|
target_context | float32 | [target_rows, context] | Use NaN for missing observations |
target_group_ids | int32 | [target_rows] | Rows with the same id attend jointly |
future_covariate_context | float32 | [covariate_rows, context] | Historical portion of known-future covariates |
future_covariate_future | float32 | [covariate_rows, compute_horizon] | Values known over the forecast horizon |
future_covariate_group_ids | int32 | [covariate_rows] | Associates each covariate with a target group |
quantiles | float32 | [target_rows, compute_horizon, 5] | Levels 0.1, 0.25, 0.5, 0.75, 0.9 |
The graph uses ONNX opset 20. Its public inputs and output remain float32 so callers can switch between the FP16 and INT8 artifacts without changing their data preparation.
The compute horizon is determined by the width of
future_covariate_future, which must be a multiple of 32. To request 50 steps,
pass a width of 64 and keep the first 50 outputs. Context length is
independently flexible and is left-padded to a patch boundary internally. The
graph does not include autoregressive rollout beyond 1024 steps.
Group ids need not be contiguous. Give target and covariate rows the same id when they belong to the same multivariate series. If no known-future covariates are available, pass covariate arrays with zero rows; the horizon dimension is still retained.
import math
import numpy as np
import onnxruntime as ort
target_context = np.asarray([1.0, 1.3, 1.2, 1.7, 2.1], dtype=np.float32)[None, :]
target_group_ids = np.asarray([0], dtype=np.int32)
horizon = 24
compute_horizon = math.ceil(horizon / 32) * 32
future_covariate_context = np.empty((0, target_context.shape[1]), dtype=np.float32)
future_covariate_future = np.empty((0, compute_horizon), dtype=np.float32)
future_covariate_group_ids = np.empty((0,), dtype=np.int32)
session = ort.InferenceSession(
"t0-alpha-grouped-fp16.onnx",
providers=["CPUExecutionProvider"],
)
quantiles = session.run(
None,
{
"target_context": target_context,
"target_group_ids": target_group_ids,
"future_covariate_context": future_covariate_context,
"future_covariate_future": future_covariate_future,
"future_covariate_group_ids": future_covariate_group_ids,
},
)[0]
forecast = quantiles[:, :horizon, :]
The example uses CPU. For the tested browser WebGPU configuration, see below.
Native validation compared 66 synthetic series/context/horizon cases against the reference PyTorch implementation with ONNX Runtime 1.29.0. They cover contexts 1–4096, horizons 32–1024, missing values, and long histories with a large level and small variation. Outputs were finite and ordered. The worst per-series mean drift was 0.048% and the worst point drift 0.45%. Drift is absolute error divided by the reference series' full forecast range across the horizon and all quantiles, not relative error on an individual prediction.
Browser validation passed 16 cases for this exact artifact: 8 fixtures
each on single-thread WASM and WebGPU (with the supplied webgpu-options.js), with ONNX Runtime Web
1.29.0, Chromium 152 and Apple Metal 3. Fixtures cover contexts 1, 33, 97, 512 and 4096, horizons 32,
64 and 1024, and two long histories with a large level and small variation. Browser outputs matched
native CPU outputs at rtol=0.001, atol=0.001, with no non-finite values or quantile crossings.
These checks measure numerical consistency, not forecasting accuracy. Other hardware has not yet been validated.
Thanks to Siddharth7113/tsfm-onnx
for their Apache-2.0 ONNX export work, which informed parts of this export.
Apache-2.0. See LICENSE.
The same ONNX file supports CPU and WebGPU. For WebGPU, use the accompanying
webgpu-options.js, which keeps affected mask operations
and integer shape calculations on WASM and folds constant weight expansion. Use the helper from
the same revision as the model. Use WASM when WebGPU is unavailable.
import * as ort from "onnxruntime-web/webgpu";
import { webgpuOptions } from "./webgpu-options.js";
const session = await ort.InferenceSession.create(modelBytes, webgpuOptions);
Weights are stored in FP16, while calculations and expanded runtime weights use FP32. This reduces download size, not runtime weight memory. Predictions can differ from the previous export. See CHANGELOG.md.