sheepss/Datadog-Toto-2.0-1B-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Datadog/Toto-2.0-1B on Ascend NPU (#NPU)

Zero-shot multivariate probabilistic time-series forecasting foundation model adapted to run on a single Ascend 910 NPU (npu:0).

  • Model: 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)
  • Task: time-series forecasting (observability / generic), probabilistic quantile forecast at levels [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
  • License: apache-2.0
  • Official code: https://github.com/DataDog/toto (Apache-2.0, toto2 module)

Model

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.

Data Contract (input)

FieldValue
Inputtarget tensor (batch, n_variates, time_steps) fp32
target_maskbool tensor same shape (observed mask)
series_idslong tensor (batch, n_variates)
Batch1
Variates4 (default)
Context length512 (default)
Horizon96 (default)
Outputquantiles (9, batch, n_variates, horizon) at levels 0.1..0.9
Axis order[quantile, batch, variate, time]
Scalinginternal causal std scaler + arcsinh, inverse-transformed to real space

Environment

  • Hardware: Ascend 910 (single card, npu:0)
  • OS / arch: Linux aarch64
  • Software: torch 2.9.0, torch_npu 2.9.0, CANN 8.5.1, unit-scaling 0.3.5

Installation

pip install -r requirements.txt
# torch_npu + torch must be installed for your Ascend CANN environment

NPU Inference

Weights 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 4

inference.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.

Real Results (npu:0)

  • Total params: 1041.03M (fp32)
  • Input: 1 batch x 4 variates x 512 context
  • Output quantiles shape: (9, 1, 4, 96), all finite, quantiles monotonic
  • Median (first variate, first 8 steps): [0.0410, 0.0404, 0.0380, 0.0405, 0.0375, 0.0362, 0.0379, 0.0374]
  • 10th percentile: [-1.2392, -1.2474, -1.2467, -1.2432, -1.2451, -1.2487, -1.2455, -1.2494]
  • 90th percentile: [1.3423, 1.3399, 1.3357, 1.3366, 1.3344, 1.3326, 1.3401, 1.3370]
  • Inference wall time (horizon 96, decode_block_size 768): ~0.48 s (first run / compile)
  • Status: OK

Consistency (CPU vs NPU)

Same weights, identical input values, dtype fp32, seed fixed, eval mode:

  • shapes equal (9, 1, 4, 96), all finite
  • max abs error: 5.84e-06, mean abs error: 6.45e-07
  • np.allclose(atol=1e-4, rtol=1e-3) → PASS
  • quantiles monotonic across levels on both devices → PASS

Performance (npu:0, context 512, horizon 96, 1 batch, 4 variates, fp32)

MetricValue
first run (kernel compile)0.447 s
avg latency (10 runs, 3 preheat)0.163 s
p50 / p950.163 s / 0.166 s
throughput~6.14 forecast/s
peak NPU memory~4.3 GB weights (of 64 GB HBM)

Evidence

  • 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)

Limitations

  • This is a zero-shot forecasting model; a fixed deterministic synthetic series is used as the demonstrable input. For your data, provide your own target / target_mask / series_ids following the data contract above.
  • The internal scaler operates in float64 where supported; on NPU it falls back to float32 (the model remains numerically consistent, see Consistency).
  • Single-variate or very long contexts (beyond 512) increase latency and memory; the decode_block_size controls block-decode caching for longer horizons.