time-series-forecasting · 7-channel multivariate PatchTST · 512 → 96 horizon · q8 · WASM · 0.77 MB
IBM Granite Time-Series PatchTST
IBM's Granite PatchTST
(ibm-granite/granite-timeseries-patchtst,
Apache-2.0) packs a 3-layer channel-independent Patch-12 Transformer into just
0.77 MB (q8 ONNX — 27× smaller than Timestral-5M). In a single
~14 ms CPU WebAssembly pass, it turns a 512-step × 7-channel lookback
window into a synchronized 96-step × 7-channel forecast right in your browser.
1 · On-device model (0.77 MB q8 WASM)
2 · Interactive 7-Channel Multivariate Telemetry Forecaster
Choose one of four deterministic 7-sensor scenarios — or upload your own 1-to-7 column CSV/TSV/JSON file.
Granite PatchTST forecasts all 7 channels simultaneously with built-in per-channel
scaling: "std" standardization.
Prepare Granite PatchTST above to forecast all 7 channels in ~14 ms on CPU WASM.
Move your pointer across the +1..+96 forecast region (or click) to inspect step-by-step predictions.
3 · Model Card at a Glance & Source Code
| Upstream checkpoint | ibm-granite/granite-timeseries-patchtst (Apache-2.0) |
|---|---|
| Browser ONNX repo |
onnx-community/granite-timeseries-patchtst
· onnx/model_quantized.onnx (773,922 B · 0.77 MB q8)
|
| Task & architecture |
time-series-forecasting · PatchTSTForPrediction (3 layers, 16 heads, d_model=128, ffn=512, BatchNorm, GELU, sincos PE)
|
| Patching & channels |
context_length=512, prediction_length=96, num_input_channels=7,
patch_length=12, patch_stride=12 (42 patches + [CLS] = 43 tokens),
channel_attention=false, scaling="std"
|
| Execution backend |
@huggingface/transformers@3.7.5 · CPU WASM (device: "wasm", dtype: "q8") · off main thread in Web Worker
|
| Pretraining benchmark |
Trained on ETTh1 (7 hourly electrical transformer channels: HUFL, HULL, MUFL, MULL, LUFL, LULL, OT);
reported test-split MSE 0.3881 on 512→96 forecasting.
|
</>
Show the code · AutoModel.from_pretrained("onnx-community/granite-timeseries-patchtst") & runForecast()
worker.js · L71–160
</>
Show the code · packPastValues() & unpackPredictions()
patchtst-core.mjs · L392–469
4 · Use-case ladder — explore every rung
Inspect Patch-12 tokenization (42 patches + [CLS]), test channel independence live, and compare all 7 channels against seasonal persistence.
Practical · Rolling CSV Backtester & Anomaly DetectorUpload or paste any 1–7 column CSV, run rolling 96-step walk-forward backtests, detect Z-score residual anomalies, and export formula-safe CSV/JSON.
Wild · Live 60 fps Shock & React CanvasDrag directly across the last 128 steps of any channel to inject surges, outages, or oscillations and watch PatchTST re-forecast 96 steps in ~14 ms.
Multi-model · Granite PatchTST + Mistral Timestral-5MChain Granite PatchTST (0.77 MB, 7-channel 96-step) with Timestral-5M (21.2 MB, 21-quantile fan) head-to-head on one chart (~22 MB total).