Model: ibm-granite/granite-timeseries-flowstate-r1 (default revision, r1.0)
Architecture: FlowStateModel (S5 state-space encoder + Functional Basis Decoder)
Task: zero-shot probabilistic time-series forecasting (quantiles)
Device: Ascend 910 (single npu:0) via torch_npu
Dtype: float32 | Params: 9,069,312 | Weights: model.safetensors (36.3 MB)
FlowState is a time-scale adjustable Time Series Foundation Model. A State Space
Model (SSM/S5) encoder projects the input into a timescale-invariant coefficient
space, and a Functional Basis Decoder (Legendre basis) generates continuous
forecasts from that space. It supports zero-shot quantile forecasting: outputs
[batch, n_quantiles, forecast_length, n_channels] with quantiles
[0.1..0.9], plus a mean prediction.
zhouhaoyi/ETDataset benchmark. Source file ETTh1.csv, 4066 rows, columns
date,HUFL,HULL,MUFL,MULL,LUFL,LULL,OT.OT (oil temperature), univariate, no missing values,
timestamps hourly and strictly increasing.[batch=1, 2048, 1]. Axis order is [batch, time, channel] (batch_first=True).1.0 (hourly sampling). Prediction horizon: 96 hours.npu:0)pip install torch torch_npu transformers numpy pandas safetensorsModel weights are downloaded automatically via from_pretrained
(ibm-granite/granite-timeseries-flowstate-r1) on first run, or pass
--model_dir <path> to load a local checkpoint.
python inference.py --data ETTh1.csv
# optional: --model_dir <local model dir> --context 2048 --prediction_length 96 --scale_factor 1.0The script verifies the NPU is available, loads the real weights, moves all
parameters to npu:0, runs inference with torch.npu.synchronize(), prints the
forecast and quantiles, and exits non-zero on any failure.
[FlowState] device = npu | model = ibm-granite/granite-timeseries-flowstate-r1
[FlowState] model loaded in 7.10s | params=9,069,312
[FlowState] first param device=npu:0 dtype=torch.float32
[FlowState] data: ETTh1 hourly | rows=4066 | context=2048
[FlowState] prediction_outputs=[1, 96, 1] quantile_outputs=[1, 9, 96, 1]
[FlowState] mean forecast[0:5]=[9.876, 10.507, 10.860, 11.524, 11.793]
[FlowState] forecast min/max = 7.110 / 11.793
[FlowState] quantile monotonicity at t0 = True
[FlowState] FINAL STATUS = PASS on npu
[FlowState] peak npu mem = 199.1 MBSame weights, input slice, preprocessing, seed, eval mode and float32 dtype.
compare_outputs.py --task regression --atol 1e-3 --rtol 1e-3 over the full
quantile tensor [1, 9, 96, 1]:
PYTORCH_ENABLE_FALLBACK=0)npu:0torch.npu.synchronize):
avg 765 ms, min 763 ms, max 767 ms, p50 765 ms, p90 766 ms, p95 767 msThe three images in assets/ were rendered by xterm.js from the actual terminal
logs of this adaptation session (not desktop screenshots):
assets/agent_workflow.png - reconnaissance, data checks, NPU inference,
consistency and benchmark summaryassets/npu_device_call.png - npu-smi, NPU availability, device name,
model parameter device/dtypeassets/model_result.png - full default python inference.py output on npu:0torch.fft); long contexts scale with the
FFT length. Performance reported is for a single 2048-context series.--scale_factor (see model card: hourly=1.0, daily≈3.43/0.0656, etc.).