Model Name: theforecastingcompany/t0-alpha
Revision: 31fae62d01db93a48d6922e015bca56f666e84d2 (main)
Model Weight URL: https://huggingface.co/theforecastingcompany/t0-alpha
Library: tfc-t0==0.3.0
Task Type: probabilistic time-series forecasting (quantile forecasting foundation model)
Architecture Family: Patched-Transformer (Toto-inspired) - Time-Series / Foundation Model
Pipeline Tag: time-series-forecasting
Weights: model.safetensors (~820 MB, 101.6M params, embed_dim=512, num_layers=24, patch_size=32)
License: Apache-2.0
T0-alpha is a pretrained probabilistic forecasting foundation model from The Forecasting Company. It predicts future quantiles (0.1,0.25,0.5,0.75,0.9) trained on diverse time-series; at inference it interpolates to requested quantiles (0.1,0.5,0.9). Input is [B, T] or [B, V, T] context, output is quantile forecast [B, horizon, Q] and median [B, horizon]. Uses CausalScaler (mean/std + arcsinh) and PatchEncoder+Transformer with Group Attention every 3 layers.
Gated Note:
theforecastingcompany/t0-alphais gated (gated: auto) on Hugging Face. This submission validates the Ascend NPU execution path with the published architecture (T0Config.medium()). When a validmodel.safetensorsis present atworking/models/t0-alpha/, it is loaded; otherwise a deterministically seeded random-initialized checkpoint with identical architecture is used to prove NPU compilation and numerical consistency. Device, dtype, and compute graph are identical in both paths; only the weight values differ, and the NPU vs CPU consistency remains exact.
| Field | Value |
|---|---|
| Input Format | [batch, time] or [batch, variates, time] - e.g. [2, 128] |
| Axis Order | B T (batch, time) - flattened to [B*V, T] internally |
| Context Length | 128 (demo) - model supports arbitrary context (patch_size=32, padded to multiple) |
| Prediction Length (horizon) | 32 |
| Variates | 1 (univariate per sample, 2 samples → 2 series jointly but independent group_ids) |
| Frequency | Agnostic - continuous time, no explicit frequency token |
| Scaling | CausalScaler(patch_size=1, use_arcsinh=True) per time-step causal normalization |
| Mask Handling | NaN → MaskType.MISSING (0.0 after nan_to_num), only all-PAD patches are not attended |
| Future Covariates | None in demo (supports [B, F, T+horizon] future covariates, mutually exclusive with group_ids) |
| Dtype | float32 (model weights fp32, bf16/fp16 would autocast forward) |
| Preprocessing | torch.randn(2,128)+trend synthetic: trend linspace(0,1,128) + N(0,0.5), seed 42 deterministic |
| Data Source | Synthetic time-series - no external CSV, reproducible with seed 42 |
| SHA256 | Synthetic - no dataset file (deterministic generation) |
| Output | Forecast.quantiles [B, horizon, Q] and Forecast.median [B, horizon] - float32 finite, quantile monotonic |
| Quantiles Requested | (0.1, 0.5, 0.9) - interpolated from trained (0.1,0.25,0.5,0.75,0.9) |
No fit() required - zero-shot forecasting. Table-like tabular framing: each time-step is a feature, series is a row.
torch.npu.is_available()==True, device_count 2, device_name Ascend910_9362, target npu:0npu-smi info and scripts/check_npu.pyworking/models/t0-alpha (gated, no checkpoint cached) → fallback random init validatedpip install -r requirements.txt
# requires: torch, torch_npu, numpy, safetensors, einops, jaxtyping, rotary-embedding-torch, huggingface_hub, tfc-t0No extra download needed if using random init fallback; for real weights place model.safetensors at working/models/t0-alpha/model.safetensors ( gated - requires HF access acceptance) then inference.py auto-loads it.
Default command (verified on npu:0):
python inference.pyExpected log excerpts:
[model] theforecastingcompany/t0-alpha[device] npu_available=True device_count=2 device_name=Ascend910_9362[param] first param device: cpu → [npu] model moved to npu:0[input] context shape (2, 128) sample values[cpu] quantiles shape (2,32,3) median sample[npu] quantiles shape (2,32,3) median sample on npu:0[npu] first run (compile+infer) ~520 ms second run ~40 ms with torch.npu.synchronize()[perf] 10 runs avg ~35 ms throughput 56 series/s[consistency] median max_abs ~5e-06 PASS[status] NPU inference SUCCESS on npu:0Supports [B, V, T] multivariate and [B, F, T+horizon] future_covariates (validated via T0Forecaster.predict API).
Run: python inference.py (batch=2, context=128, horizon=32, quantiles 0.1/0.5/0.9, float32, npu:0, seed 42)
Input:
context[0,:5]=[0.9634,0.7515,0.4661,-1.0291,0.3707], shape [2,128], dtype float32CPU:
median[0,:5]=[1.39475,1.67661,7.33277,2.09579,1.11875]quantiles[0,0,:]=[0.4447,1.39475,2.66427]NPU (npu:0):
median[0,:5]=[1.39475,1.67661,7.33277,2.09579,1.11875] (diff vs CPU max 5e-06)quantiles shape [2,32,3] finite True, monotonic True (q0 <= q1 <= q2)Timing (npu:0, torch.npu.synchronize):
No CPU fallback; all compute tensors on npu:0; scaler.py warning about internal format is benign.
Saved CPU vs NPU quantile tensors to .npy and compared:
python .opencode/skills/npu-adapt-skills/scripts/compare_outputs.py --cpu /tmp/t0_cpu.npy --npu /tmp/t0_npu.npy --task regression --atol 1e-4 --rtol 1e-3
# {"task":"regression","cpu_shape":[2,32,3],"npu_shape":[2,32,3],"max_abs_error":3.8e-05,"mean_abs_error":2.3e-06,"passed":true}Manual median check: max_abs 5e-06 mean 1.5e-06 PASS at atol=1e-4 rtol=1e-3 (FP32). Single-window smoke consistency - not full GIFT-Eval benchmark.
| Metric | Value |
|---|---|
| Compile / First Run | 523.27 ms |
| Second Run | 40.38 ms |
| Avg (10 runs) | 35.44 ms |
| Min / Max | 34.82 / 38.00 ms |
| p50 / p90 / p95 | 35.00 / 36.81 / 37.41 ms |
| Batch Size | 2 |
| Shape | [2,128] → [2,32,3] (quantiles) |
| Dtype | float32 |
| Throughput | 56.4 series/s (windows/s) |
| Peak Memory | NPU HBM 3106 MB baseline (model 387 MB) |
Timing measured with torch.npu.synchronize() before/after; first run includes compilation.
All three PNGs are generated by xterm.js (scripts/render_xterm_evidence.mjs --style raw) from real terminal logs; not manual screenshots or Matplotlib renders.
assets/agent_workflow.png - reconnaissance, env check, install, config, NPU inference, consistency, validationassets/npu_device_call.png - npu-smi info, check_npu.py, device name, param device npu:0, input/output deviceassets/model_result.png - default python inference.py full log with sync timing and SUCCESS

theforecastingcompany/t0-alpha) not publicly downloadable without HF access approval; fallback validates NPU path with identical architecture.patch_size (32) and horizon ≥1; longer horizon triggers rollout manager (iterative decoding).torch_npu; CPU fallback is considered failure.#NPU #Ascend #Ascend910 #time-series-forecasting #tfc-t0