模型库 / amazon/chronos-2

chronos-2

amazon time-series-forecasting chronos-forecasting
amazon/chronos-2
17,696,259
下载量
455
收藏数
34
浏览量
apache-2.0
许可

简介

**Update Dec 30, 2025:** ☁️ Deploy Chronos-2 on Amazon SageMaker. New guide covers real-time GPU and CPU inference, serverless endpoints (run on demand, no idle costs), and batch transform for large-scale forecasting.

模型卡片

许可协议 apache-2.0
框架 chronos-forecasting
任务 time-series-forecasting
数据集
chronos_datasets GiftEvalPretrain
time series forecasting foundation models pretrained models safetensors

模型配置

模型类型 t5
架构 Chronos2Model

模型详情

已翻译

Chronos-2

2025年12月30日更新: ☁️ 在 Amazon SageMaker 上部署 Chronos-2。新指南涵盖了实时 GPU 和 CPU 推理、无服务器端点(按需运行,无闲置成本)以及用于大规模预测的 batch transform。

Chronos-2 是一个 120M 参数、仅编码器的时间序列基础模型,专为零样本预测而设计。
它在单一架构内支持单变量多变量协变量信息任务。
受 T5 编码器启发,Chronos-2 生成多步 ahead 分位数预测,并使用组注意力机制在相关序列和协变量之间实现高效的上下文学习。
该模型在真实世界和大规模合成数据集的组合上进行训练,在 fev-benchGIFT-EvalChronos Benchmark II 上实现了公开模型中的最先进零样本准确率
Chronos-2 还非常高效,在单个 A10G GPU 上每秒可提供超过 300 个时间序列预测,并同时支持 GPU 和 CPU 推理

链接

概览

能力 Chronos-2 Chronos-Bolt Chronos
单变量预测
跨项目交叉学习
多变量预测
仅过去(实数/类别)协变量
已知未来(实数/类别)协变量 🧩 🧩
最大上下文长度 8192 2048 512
最大预测长度 1024 64 64

🧩 Chronos 和 Chronos-Bolt 本身不支持未来协变量,但它们可以与外部协变量回归器结合使用(参见 AutoGluon 教程)。这仅建模每个时间步的效果,而非跨时间的效果。相比之下,Chronos-2 原生支持所有协变量类型。

使用方法

本地使用

对于实验和本地推理,您可以使用 inference 包

安装该包

pip install "chronos-forecasting>=2.0"

使用 pandas API 进行零样本预测

import pandas as pd  # requires: pip install 'pandas[pyarrow]'
from chronos import Chronos2Pipeline

pipeline = Chronos2Pipeline.from_pretrained("amazon/chronos-2", device_map="cuda")

# Load historical target values and past values of covariates
context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")

# (Optional) Load future values of covariates
test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet")
future_df = test_df.drop(columns="target")

# Generate predictions with covariates
pred_df = pipeline.predict_df(
    context_df,
    future_df=future_df,
    prediction_length=24,  # Number of steps to forecast
    quantile_levels=[0.1, 0.5, 0.9],  # Quantiles for probabilistic forecast
    id_column="id",  # Column identifying different time series
    timestamp_column="timestamp",  # Column with datetime information
    target="target",  # Column(s) with time series values to predict
)

将 Chronos-2 端点部署到 SageMaker

对于生产环境使用,我们建议将 Chronos-2 端点部署到 Amazon SageMaker。

首先,更新 SageMaker SDK 以确保所有最新模型可用。

pip install -U sagemaker

将推理端点部署到 SageMaker。

from sagemaker.jumpstart.model import JumpStartModel

model = JumpStartModel(
    model_id="pytorch-forecasting-chronos-2",
    instance_type="ml.g5.2xlarge",
)
predictor = model.deploy()

现在您可以以 JSON 格式向端点发送时间序列数据。

import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")

payload = {
    "inputs": [
        {"target": df["#Passengers"].tolist()}
    ],
    "parameters": {
        "prediction_length": 12,
    }
}
forecast = predictor.predict(payload)["predictions"]

有关端点 API 的更多详细信息,请查看示例 notebook

训练数据

有关训练数据的更多详细信息,请参阅技术报告

引用

如果您发现 Chronos-2 对您的研究有用,请考虑引用相关论文:

@article{ansari2025chronos2,
  title        = {Chronos-2: From Univariate to Universal Forecasting},
  author       = {Abdul Fatir Ansari and Oleksandr Shchur and Jaris Küken and Andreas Auer and Boran Han and Pedro Mercado and Syama Sundar Rangapuram and Huibin Shen and Lorenzo Stella and Xiyuan Zhang and Mononito Goswami and Shubham Kapoor and Danielle C. Maddix and Pablo Guerron and Tony Hu and Junming Yin and Nick Erickson and Prateek Mutalik Desai and Hao Wang and Huzefa Rangwala and George Karypis and Yuyang Wang and Michael Bohlke-Schneider},
  year         = {2025},
  url          = {https://arxiv.org/abs/2510.15821}
}

标签

t5 time series forecasting foundation models pretrained models dataset:autogluon/chronos_datasets dataset:Salesforce/GiftEvalPretrain arxiv:2403.07815

操作


详细信息

厂商
amazon
任务
time-series-forecasting
框架
chronos-forecasting
模型类型
t5
许可(HF)
apache-2.0