Datadog Toto-2.0-313m is the 313M-parameter member of the Toto 2.0 family of time-series foundation models for multivariate forecasting (technical report: arXiv:2605.20119, TIME benchmark: arXiv:2602.12147). It is a u-μP-scaled decoder-only patched transformer with alternating time-axis (causal) and variate-axis (full) attention, a quantile output head (9 knots 0.1…0.9 trained with pinball loss), contiguous patch masking (CPM) for single-pass parallel decoding, a robust arcsinh input scaler and a residual MLP patch projection. Datadog positions it as a strong general-purpose checkpoint — top-3 foundation model on GIFT-Eval.
This adaptation deploys the model for service-based probabilistic forecasting on an Ascend 910 NPU
via torch_npu. vLLM-Ascend 0.18 does not support this custom time-series architecture, so the
standalone Toto2Model (from DataDog/toto, vendored) is used as-is on torch_npu — zero source
modification to the model; only the GluonTS wrapper was stripped from the vendored package.
| Attribute | Value |
|---|---|
| Parameters | 313M (fp32 safetensors 1.17 GB) |
| Architecture | decoder-only transformer, d_model=1024, num_layers=24, num_heads=16, qk_dim/v_dim=64, d_ff=2736, patch_size=32, xPos RoPE, SwiGLU MLP, τ-rule residual (residual_mult=0.75), MuP (per-dim scale) |
| Attention | time/variate alternating groups (layer_group_size=24, last layer = variate, heads_per_group=1) |
| Output | 9 quantiles [0.1 … 0.9], shape [9, batch, n_variate, horizon] |
| Task | zero-shot multivariate time-series forecasting (observability / GIFT-Eval / TIME) |
unit-scaling==0.3.5 (PyPI) + vendored dd_unit_scaling + vendored toto2 (GluonTS-stripped)# 1. download weights (ModelScope, sha256-verified)
python3 download_model.py
# 2. generate a demo test series
python3 make_test_data.py
# 3. run a one-shot forecast on NPU
python3 inference.py --device npu:1 --num-variates 3 --time-steps 1024 --prediction-length 96
# 4. start the HTTP service (default port 8040, device npu:1)
./start_serve.sh 8040 npu:1POST /v1/forecast
{
"series": [[1.0, 2.0, ...], [...], ...], // [variate, time_steps]; 1D accepted; NaN allowed
"prediction_length": 96, // future steps (1..4096)
"decode_block_size": 768, // CPM block size (multiple of 32)
"has_missing_values": true
}Response: {quantiles: {"0.1": […], …, "0.9": […]}, median, prediction_length, n_variates, latency_ms},
each quantile a [n_variate, horizon] array.
| Config | Latency (HTTP p50) | Notes |
|---|---|---|
| 3 var / ctx 1024 / pred 96 | ~120 ms | quantiles monotonic |
| 3 var / ctx 512 / pred 96 | ~110 ms | |
| 1 var / ctx 4096 / pred 336 | ~135 ms | long context |
| 1 var / ctx 1024 / pred 1024 | ~250 ms | KV-cache block decoding |
max_abs_diff ≤ 1e-4, cosine ≥ 0.9999999, median corr ≈ 1.0 → PASSToto2Model is loaded directly.F.scaled_dot_product_attention → aclnnFlashAttentionScore;
fp64 causal patch scaler, asinh, quantile head and torch.distributions all run natively on NPU.toto2/, dd_unit_scaling/): the toto2 Toto2GluonTSModel (GluonTS
wrapper, pulls in lightning) is stripped — see patches/toto2_ascend_npu.patch. dd_unit_scaling
(u-μP layer wrappers) is vendored; upstream unit-scaling comes from PyPI.target_mask.inference.py (torch_npu engine + CLI) · server.py (FastAPI /v1/forecast) ·
download_model.py (ModelScope + sha256) · make_test_data.py · verify_npu_vs_cpu.py ·
test_server.py · start_serve.sh · toto2/ + dd_unit_scaling/ (vendored) ·
patches/toto2_ascend_npu.patch · requirements.txt · assets/ (screenshots)
Weights are not included in this repo — download them with download_model.py
(source: ModelScope Datadog/Toto-2.0-313m, sha256 5ee60664…aa2f9).