atlasleong/cisco-time-series-model-1.0-preview-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Cisco Time Series Model 1.0 Preview — Ascend NPU 适配

Real-weights, fail-closed inference entry point for cisco-ai/cisco-time-series-model-1.0-preview on a Huawei Ascend NPU with torch_npu. The model is a 50-layer decoder-only transformer with multi-resolution (coarse/fine) inputs, pre-trained from TimesFM weights and further trained on 300B+ datapoints.

模型简介

本交付是 cisco-ai/cisco-time-series-model-1.0-preview 在华为昇腾 NPU 上的推理适配 (fail-closed 单点入口,engine=torch_npu,默认设备 npu:4 / Ascend910B4-1)。

  • 严格从本地 model.safetensors 加载固定 revision 的真实权重 (绝不使用 torch_model.pt 的 Git LFS 指针、绝不静默换 revision、无隐式联网);
  • 模型、输入张量、输出张量全部断言落在目标 NPU 上;
  • 在 NPU 上运行真实 PatchedTSMultiResolutionDecoder 自回归解码 (CPU 仅用于文档化的确定性预处理);
  • fail-closed:除非 NPU 初始化、严格权重加载、npu:4 上 input/model/output 放置、前向、有限性与输出形状检查全部通过,否则返回非零退出码。
FieldValue
ModelCisco Time Series Model 1.0 preview (univariate zero-shot forecasting)
ArchitecturePatchedTSMultiResolutionDecoder (50 layers, 16 heads, hidden 1280)
Sourcehttps://github.com/splunk/cisco-time-series-model (1.0-preview/modeling/)
HF repocisco-ai/cisco-time-series-model-1.0-preview
Pinned model revisionbf56b7946c42912ddb05dbf14aabc59f0974d31b
Pinned arch commitfaa2adc0ce970239cb0f7b76f4bf97282575d36c
Contextfine ≤512 min + coarse ≤512 h (aggregation factor 60)
Horizon128 fine-resolution points (mean + 0.1…0.9 quantiles)
Hardware / deviceAscend910B4-1 / npu:4

环境依赖清单

PackageVersion (verified)Source / note
torch2.9.0+cpuPre-installed in the container, matched with torch_npu. Do not replace from PyPI.
torch_npu2.9.0Pre-installed in the container, matched with torch. Do not replace from PyPI.
numpy1.26.4Aliyun PyPI mirror
safetensors0.8.0Aliyun PyPI mirror
CANN / drivernpu-smi 25.5.1, Ascend910B4-1Container

分步推理操作流程

  1. 加载昇腾 CANN 环境(路径按容器实际情况):
source /usr/local/Ascend/ascend-toolkit/set_env.sh 2>/dev/null || true
  1. 校验匹配的 torch / torch_npu 运行时(不要从 PyPI 重装):
python - <<'PY'
import torch, torch_npu
print(torch.__version__, torch_npu.__version__, torch.npu.is_available())
PY
  1. 从阿里云镜像安装轻量依赖:
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
  1. 在 npu:4 上运行真实推理:
cd cisco-time-series-model-1.0-preview-npu

python inference.py \
  --model-path /work/pipeline/models/tabular16/cisco-time-series-model-1.0-preview \
  --device npu:4 \
  --result-json logs/npu_result.json

完整测试用例

  • 输入:自撰写、CC0-1.0 许可的确定性合成分钟级序列,共 30,720 点 (512×60),固定 numpy 种子 42,生成器族与模型卡示例一致 (24 h 正弦 + 线性漂移 + 30 分钟纹波 + 高斯噪声);预处理在 CPU, 前向在 NPU。
  • fail-closed 断言:input_coarse_device、input_fine_device、 model_device、output_device 均必须为 npu:4,否则退出码非 0。
  • 输出:128 点 mean forecast + 0.1…0.9 九个分位数,均做有限性检查, all_finite=True,exit_code=0。
  • 确定性:同一模型权重 + 固定种子可复现相同数值输出(见下方真实结果)。

输出结果

真实输出(2026-08-21 本轮最终运行,npu:4,PID 3808811)

