Zero-shot multivariate probabilistic time-series forecasting foundation model
adapted to run on a single Ascend 910 NPU (npu:0).
Datadog/Toto-2.0-1B (1041M params, decoder-only patched transformer with
alternating time/variate attention, u-μP scaling, quantile output head trained with
pinball loss)[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]toto2 module)Toto 2.0 is the current-generation Datadog time-series foundation model family. The 1B checkpoint is the "best quality / cost tradeoff" size for production workloads and ranks among the top foundation models on GIFT-Eval, BOOM and TIME. It predicts quantiles for multivariate series using contiguous patch masking (CPM) and a block-decode KV cache. This repo verifies real inference of the released checkpoint on an Ascend NPU.
| Field | Value |
|---|---|
| Input | target tensor (batch, n_variates, time_steps) fp32 |
target_mask | bool tensor same shape (observed mask) |
series_ids | long tensor (batch, n_variates) |
| Batch | 1 |
| Variates | 4 (default) |
| Context length | 512 (default) |
| Horizon | 96 (default) |
| Output | quantiles (9, batch, n_variates, horizon) at levels 0.1..0.9 |
| Axis order | [quantile, batch, variate, time] |
| Scaling | internal causal std scaler + arcsinh, inverse-transformed to real space |
npu:0)pip install -r requirements.txt
# torch_npu + torch must be installed for your Ascend CANN environmentWeights must be downloaded first to a local model/ directory:
huggingface-cli download Datadog/Toto-2.0-1B --local-dir model
python inference.py --model_dir model --context_length 512 --horizon 96 --n_variates 4inference.py is fully self-contained (embeds the Apache-2.0 toto2 model and the
dd_unit_scaling unit-scaling layer). It loads the checkpoint from local disk, moves
the model to npu:0, and produces a quantile forecast. It exits non-zero on any
failure. The script requires the unit-scaling pip package at runtime.
(9, 1, 4, 96), all finite, quantiles monotonic[0.0410, 0.0404, 0.0380, 0.0405, 0.0375, 0.0362, 0.0379, 0.0374][-1.2392, -1.2474, -1.2467, -1.2432, -1.2451, -1.2487, -1.2455, -1.2494][1.3423, 1.3399, 1.3357, 1.3366, 1.3344, 1.3326, 1.3401, 1.3370]Same weights, identical input values, dtype fp32, seed fixed, eval mode:
(9, 1, 4, 96), all finite5.84e-06, mean abs error: 6.45e-07np.allclose(atol=1e-4, rtol=1e-3) → PASS| Metric | Value |
|---|---|
| first run (kernel compile) | 0.447 s |
| avg latency (10 runs, 3 preheat) | 0.163 s |
| p50 / p95 | 0.163 s / 0.166 s |
| throughput | ~6.14 forecast/s |
| peak NPU memory | ~4.3 GB weights (of 64 GB HBM) |
assets/agent_workflow.png - end-to-end adaptation workflow log (xterm.js from real log)assets/npu_device_call.png - NPU device / compute evidence (xterm.js from real log)assets/model_result.png - default python inference.py run on npu:0 (xterm.js from real log)target /
target_mask / series_ids following the data contract above.decode_block_size controls block-decode caching for longer horizons.