🚀 Toto-Open-Base-1.0
Toto(用于可观测性的时间序列优化Transformer)是一个时间序列基础模型,专为多变量时间序列预测而设计,着重于可观测性指标。Toto能够高效处理可观测性场景中常见的高维、稀疏和非平稳数据。
Toto-Open-Base-1.0架构概述。
🚀 快速开始
模型推理
推理代码可在 GitHub 上获取。
📦 安装指南
git clone https://github.com/DataDog/toto.git
cd toto
pip install -r requirements.txt
💻 使用示例
以下是如何使用Toto快速生成预测的示例:
基础用法
import torch
from data.util.dataset import MaskedTimeseries
from inference.forecaster import TotoForecaster
from model.toto import Toto
DEVICE = 'cuda'
toto = Toto.from_pretrained('Datadog/Toto-Open-Base-1.0').to(DEVICE)
toto.compile()
forecaster = TotoForecaster(toto.model)
input_series = torch.randn(7, 4096).to(DEVICE)
timestamp_seconds = torch.zeros(7, 4096).to(DEVICE)
time_interval_seconds = torch.full((7,), 60*15).to(DEVICE)
inputs = MaskedTimeseries(
series=input_series,
padding_mask=torch.full_like(input_series, True, dtype=torch.bool),
id_mask=torch.zeros_like(input_series),
timestamp_seconds=timestamp_seconds,
time_interval_seconds=time_interval_seconds,
)
forecast = forecaster.forecast(
inputs,
prediction_length=336,
num_samples=256,
samples_per_batch=256,
)
mean_prediction = forecast.mean
prediction_samples = forecast.samples
lower_quantile = forecast.quantile(0.1)
upper_quantile = forecast.quantile(0.9)
如需详细的推理说明,请参考 推理教程笔记本。
性能建议
⚠️ 重要提示
为了获得最佳速度和减少内存使用,请安装 xFormers 和 flash-attention,然后将 use_memory_efficient
设置为 True
。
可用的检查点
✨ 主要特性
- 零样本预测
- 多变量支持
- 仅解码器的Transformer架构
- 概率预测(学生T混合模型)
- 因果逐块实例归一化
- 在大规模数据上进行广泛预训练
- 支持高维时间序列
- 专为可观测性指标量身定制
- 在 GiftEval 和 BOOM 上具有最先进的性能
📚 详细文档
训练数据总结
额外资源
📄 许可证
本项目采用Apache 2.0许可证。
📖 引用
如果您在研究或应用中使用了Toto,请使用以下方式引用我们:
@misc{toto2025,
title={This Time is Different: An Observability Perspective on Time Series Foundation Models},
author={TODO},
year={2025},
eprint={arXiv:TODO},
archivePrefix={arXiv},
primaryClass={cs.LG}
}