精选AWS AI Blog新闻
迪卡侬如何利用Chronos-2大规模运行需求预测
迪卡侬,全球最大的体育用品零售商之一,使用亚马逊的Chronos-2模型在AWS上部署需求预测系统,覆盖多个大洲的数万种产品。该系统将预测准确率提升了11-15个百分点,同时降低了运营复杂性,每周推理成本仅约0.03美元,且仅使用CPU实例。
这是全文的第 1/5 段。请完整翻译本段,不要省略或提前结束。
请将下面英文文章译成流畅中文。要求:
- 只输出译文,不要前言、标题重复或注释
- 保留段落(空行分段)
- 正文里的
这类标记请原样保留,不要翻译或删除
- 模型名、产品名、论文名等专有名词可保留英文
- 不要摘要、不要发挥
标题:How Decathlon runs demand forecasting at scale with Chronos-2
正文: This post is co-written with Vianney Bruned, Filippo Giruzzi, Belkiss Saidi, and Carlos Ramirez from Decathlon.
Decathlon is one of the world’s largest sporting goods retailers, with more than 100,000 teammates and 400 million users worldwide. The company relies on accurate demand forecasting at scale to support the availability of the appropriate products in each store at the time customers need them. After evaluating multiple time series foundation models (TSFMs), Decathlon selected Chronos-2 as a core component of their forecasting stack.
In this post, we share the architecture Decathlon uses to run Chronos-2 at scale on AWS, the business impact on Decathlon’s supply chain operations, and practical lessons learned for other companies that want to adopt foundation models for forecasting.
Decathlon’s forecasting challenge
Accurate demand forecasting is the backbone of retail supply chain operations. For Decathlon, this challenge is amplified by the sheer scale and diversity of their business: tens of thousands of products spanning over 80 sports, sold across multiple continents with highly seasonal demand patterns. A pair of ski gloves and a surfboard have fundamentally different demand signals, yet both must be forecasted accurately to avoid stockouts or overstock.
Decathlon’s forecasting system predicts the weekly sales quantity of all products on two critical horizons. The first is a 12-week replenishment window used by purchase planners to order goods from industrial partners. The second is a 52-week strategic horizon for long-term stock projection and capacity planning. The forecasting system runs weekly across both horizons. It’s deployed across multiple supply zones, including Europe, India, China, South East Asia (SEA), Latin America (LATAM), and soon the Middle East and Africa. Each zone covers up to 25,000 products.
Previous approach and its limitations
- 2021–2024: A hybrid approach using Amazon SageMaker AI DeepAR for the short-term forecast horizon (weeks 1–16) and Holt-Winters exponential smoothing for the longer-term horizon (weeks 17–52). DeepAR was retrained weekly to adapt to recent trend shifts.
- 2024 onwards: Introduction of Temporal Fusion Transformer (TFT) with covariates, offering improved long-horizon accuracy.
While these approaches served Decathlon well, they came with operational overhead: the system required weekly re-training and could not easily scale to new regions without extra engineering effort. The team needed a solution that could deliver higher accuracy with lower operational complexity.
Why Chronos-2: Model evaluation and selection
The rise of time series foundation models (FMs) promised pre-trained models that could outperform classical approaches without training from scratch on domain-specific data. But a critical question remained: would these models work on Decathlon’s specific retail datasets?
To answer this, Decathlon designed a rigorous, large-scale benchmark on its own retail data, evaluating multiple TSFMs against its production baseline.
Benchmark design
- Evaluation: 101 rolling cutoffs spanning nearly 2 years (week 48 of 2022 to week 44 of 2024).
- Scale: Approximately 25,000 unique products per cutoff (39,000 unique product time series across the full evaluation period).
- Horizon: 12-week and 52-week horizons at weekly frequency.
- Primary metric: Weighted Absolute Percentage Error (WAPE) at 12-week and 52-week horizons, supplemented by root mean square error (RMSE), bias, and pairwise winning rates.
For full benchmark results including comparisons across multiple TSFMs, see Decathlon’s detailed analysis on Medium.
Key findings
迪卡侬在零样本和微调两种配置下评估了多种TSFM。在迪卡侬发布的基准测试结果中,经过微调的Chronos-2在两个预测跨度上均持续优于所有其他被评估的模型。即使在零样本模式下,它也达到或超越了完全训练的生产基线。微调进一步将预测误差降低了几个百分点。
- 零样本可行性:多种TSFM在无需任何领域特定训练的情况下,达到或接近了迪卡侬现有生产模型(每周重新训练)的性能。
- 微调带来显著提升:即使采用低频微调计划(每6个月一次),微调也显著提升了性能。经过微调的Chronos-2在短期(12周)和长期(52周)两个预测跨度上均展现出最低误差。
- 计算效率:Chronos-2可在CPU和GPU上运行,并满足基准测试中针对25,000个产品每次截止时间推断不超过2分钟的效率要求。
除了原始精度之外,Chronos-2通过其分组注意力机制原生支持协变量,这是一个关键的差异化优势。与大多数需要变通方案的TSFM不同,Chronos-2原生整合了协变量。领先的精度、优雅的协变量处理架构以及高效的微调,使Chronos-2成为迪卡侬生产栈的明确选择。

