#NPU 真实推理:ibm-granite/granite-timeseries-ttm-r2 已在单卡 Ascend 910 (npu:0) 上完成零样本时间序列点预测验证。
ibm-granite/granite-timeseries-ttm-r2(TinyTimeMixer,TTM-R2,IBM granite-tsfm)TinyTimeMixerForPrediction,约 0.8M 参数,fp32past_values,形状 (batch, context, num_features),fp32,轴顺序 [batch, time, channel]OT 通道(油温,小时级)最后 512 步 → 预测未来 96 步
f18de3ad269cef59bb07b5438d79bb3042d3be49bdeecf01c1cd6d29695ee066prediction_outputs,形状 (batch, prediction_length, num_features),已 inverse transformTTM_DATA_CSV 传入,脚本自动取最后 context+prediction 步npu:0pip install -r requirements.txtpython inference.py # 自动下载权重到 ./model 并跑 npu:0 推理
TTM_MODEL_DIR=/path python inference.py # 使用本地权重
python inference.py --bench # 稳定延迟 benchmark模型为自包含实现:inference.py 内嵌 TinyTimeMixer 配置与建模代码(镜像自 IBM granite-tsfm / tinytimemixer,Apache-2.0),不依赖 trust_remote_code 执行。权重加载遵守 HF_ENDPOINT 镜像配置,正式推理从本地加载。
[21.579, 21.247, 21.089, 20.803, 20.508, 20.384, 20.164, 19.826][17.568, 17.772, 17.990, 18.261, 18.480, 18.841, 19.140, 19.237]同一权重、同一数据窗口、同一 seed、fp32:
| 输出 | shape | max_abs_error | mean_abs_error | atol | rtol | 结果 |
|---|---|---|---|---|---|---|
| prediction_outputs | (1, 96, 1) | 0.000864 | 0.000406 | 1e-4 | 1e-3 | PASS |
NPU 推理全程在 npu:0 完成,无 CPU fallback。
— 侦察、数据检查、CPU 基线、NPU 推理、一致性、benchmark、校验完整流程
— npu-smi、NPU 可用性、模型与输入输出 Tensor 设备
— 默认 python inference.py 的真实完整输出以上图片由 xterm.js 根据本次真实日志生成,非手工截图。