Datadog Toto-2.0-4m is the 4M-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.
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 | 4M (fp32 safetensors 15.8 MB) |
| Architecture | decoder-only transformer, d_model=256, num_layers=4, num_heads=4, num_groups=4, qk_dim/v_dim=64, d_ff=688, patch_size=32, xPos RoPE, SwiGLU MLP, τ-rule residual, MuP (per-dim scale) |
| Attention | time/variate alternating groups (layer_group_size=4, last layer = variate) |
| 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 8041, device npu:1)
./start_serve.sh 8041 npu:1POST /v1/forecast
{
"series": [[1.0, 2.0, ...], [...], ...], // [variate, time_steps]; 1D also ok
"prediction_length": 96,
"decode_block_size": 768,
"has_missing_values": true
}Response:
{
"quantiles": {"0.1": [[...], ...], ..., "0.9": [[...], ...]},
"median": [[...], ...],
"shape": [n_variate, horizon],
"prediction_length": 96,
"latency_ms": 23.4
}| Config | p50 latency |
|---|---|
| 3v / ctx 1024 / pred 96 | 23.4 ms |
| 1v / ctx 512 / pred 96 | 22.8 ms |
| 7v / ctx 4096 / pred 336 | 23.9 ms |
| 3v / ctx 1024 / pred 1024 | 48.2 ms |
| 3v / ctx 512 / pred 96 | 23.8 ms |
├── assets/ # Screenshot materials (user uploads actual screenshots)
│ ├── adaptation-workflow.txt
│ ├── adaptation-result.txt
│ └── npu-smi.txt
├── toto2/ # Vendored Toto2Model (GluonTS-stripped)
├── dd_unit_scaling/ # Vendored dd_unit_scaling
├── patches/
│ └── toto2_ascend_npu.patch
├── inference.py # Inference engine (torch_npu)
├── server.py # FastAPI HTTP service
├── download_model.py # ModelScope download + sha256 verification
├── make_test_data.py # Synthetic test data generator
├── verify_npu_vs_cpu.py # Numerical correctness verification
├── test_server.py # HTTP service test
├── start_serve.sh # One-click service launcher
├── readme.md # This file
├── requirements.txt
├── .gitignore
└── .gitattributesinference.py: Loads Toto2Model from local checkpoint, builds forecast inputs, runs 9-quantile probabilistic forecastserver.py: FastAPI /v1/forecast endpoint with CPM block decoding and KV cachedownload_model.py: Fetches weights from ModelScope with sha256 verificationverify_npu_vs_cpu.py: Compares NPU and CPU forecasts (all quantiles) for numerical agreement