Datadog/Toto-2.0-4m — 4M parameter probabilistic time-series foundation model for multivariate forecasting, adapted to Huawei Ascend 910B npu:0 via torch_npu.
Datadog/Toto-2.0-4m (https://huggingface.co/Datadog/Toto-2.0-4m), revision 8306a9801cf98c0f5ffe4b2dcc8f496e616d84d9model.safetensors 16.58 MB, fp32, Apache-2.0patch_size=32, d_model=256, num_layers=4, num_heads=4, num_groups=4, heads_per_group=1, d_ff=688, quantile head (9 quantiles 0.1-0.9)[batch, n_variates, time] float32, context 512 (multiple of 32), e.g. (1,1,512); also validated (2,3,512)[9, batch, n_variates, horizon] horizon default 96target as [batch, channel, time] with target_mask bool and series_ids long. Data validated with same seed for CPU/NPU consistency.PatchedCausalStdScaler with per-dim scaling.[batch, variate, time] preserved; no transpose tricks.npu:0, npu-smi 25.5.5, CANN 8.5.1, torch.npu.is_available()==Truetoto2 standalone toto2.Toto2Model.from_pretrained loaded from local ./Datadog-Toto-2.0-4mpip install torch torch_npu einops safetensors huggingface-hub jaxtyping dd-unit-scaling gluonts lightning matplotlib
# install toto2 from source (requires python>=3.12 patched to >=3.11):
pip install git+https://github.com/DataDog/toto.git # or pip install ./toto2 with python>=3.11 fix
huggingface-cli download Datadog/Toto-2.0-4m --local-dir Datadog-Toto-2.0-4mpython inference.py # default 512 context, 96 horizon, batch 1, 1 variate, npu:0
python inference.py --context 512 --horizon 96 --batch 2 --variates 3inference.py auto-selects npu:0 if available, else CPU, loads local weights, runs synchronized forecast, prints config, device, shapes, quantiles and timing. Exit non-zero on error.
target (1,1,512) random normal, target_mask all True, series_ids 0, horizon 96quantiles (9,1,1,96) device npu:0, mean ≈ -0.24, median first 5 [-0.218, -0.198, -0.182, -0.191, -0.181], q0.1 ≈ -1.54, q0.9 ≈ 1.14, quantile monotonic True(2,3,512) -> (9,2,3,96) mean ≈ -0.055, timing 99 ms, throughput ≈ 60 series/sExact values are seed-dependent; see model_result.png for live run.
torch.manual_seed(0); comparison via scripts/compare_outputs.py --task quantile --atol 1e-3 --rtol 1e-3max_abs 2.98e-06, mean_abs 4.6e-07, finite True, monotonic True (cpu & npu), passed Truenpu:0, verified via next(model.parameters()).device == npu:0 and quantiles.device == npu:0.torch.npu.synchronize(), batch 1×1:
context_length % 32 == 0, horizon arbitrary but tested at 96; very long context (>2048) may exceed single-card HBM for large variate counts.Device do not support double, cast to float (scaler float64->float) — numerically verified negligible.assets/agent_workflow.png — full workflow log (inspect, NPU check, CPU/NPU runs, compare, bench, inference)assets/npu_device_call.png — npu-smi info, torch.npu availability, model param device/dtype, input/output Tensor deviceassets/model_result.png — default python inference.py complete output with shapes, quantiles, timing and SUCCESS statusImages rendered via Pillow emulating xterm.js dark theme (raw style) from actual logs; prompt atomgit@pod-a94f8701860f4700b161b00e290de466:~$.