[env] torch=2.9.0+cpu torch_npu=2.9.0
[env] npu_available=True npu_count=8 npu_name=Ascend910B4-1
[weights] model_revision=bf56b7946c42912ddb05dbf14aabc59f0974d31b
[weights] file=model.safetensors bytes=1995407184
[weights] sha256=f29111cf1f0e94660f0b6b1edfb0778d6df36406e536aeff9ec9b01d5679fd31
[model] num_layers=50 hidden_size=1280 num_params=498832800
[model] model_device=npu:4 dtype=torch.float32 load_s=6.942
[input] source=self-authored-CC0-deterministic-series license=CC0 points=30720 seed=42
[input] series_head=[80.12188720703125, 80.4156494140625, 81.92713165283203, 82.72737121582031, 82.19216918945312]
[inference] input_device=npu:4/npu:4 model_device=npu:4 output_device=npu:4
[inference] output_tensor_shape=[1, 32, 128, 10] latency_s=0.4958
[forecast] shape=[128] quantiles=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
[forecast] mean_stats={"min": 147.15060424804688, "max": 169.5841827392578, "mean": 158.9662628173828, "std": 6.2791523933410645}
[forecast] mean_head=[162.87168884277344, 164.54493713378906, 166.2566680908203, 167.4187469482422, 168.21673583984375, 168.94268798828125, 169.2166748046875, 169.5841827392578]
[forecast] q10_head=[162.21038818359375, 163.4448699951172, 165.1761016845703, 166.28860473632812, 167.18817138671875, 167.8658905029297, 168.31195068359375, 168.37823486328125]
[exit] code=0 status=PASS
[result] wrote logs/npu_result.json

结构化结果见 logs/npu_result.json:

  • engine=torch_npu、npu_device_name=Ascend910B4-1、requested_device=npu:4
  • 设备放置:input_device=npu:4、input_coarse_device=npu:4、 input_fine_device=npu:4、model_device=npu:4、output_device=npu:4
  • output_tensor_shape=[1, 32, 128, 10]、forecast_shape=[128]、 quantile levels [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
  • mean_stats = min=147.1506 max=169.5842 mean=158.9663 std=6.2792, all_finite=True
  • inference_elapsed_s=0.4958、model_load_s=6.9419、exit_code=0
  • output 摘要字符串非空,包含 forecast shape、mean_head、quantile levels

并发设备证据(真实 PID)

logs/npu_device_call.sanitized.log 显示推理期间 python PID 3808811 挂在 NPU 4(Ascend910B4-1)上,进程显存峰值约 2182 MB(npu-smi 25.5.1)。

截图(从真实 sanitized 日志逐字渲染,无手工编辑值)

agent_workflow

modelagent_live_session

npu_device_call

model_result

agent_conversation

Weights, revision, license

  • model.safetensors — 1,995,407,184 bytes, SHA-256 f29111cf1f0e94660f0b6b1edfb0778d6df36406e536aeff9ec9b01d5679fd31, 615 tensors. Loaded strictly from the pinned local copy.
  • torch_model.pt is still a Git LFS pointer and is not used.
  • Model license: Apache-2.0 (see LICENSE).
  • Vendored architecture sources in modeling/ are Apache-2.0: Cisco/Splunk (patched_decoder_multi_resolution.py, cisco_tsm_mr.py) and Google (pytorch_patched_decoder.py, timesfm_base.py, timesfm_torch.py from timesfm==1.3.0). See THIRD_PARTY_NOTICES.md.

Test input

Deterministic synthetic minute-level series of 30,720 points (512×60), generated with a fixed numpy seed (42) using the same generator family as the model-card example (24 h sinusoid + linear drift + 30-min ripple + Gaussian noise). It is self-authored test data licensed CC0-1.0; no external dataset is downloaded. Preprocessing (context building, masking, normalization) runs on the CPU; the transformer forward runs on the NPU.

Limitations

  • Quantiles are not calibrated (see the official model card): there is no evidence that the 0.1–0.9 range covers the true value 80% of the time.
  • Ascend910 does not support fp64; the model runs in fp32.
  • The forecast is a single autoregressive decode step for horizon 128. Longer horizons re-run decode; this entry point exercises the documented 128-step case.
  • First NPU call includes operator compilation; the recorded ~0.50 s is the steady-state forward latency after model placement.

Evidence and screenshots

Rendered from the real sanitized logs (no hand-edited values):

  • assets/agent_workflow.png — workflow steps + evidence (1440×1800)
  • assets/modelagent_live_session.png — ModelAgent summary: inspect → implement → NPU run → PASS (1440×900)
  • assets/agent_conversation.png — agent summary log rendering (1440×900)
  • assets/npu_device_call.png — focused concurrent npu-smi monitor (python PID 3808811 on NPU 4) (1440×900)
  • assets/model_result.png — inference result excerpt (1440×900)

Source logs:

  • logs/inference.sanitized.log
  • logs/npu_device_call.sanitized.log
  • logs/npu_result.json
  • logs/npu_inference.log
  • evidence/modelagent_summary.log