🚀 Chronos-Bolt⚡ (Base)
Chronos-Bolt is a family of pretrained time series forecasting models designed for zero-shot forecasting. It's built on the T5 encoder-decoder architecture and trained on nearly 100 billion time series observations. It divides historical time series context into patches of multiple observations, feeding them into the encoder. The decoder then directly generates quantile forecasts for multiple future steps, a method called direct multi-step forecasting. Compared to the original Chronos models of the same size, Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient.
🚀 Update Feb 14, 2025: Chronos-Bolt models are now available on Amazon SageMaker JumpStart! Check out the tutorial notebook to learn how to deploy Chronos endpoints for production use in a few lines of code.
✨ Features
- High Efficiency: Up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size.
- Accurate Forecasting: Outperforms commonly used statistical and deep learning models, even in zero-shot scenarios.
- Multiple Sizes: Available in different sizes to meet various requirements.
- Flexible Usage: Can be used with AutoGluon, deployed on SageMaker, or used with the inference library.
📦 Installation
Install with AutoGluon
pip install autogluon
Update SageMaker SDK
pip install -U sagemaker
Install with inference library
pip install chronos-forecasting
💻 Usage Examples
Basic Usage with AutoGluon
from autogluon.timeseries import TimeSeriesPredictor, TimeSeriesDataFrame
df = TimeSeriesDataFrame("https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly/train.csv")
predictor = TimeSeriesPredictor(prediction_length=48).fit(
df,
hyperparameters={
"Chronos": {"model_path": "amazon/chronos-bolt-base"},
},
)
predictions = predictor.predict(df)
Deploying to SageMaker
from sagemaker.jumpstart.model import JumpStartModel
model = JumpStartModel(
model_id="autogluon-forecasting-chronos-bolt-base",
instance_type="ml.c5.2xlarge",
)
predictor = model.deploy()
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"]
Usage with inference library
import pandas as pd
import torch
from chronos import BaseChronosPipeline
pipeline = BaseChronosPipeline.from_pretrained(
"amazon/chronos-bolt-base",
device_map="cuda",
torch_dtype=torch.bfloat16,
)
df = pd.read_csv(
"https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv"
)
forecast = pipeline.predict(
context=torch.tensor(df["#Passengers"]), prediction_length=12
)
📚 Documentation
Performance
The following plot compares the inference time of Chronos-Bolt against the original Chronos models for forecasting 1024 time series with a context length of 512 observations and a prediction horizon of 64 steps.
Chronos-Bolt models are not only significantly faster but also more accurate than the original Chronos models. The following plot reports the probabilistic and point forecasting performance of Chronos-Bolt in terms of the Weighted Quantile Loss (WQL) and the Mean Absolute Scaled Error (MASE), respectively, aggregated over 27 datasets (see the Chronos paper for details on this benchmark). Remarkably, despite having no prior exposure to these datasets during training, the zero-shot Chronos-Bolt models outperform commonly used statistical models and deep learning models that have been trained on these datasets (highlighted by *). Furthermore, they also perform better than other FMs, denoted by a +, which indicates that these models were pretrained on certain datasets in our benchmark and are not entirely zero-shot. Notably, Chronos-Bolt (Base) also surpasses the original Chronos (Large) model in terms of the forecasting accuracy while being over 600 times faster.
Chronos-Bolt models are available in the following sizes.
Property |
Details |
Model Type |
Chronos-Bolt is a family of pretrained time series forecasting models. |
Training Data |
Trained on nearly 100 billion time series observations. |
Usage with AutoGluon
The recommended way of using Chronos for production use cases is through AutoGluon.
AutoGluon offers effortless fine-tuning of Chronos models, incorporating covariates into the forecast through covariate regressors, and ensembling with other statistical and machine learning models for maximum accuracy.
Check out the AutoGluon Chronos tutorial for more details.
Deploying a Chronos-Bolt endpoint to SageMaker
SageMaker JumpStart makes it easy to deploy Chronos endpoints for production use with just a few lines of code.
Chronos-Bolt endpoints can be deployed to both CPU and GPU instances, as well as support forecasting with covariates.
More details are available in this example notebook.
📄 License
This project is licensed under the Apache-2.0 License.
📚 Citation
If you find Chronos or Chronos-Bolt models useful for your research, please consider citing the associated paper:
@article{ansari2024chronos,
title={Chronos: Learning the Language of Time Series},
author={Ansari, Abdul Fatir and Stella, Lorenzo and Turkmen, Caner and Zhang, Xiyuan, and Mercado, Pedro and Shen, Huibin and Shchur, Oleksandr and Rangapuram, Syama Syndar and Pineda Arango, Sebastian and Kapoor, Shubham and Zschiegner, Jasper and Maddix, Danielle C. and Mahoney, Michael W. and Torkkola, Kari and Gordon Wilson, Andrew and Bohlke-Schneider, Michael and Wang, Yuyang},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2024},
url={https://openreview.net/forum?id=gerNCVqqtR}
}