ibm-granite/granite-timeseries-ttm-r2 is a TinyTimeMixer (TTM) foundation model for multivariate time-series forecasting, released by IBM Research (NeurIPS'24). This is the R2 release trained on ~700M samples, 1M parameters (805k in this checkpoint) with 2 mixer layers, d_model 192, patch length 64, stride 64, 8 patches for context 512. Supports point forecasting; probabilistic via student-t head (distribution_output: student_t) but default is point forecast.
Input source: Synthetic univariate series with fixed seed 0, deterministic generation 0.5*sin(2πt/24)+0.3*sin(2πt/96)+0.01*t+N(0,0.1). Total 608 timesteps, context 512, horizon 96. SHA256 prefix of raw context 9e1e6faa02e6, mean 2.570732 std 1.523962.
Rows/Batch: batch=1, time=512 lookback, channel=1. For time-series contract: [batch, time, channel] = [1,512,1] float32. Future ground truth 96 steps held out for reference but not fed.
Axis order: [batch, time, channel] – TTM expects 3D past_values; [B,C,T] would be wrong. Channel is last.
Time contract: ascending order, no duplicate timestamps, no missing steps, synthetic frequency placeholder 5min (TTM r2 supports minutely/hourly; daily/weekly in r2.1). Real data must impute gaps before feeding.
Preprocessing: External std scaling per window: (x-mean)/std where mean/std computed on context window only (scale="std"). Model receives normalized values; output inverse-scaled forecast*std+mean for denorm report. Both norm and denorm saved; consistency compared on norm to avoid scaling error.
HF cache: snapshot_download local_dir_use_symlinks=False via hf-mirror, revision d6a79570
Device validation: torch.npu.is_available()==True, device_count==2, torch.npu.get_device_name(0)==Ascend910_9362, verified 134 params on npu:0, no CPU fallback
Granite-tsfm source: cloned https://github.com/ibm-granite/granite-tsfm to /tmp/granite-tsfm (commit depth 1, 2026-08-20), PYTHONPATH set, datasets stub provided to avoid heavy dependency.
Installation
pip install -r requirements.txt
# If granite-tsfm not available via pip, ensure source is cloned:
# git clone --depth 1 https://github.com/ibm-granite/granite-tsfm /tmp/granite-tsfm
# export PYTHONPATH=/tmp/granite-tsfm:$PYTHONPATH
# Requires CANN toolkit at /usr/local/Ascend/cann-8.5.1 and torch_npu
Loading: TinyTimeMixerForPrediction.from_pretrained(local_or_hub) then .to("npu:0"), verify next(param).device.type=="npu" and dtype, print device_name, 134/134 on NPU.
Compute: model(past_values=past_npu) where past is [1,512,1] normalized. Wrapped with torch.npu.synchronize() before/after for accurate timing. Output prediction_outputs is [1,96,1] logits.
Scaling: raw preview and norm preview both printed; denorm via *std+mean; future_gt not used but logged for reference.
Edge: Handles batch 1 only in example; multivariate channel>1 supported by same mode common_channel (enable_forecast_channel_mixing false in this checkpoint).
Stable: avg 0.0049s, p50 0.0049s, p95 0.0050s, throughput 203.5 windows/s per single window (512 context -> 96 forecast, FP32). In rows/s: 512/0.0049=104k rows/s context, or 96/0.0049=19591 forecast rows/s.
Peak HBM: ~3.2 MB via torch.npu.max_memory_allocated (tiny model 805k params ~3.1 MB weights + activation), npu-smi shows 3104 MB baseline due to driver/CANN overhead, well within 65536 MB.
Preprocessing: not included (synthetic generation ~0.001s); timing only model forward (synchronized). Scaling negligible.
Windows/s vs series/s: windows/s reported for time-series; series/s same as windows/s for batch1.
Evidence Images
All three PNGs generated by scripts/render_xterm_evidence.mjs --style raw from real logs (xterm.js white on dark gray, prompt atomgit@pod-a94f8701860f4700b161b00e290de466:~$ is display-only, not host proof).
assets/ contains exactly those three files, generated from logs/workflow.log, logs/device.log, logs/inference.log via manifest.
Limitations
Checkpoint is univariate focused (num_input_channels=1, common_channel mode, channel mixing disabled); multivariate must run channel-independent windows or use larger channel-mix checkpoint not tested.
Context 512 / horizon 96 fixed for this checkpoint; other horizons need different r2 branch (e.g., 512-336, 1024-96) via get_model() – not covered.
Only minutely/hourly resolutions officially; daily/weekly needs r2.1 branch.
Point forecast only – quantiles via student-t head not validated; evaluation uses deterministic MSE head.
Single NPU npu:0 only; multi-NPU or batch>1 not benchmarked (model supports batch>1 but not measured).
Training (fit) not migrated – only inference; return_loss=True training path remains CPU-untested on NPU.
Requires granite-tsfm source or datasets stub for tsfm_public import; pure transformers AutoModel will not load TTM without tsfm code.
Synthetic data evaluation is smoke consistency; not full benchmark (M4, Electricity etc.) – full benchmark would need dataset download and metric MAE/RMSE/SMAPE across datasets.