🚀 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}
}