解决方案架构
迪卡侬在AWS上对Chronos-2的生产部署旨在实现高效、成本优化且可靠。
下图展示了需求预测管道的高层架构。一个PySpark数据准备管道负责组装输入时间序列。每6个月,一个基于AutoGluon构建的微调任务会将Chronos-2适配到最新数据,并将生成的模型注册到MLflow模型注册表中。在中间的几周内,此步骤会被跳过。推断管道会获取最新注册的模型并运行每周批量预测,而一个PySpark输出管道则将预测结果交付给下游消费者。
基础设施与部署模式
| 组件 | 详情 |
|---|---|
| 计算资源 | Amazon Elastic Compute Cloud (Amazon EC2) m6i.8xlarge(基于CPU的推断),g5.4xlarge(基于GPU的微调) |
| 执行模式 | 每周批量推断 |
| 推断运行时 | 7,000个时间序列约40秒(LATAM),15,000个时间序列约75秒(SEA) |
| 批量大小 | 每次执行约12,000个时间序列 |
| 模型 | 通过AutoGluon使用LoRA微调的Chronos-2 |
| 微调频率 | 每6个月一次 |
| 服务区域 | SEA、LATAM(中东和非洲已规划) |
该架构使用Amazon EC2实例进行批量推断,由Databricks作业触发。数据管道通过迪卡侬现有数据平台上的Airflow进行编排。微调过程使用AutoGluon Chronos集成中的低秩适配(LoRA),无需完全重新训练模型即可高效适配迪卡侬的领域。模型每6个月自动在最新数据上进行一次微调,不同模型通过MLflow按供应区域记录和版本化,并带有特定的超参数。

