#NPU
cisco-ai/cisco-time-series-model-1.0-preview (PatchedTSMultiResolutionDecoder)bf56b7946c42912ddb05dbf14aabc59f0974d31b (config.json 856 B, model.safetensors 1902.97 MB / torch_model.pt 1903.09 MB, 498,832,800 参数 float32, 615 tensors)mean [128] + 9 分位数 quantiles {0.1..0.9} [9,128] (128 步细粒度预测)timesfm==1.3.0 (TimesFmTorch) + cisco-tsm==1.0.2 (Splunk Cisco TSM) 预览分支 1.0-preview modeling, 配置与权重严格匹配 (resolution 2 embeddings)torch_model.pt 从 safetensors 转换后 model.to("npu:0"), 全部前向在 NPU (包含 patchify, transformer, head, 多步自回归 decode)| 项 | 值 |
|---|---|
| 轴顺序 | 单分辨率 [T] → 多分辨率 [B,512,1] coarse + [B,512,1] fine (模型内部 left-pad+截断, 严格 512) |
| 形状 | T=30720 (512*60) → 粗粒度 512 (60 细聚合均值) + 细粒度 512 (右对齐最后 512) → 输出 mean [128] + quantiles [9,128] |
| 频率 | 隐式频率, 通过 agg_factor=60 区分粗/细分辨率, freq_tensor 零初始化 [B,1] |
| 缩放 | 每序列独立 RevIN (masked mean/std, valid mask 1- pad_mask, eps 1e-8, clamp -1000/1000), inverse 时按 fine 统计量还原 |
| 缺失/掩码 | 左侧零填充掩码 1.0, strip_leading_nans + linear_interpolation, 非有限值替换 NaN |
| 数据 | 合成确定性 (seed 42): h=(80+0.1*k)*(1+0.25*sin(2πk/24)) k 0..512, t=0..30720 输入 h[t//60]*(1+0.05*sin(2πt/30))+N(0,0.4), mean 105.7965 std 24.2271, SHA256 ee9a93eb6c3c, 另验证 sample_data/cpu_utilization.csv 35328 行 OT 均值 33.917 |
| 输出 | mean [128] float32 + quantiles 9 分为单调递增, stats mean 158.966 std 6.279 min 147.15 max 169.58 |
| dtype | float32 (config torch_dtype float32, 全部 float32 前向) |
| 预处理 | build_multi_resolution (粗聚合均值, 细右截) → pad_or_truncate 左填充 → normalize_with_pad → NPU decode 自回归 128 步 (每次输出 patch 128, 聚合回粗流) |
Ascend910_9362 ×2, 目标 npu:0 (3号板 Phy 6 Bus 0000:0B:00.0)torch.npu.is_available()==True, device_count==2snapshot_download → 优先 LOCAL_SNAPSHOT (1.9 GB) → 若 torch_model.pt 缺失则 safetensors→pt 转换 → TimesFmCheckpoint(path=pt) → CiscoTsmMR(... use_resolution_embeddings=True, use_special_token=True) → load_from_checkpoint (cpu) → model._device=torch.device("npu:0"); model._model.to("npu:0"), 输入 build_multi_resolution 后 batch Tensor 显式 to(npu:0) via decodepip install -r requirements.txt
# 额外: cisco-tsm 预览代码由 inference.py 自动处理 (优先 /tmp/cisco-tsm/1.0-preview, 否则 git clone Splunk/cisco-time-series-model)python inference.py加载 LOCAL_SNAPSHOT 或自动从 HF 镜像下载至 ./.cache/cisco-tpm (含 safetensors→pt 转换) → npu:0 → warmup 3 → torch.npu.synchronize() 计时 → 打印真实预测。
关键日志(npu:0):
[INFO] model_name: cisco-ai/cisco-time-series-model-1.0-preview
[INFO] device: npu:0
[INFO] first param device after to(npu:0): npu:0
[INFO] input SHA256 ee9a93eb6c3c shape (30720,) dtype float64
[RESULT] output mean shape (128,) device npu:0 dtype float32 mean 158.966278 std 6.279156
[RESULT] forecast preview first5 [162.87168884277344, 164.54495239257812, 166.2567138671875, 167.4187774658203, 168.2167510986328]
[SUCCESS] NPU inference completed on npu:0 with cisco-time-series-model-1.0-preview (multiresolution 512+512 -> 128)input [30720] mean 105.7965 std 24.2271 min 57.9937 max 173.0328 SHA256 ee9a93eb6c3c, preview first5 [80.1218,80.4156,81.9271,82.7273,82.1921] last5 [155.9303,156.1355,158.1835,159.8495,160.5967]multiresolution 粗 512 (hourly mean) + 细 512 (last 512) → 自回归 1 步 (128/128) 输出 mean [128] + 9 quantilesmean [128] device npu:0 via NPU tensor decode, stats mean 158.966278 std 6.279156 min 147.150620 max 169.584198, preview first5 [162.871688,164.544952,166.256713,167.418777,168.216751] last5 [158.449356,159.151245,159.710052,160.086669,160.391113]quantiles [9,128] single-resolution dev, 0.1 first5 [162.210433,163.444915,165.176116,166.288604,167.188232] 0.5 first5 [162.881530,164.421646,166.141235,167.365264,168.153274] 0.9 first5 [163.637878,165.445404,167.204010,168.523223,169.229324], 单调 True min_diff 0.128708finite True shape_ok True fallback_detected Falseweight safetensors 1902.97 MB (498.83M params), torch_model.pt 1903.09 MB, 615 tensors, config 856 Bcsv 验证 1.0-preview/sample_data/cpu_utilization.csv 35328 行 同逻辑可预测 128 步 (仅展示合成主路径)python .opencode/skills/npu-adapt-skills/scripts/compare_outputs.py --cpu working/cpu_cisco_preview_mean.npy --npu working/npu_cisco_preview_mean.npy --task regression --atol 1e-4 --rtol 1e-3| 输出 | max_abs | mean_abs | passed |
|---|---|---|---|
mean [128] float32 | 7.629e-05 | 2.37e-05 | ✅ (atol 1e-4 rtol 1e-3) |
quantiles [9,128] | 1.22e-04 | 3.1e-05 | ✅ (rtol 1e-3 覆盖, atol 1e-4 边界) |
阈值说明: FP32 默认 1e-4/1e-3 对 50层 1.28k hidden 498M 模型足够严格 (实测 mean 7.6e-05 <1e-4, quant 1.22e-04 略超 atol 但 rtol 通过, 误差源 transformer 累加顺序/NPU vs CPU 浮点结合顺序); 同权重同输入同归一同 decode 路径,
torch.npu.synchronize()后落盘 npy 直接比较; 无 CPU fallback (全部算子在 npu:0, 仅 safetensors→pt 转换在 cpu)。
torch.npu.synchronize() 前后计时, 纯模型 forward, 含多分辨率预处理 + 自回归 decode)单分辨率 30720 → 粗512+细512 → mean[128]+quant[9,128] (50层解码器, 1 自回归步 patch 128)sync elapsed 54.07 ms (warmup 后首测)build_multi_resolution + normalize_with_pad + model.decode 全 NPU 路径, 不含 CSV 读取

由
scripts/render_xterm_evidence.mjs --style raw根据本次真实日志生成,提示符atomgit@pod-a94f8701860f4700b161b00e290de466:~$仅为展示标签,不证明服务器身份。
LOCAL_SNAPSHOT (1.9 GB)。Cannot create tensor with interal format 已忽略; Creating a tensor from a list of numpy ndarrays is extremely slow 为 TimesFM 警告无害。submission/
├── inference.py
├── readme.md
├── requirements.txt
└── assets/
├── agent_workflow.png
├── npu_device_call.png
└── model_result.png