cisco-ai/cisco-time-series-model-1.0-preview 是 Cisco/Splunk 的多分辨率时序预测基础模型
(arXiv:2511.19841):基于 TimesFM2.0 变体 PatchedTSMultiResolutionDecoder 的
50 层 decoder-only transformer,通过 Resolution Embeddings + Special Token 实现多分辨率
(fine + coarse)上下文高效长序列预测。本仓库将其适配到昇腾 Ascend 910 NPU:架构代码
(Apache-2.0)已内嵌在单文件 inference.py 中,torch_npu 原生跑通 128 步预测。
| 项 | 值 |
|---|---|
| HF 模型 | cisco-ai/cisco-time-series-model-1.0-preview |
| 架构 | PatchedTSMultiResolutionDecoder(TimesFM2 变体) |
| 参数 | 498,832,800(约 4.99 亿) |
| 权重文件 | torch_model.pt(1.99GB,fp32) |
| context_length_fine / coarse | 512 / 512 |
| horizon_length | 128 |
| patch_length | 32 |
| freq_size | 3 |
| num_hidden_layers | 50 |
| hidden_size | 1280 |
| quantiles | 0.1 ~ 0.9(9 个分位数) |
| agg_factor_default | 60 |
| 任务 | 单变量零样本预测,输出 128 点 mean + 9 分位数 |
| 项 | 值 |
|---|---|
| NPU | Ascend 910(Ascend910_9362) |
| CANN | 8.5.1 |
| torch | 2.9.0+cpu |
| torch_npu | 2.9.0.post1 |
| transformers | 4.57.6 |
| 推理设备 | npu:0(固定) |
权重从 hf-mirror 自动下载,缓存路径固定为 ./model_weights/cisco-ai__cisco-time-series-model-1.0-preview/,
启动时优先加载本地缓存,命中则跳过下载。
pip install -r requirements.txt--text 数值数组)python3 inference.py --text "[400.556,401.231,406.269,408.330,406.506,412.002,...]"--text 传细分辨率(fine-resolution)时间序列上下文数值数组(支持任意长度,模型内部会
拆成 fine ≤512 + coarse ≤512 双分辨率上下文)。输出 JSON 包含:
forecast_mean:128 点均值预测quantiles:0.1~0.9 共 9 个分位数预测latency_ms、npu_name、device 等元信息uvicorn inference:app --host 0.0.0.0 --port 8001POST /predict,请求体:
{"text": [400.556, 401.231, 406.269, ...], "horizon": 128}返回推理 JSON:
{
"model": "cisco-ai/cisco-time-series-model-1.0-preview",
"device": "npu:0",
"horizon": 128,
"input_length": 1024,
"latency_ms": 434.678,
"forecast_mean": [379.137, 380.472, ...],
"quantiles": {"0.1": [376.944, ...], ..., "0.9": [503.436, ...]}
}健康检查:GET /health
npu:0。main 入口带 try-except:torch_npu import 失败或 npu:0 不可用时打印清晰错误并优雅退出。PatchedTimeSeriesDecoder、PatchedTSMultiResolutionDecoder 等)来自
Apache-2.0 的 google-research/timesfm pytorch_patched_decoder.py 及
splunk/cisco-time-series-model,已内嵌到 inference.py,自包含运行。strict=False 并报告缺失/多余键)。inference.py:自包含推理入口(CLI + FastAPI 双模式)requirements.txt:依赖清单model_weights/:权重缓存(git 忽略,不提交)assets/:验证截图