Chronos-2技术概述
Chronos-2 是一个仅编码器的 Transformer 模型,紧密遵循 T5 编码器设计。它提供多种变体,包括拥有 1.2 亿参数的基础模型(amazon/chronos-2)和拥有 2800 万参数的小型模型(autogluon/chronos-2-small)。与将数值量化为离散 token 的原始 Chronos 不同,Chronos-2 对每个时间序列应用稳健缩放。随后,它将每个序列分割成不重叠的补丁(patch),并通过残差网络将这些补丁映射为实值嵌入。预测结果由分位数头以连续分位数的形式生成。关键的架构创新在于交替注意力模式。每个 Transformer 块在时间注意力(沿单个序列内部的时间轴)和组注意力(在组内各序列之间、每个补丁索引处)之间交替切换。
下图展示了这一设计。相关的时间序列及其协变量被分组在一起。信息既在每个序列内部沿时间维度交换,也在组内各序列之间交换,从而实现了支持协变量的原生多变量预测。
Chronos-2 入门
截至本文撰写时,Chronos-2 模型已从 Hugging Face 被下载超过 1.2 亿次,并可通过 AutoGluon-Cloud 或 Amazon SageMaker JumpStart 供 Amazon SageMaker AI 客户使用。
以下代码改编自 GitHub 上的 Chronos-2 快速入门笔记本,演示了如何运行支持协变量的推理。在生产环境中,Decathlon 使用 AutoGluon Chronos 集成进行微调和推理编排,API 略有不同:
import pandas as pd
from chronos import BaseChronosPipeline, Chronos2Pipeline
# 加载 Chronos-2 管道
pipeline: Chronos2Pipeline = BaseChronosPipeline.from_pretrained(
"amazon/chronos-2",
device_map="cpu"
)
# 历史数据
df = pd.read_csv("sales.csv") # 列:item_id, timestamp, sales, price, store_count
# 预测期间可用的数据
future_df = pd.read_csv("future.csv") # 列:item_id, timestamp, price, store_count
prediction_length = 52
forecast = pipeline.predict_df(df, future_df, target="sales", prediction_length=prediction_length)使用 AutoGluon 进行微调
Decathlon 使用 AutoGluon-TimeSeries 对 Chronos-2 进行微调和部署。借助 AutoGluon,您可以简化端到端的机器学习工作流程,从数据准备到模型训练和部署。利用其 TimeSeries 模块的高层 API,您只需几行代码即可处理数据格式化、协变量管理和 LoRA 微调:
# pip install autogluon.timeseries
from autogluon.timeseries import TimeSeriesDataFrame, TimeSeriesPredictor
tsdf = TimeSeriesDataFrame.from_data_frame(df, id_column="item_id", timestamp_column="timestamp")
future_tsdf = TimeSeriesDataFrame.from_data_frame(future_df, id_column="item_id", timestamp_column="timestamp")
predictor = TimeSeriesPredictor(
prediction_length=52, # 预测范围
target="sales", # 要预测的列
known_covariates_names=["price", "store_count"], # 未来已知的特征
)
predictor.fit(
tsdf,
hyperparameters={
"Chronos2": {
"model_path": "amazon/chronos-2",
"fine_tune": True, # 开启微调;若为 False 则模型以零样本模式使用
}
},
)
predictor.predict(tsdf, known_covariates=future_tsdf)结果与业务影响
Decathlon 从三个维度衡量了 Chronos-2 部署的影响:预测准确性、业务成果和运营效率。
预测准确性提升
与之前使用的传统预测工具相比,Decathlon 部署的微调版 Chronos-2 在各个地区和预测范围均实现了显著的准确性提升。
| 区域 | 预测周期 | 原有WAPE | Chronos-2 WAPE | WAPE降幅 |
|---|---|---|---|---|
| 东南亚 | 12周 | 39% | 28% | 11个百分点 |
| 拉丁美洲 | 12周 | 53% | 38% | 15个百分点 |
| 东南亚 | 52周 | 44% | 38% | 6个百分点 |
| 拉丁美洲 | 52周 | 55% | 46% | 9个百分点 |
pp = 百分点
业务影响
- 库存减少0.3天,降低了营运资金和仓储成本。
- 产品现货率提升0.3个百分点,货架缺货情况减少。
- 现货率每提升1个百分点,销售额增加0.4个百分点,相当于WAPE每改善1个百分点带来约0.12个百分点的销售增长(全区域平均)。
在补货周期上WAPE改善达11–15个百分点,对库存效率、现货率和营收的复合效应十分显著。
运营效率
| 指标 | 之前(TFT) | 之后(Chronos-2) |
|---|---|---|
| 新区域部署时间 | 约6个月(三人) | 2–3个月(数据科学家、机器学习工程师、数据分析师) |
| 推理运行时间 | 10分钟(1万条序列)至15分钟(2.5万条序列),含重新训练 | 约40秒(7千条序列)至约75秒(1.5万条序列) |
| 微调频率 | 每周 | 每6个月 |
| 工程复杂度 | 高(多随机种子训练和推理) | 低(单一模型、LoRA微调、无GPU限制) |
部署时间从6个月缩短至2–3个月,对迪卡侬拓展新市场尤为关键。借助Chronos-2,团队只需基于本地历史数据进行微调即可将预测能力部署到新区域,无需重新设计架构。
生产时间线
Chronos-2已在东南亚和拉丁美洲供应区域投入生产,上述结果即来自这些区域。迪卡侬目前正在将其余供应区域推广该解决方案,计划于2026年完成全区域多区生产部署,中东和非洲地区为下一批扩展目标。
结论与经验教训
迪卡侬的实践表明,时间序列基础模型,尤其是Chronos-2,已具备支撑生产级零售需求预测的能力。通过将严格的模型评估流程与高效的LoRA微调相结合,迪卡侬在12周预测周期上实现了11–15个百分点的WAPE改善。同时,团队将每个区域的部署时间从6个月缩短至2–3个月。对于正在评估基础模型用于预测的零售商而言,迪卡侬的经验提供了一份实用的参考蓝图。
经验教训
- 用自身数据做基准测试:全球排行榜有助于筛选候选模型,但模型在特定领域数据上的排名可能有显著差异。在迪卡侬的案例中,一些全球排名更高的模型在零售分销数据集上表现反而更差。在25,000个产品和101个截断点上进行的测试还表明,Chronos-2配合AutoGluon的简洁微调流程是一项决定性优势,使其从表现良好的零样本模型一跃成为明显领先者。
- 微调释放全部潜力:即使低频微调(每6个月一次)配合低秩适配(LoRA),也能在零样本推理基础上带来可衡量的精度提升。强大的预训练基础模型与领域适配相结合,才是制胜之道。
- 聚焦起步,持续迭代:迪卡侬从单一微调模型投入生产开始,逐步加入协变量。这种务实的方法在降低风险的同时,也能尽早创造价值。
- 基础模型让预测民主化:在单个m6i.8xlarge CPU实例上运行Chronos-2,对7,000–15,000条时间序列的推理时间仅为40–75秒,无需GPU基础设施即可实现该规模的预测。每次周度推理运行成本约为0.03美元,计算开销几乎可以忽略不计。
后续步骤
展望未来,迪卡侬计划在生产环境中部署专家混合(MoE)集成方法。他们的基准测试表明,组合多个TSFM始终优于单一最佳专家模型,其他模型在约40%的产品上仍然表现更优。团队还在向中东和非洲地区扩展,并将价格或天气等外部数据作为协变量纳入模型。此外,他们正在探索Chronos-2的跨学习能力,以应对冷启动产品。
如需将Chronos-2应用于您自己的预测场景,或了解更多关于Chronos-2的信息,请访问Amazon Science博客文章、研究论文,或试用快速入门笔记本。如需使用AutoGluon进行微调,请参阅AutoGluon Chronos教程。
关于作者
译文已达到本站中文翻译的字数上限,剩余内容请查看原文。