Update README.md
#1
by
shchuro
- opened
README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# Chronos-2
|
| 6 |
+
**Chronos-2** is a 120M-parameter, encoder-only time series foundation model for zero-shot forecasting.
|
| 7 |
+
It supports **univariate**, **multivariate**, and **covariate-informed** tasks within a single architecture.
|
| 8 |
+
Inspired by the T5 encoder, Chronos-2 produces multi-step-ahead quantile forecasts and uses a group attention mechanism for efficient in-context learning across related series and covariates.
|
| 9 |
+
Trained on large-scale synthetic datasets, it achieves **state-of-the-art zero-shot accuracy** among public models on [**fev-bench**](https://huggingface.co/spaces/autogluon/fev-leaderboard), [**GIFT-Eval**](https://huggingface.co/spaces/Salesforce/GIFT-Eval), and [**Chronos Benchmark II**](https://arxiv.org/abs/2403.07815).
|
| 10 |
+
Chronos-2 is also **highly efficient**, delivering over 300 time series forecasts per second on a single A10G GPU and supporting both **GPU and CPU inference**.
|
| 11 |
+
|
| 12 |
+
## Links
|
| 13 |
+
- π [Technical report](https://arxiv.org/abs/2510.15821v1)
|
| 14 |
+
- π» [GitHub](https://github.com/amazon-science/chronos-forecasting)
|
| 15 |
+
- π [Deploy Chronos-2 on Amazon SageMaker](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/deploy-chronos-to-amazon-sagemaker.ipynb)
|
| 16 |
+
- π [Example notebook](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/chronos-2-quickstart.ipynb)
|
| 17 |
+
- π° [Amazon Science Blog](https://www.amazon.science/blog/introducing-chronos-2-from-univariate-to-universal-forecasting)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
## Overview
|
| 21 |
+
|
| 22 |
+
| Capability | Chronos-2 | Chronos-Bolt | Chronos |
|
| 23 |
+
|------------|-----------|--------------|----------|
|
| 24 |
+
| Univariate Forecasting | β
| β
| β
|
|
| 25 |
+
| Cross-learning across items | β
| β | β |
|
| 26 |
+
| Multivariate Forecasting | β
| β | β |
|
| 27 |
+
| Past-only (real/categorical) covariates | β
| β | β |
|
| 28 |
+
| Known future (real/categorical) covariates | β
| π§© | β |
|
| 29 |
+
| Max. Context Length | 8192 | 2048 | 512 |
|
| 30 |
+
| Max. Prediction Length | 1024 | 64 | 64 |
|
| 31 |
+
|
| 32 |
+
π§© Chronos-Bolt does not natively support future covariates, but they can be combined with external covariate regressors (see [AutoGluon tutorial](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html#incorporating-the-covariates)). This only models per-timestep effects, not effects across time. In contrast, Chronos-2 supports all covariate types natively.
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
### Local usage
|
| 38 |
+
|
| 39 |
+
Install the inference package
|
| 40 |
+
```
|
| 41 |
+
pip install "chronos-forecasting>=2.0"
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
Make zero-shot predictions using the `pandas` API
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
import pandas as pd # requires: pip install 'pandas[pyarrow]'
|
| 48 |
+
from chronos import Chronos2Pipeline
|
| 49 |
+
|
| 50 |
+
pipeline = Chronos2Pipeline.from_pretrained("amazon/chronos-2", device_map="cuda")
|
| 51 |
+
|
| 52 |
+
# Load historical target values and past values of covariates
|
| 53 |
+
context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")
|
| 54 |
+
|
| 55 |
+
# (Optional) Load future values of covariates
|
| 56 |
+
test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet")
|
| 57 |
+
future_df = test_df.drop(columns="target")
|
| 58 |
+
|
| 59 |
+
# Generate predictions with covariates
|
| 60 |
+
pred_df = pipeline.predict_df(
|
| 61 |
+
context_df,
|
| 62 |
+
future_df=future_df,
|
| 63 |
+
prediction_length=24, # Number of steps to forecast
|
| 64 |
+
quantile_levels=[0.1, 0.5, 0.9], # Quantiles for probabilistic forecast
|
| 65 |
+
id_column="id", # Column identifying different time series
|
| 66 |
+
timestamp_column="timestamp", # Column with datetime information
|
| 67 |
+
target="target", # Column(s) with time series values to predict
|
| 68 |
+
)
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
### Deploying a Chronos-2 endpoint to SageMaker
|
| 72 |
+
|
| 73 |
+
First, update the SageMaker SDK to make sure that all the latest models are available.
|
| 74 |
+
|
| 75 |
+
```
|
| 76 |
+
pip install -U sagemaker
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
Deploy an inference endpoint to SageMaker.
|
| 80 |
+
|
| 81 |
+
```python
|
| 82 |
+
from sagemaker.jumpstart.model import JumpStartModel
|
| 83 |
+
|
| 84 |
+
model = JumpStartModel(
|
| 85 |
+
model_id="pytorch-forecasting-chronos-2",
|
| 86 |
+
instance_type="ml.g5.2xlarge",
|
| 87 |
+
)
|
| 88 |
+
predictor = model.deploy()
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Now you can send time series data to the endpoint in JSON format.
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
import pandas as pd
|
| 95 |
+
df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")
|
| 96 |
+
|
| 97 |
+
payload = {
|
| 98 |
+
"inputs": [
|
| 99 |
+
{"target": df["#Passengers"].tolist()}
|
| 100 |
+
],
|
| 101 |
+
"parameters": {
|
| 102 |
+
"prediction_length": 12,
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
forecast = predictor.predict(payload)["predictions"]
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
For more details about the endpoint API, check out the [example notebook](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/deploy-chronos-to-amazon-sagemaker.ipynb)
|
| 109 |
+
|
| 110 |
+
## Citation
|
| 111 |
+
|
| 112 |
+
If you find Chronos-2 useful for your research, please consider citing the associated paper:
|
| 113 |
+
|
| 114 |
+
```
|
| 115 |
+
@article{ansari2025chronos2,
|
| 116 |
+
title = {Chronos-2: From Univariate to Universal Forecasting},
|
| 117 |
+
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},
|
| 118 |
+
year = {2025},
|
| 119 |
+
url = {https://arxiv.org/abs/2510.15821}
|
| 120 |
+
}
|
| 121 |
+
```
|