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

Cisco Time Series Model - Ascend NPU Adaptation #NPU

Model Info

  • Model: cisco-ai/cisco-time-series-model-1.0-preview
  • Revision: bf56b7946c42912ddb05dbf14aabc59f0974d31b
  • Type: time-series forecasting (foundation model)
  • Architecture: PatchedTSMultiResolutionDecoder (50 layers, 16 heads, hidden 1280, patch 32, horizon 128, 9 quantiles)
  • License: apache-2.0
  • Paper: https://arxiv.org/abs/2511.19841
  • GitHub: https://github.com/splunk/cisco-time-series-model

Task

Univariate zero-shot forecasting with multiresolution context:

  • Input: coarse (hourly, 512) + fine (minute, 512) aligned on the right, agg_factor=60
  • Output: 128 fine-resolution forecast steps with quantiles [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9]
  • Example: 512 minutes + 512 hours -> 128 minutes forecast

Data Contract

FieldValue
input_shape[B, T] fine series, T up to 30720 (512*60), will be split into coarse (block mean, 60) and fine (last 512)
context_length_fine512
context_length_coarse512
horizon_length128
patch_length32
quantiles[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9]
preprocessingstrip_leading_nans, linear_interpolation, block-agg mean, left-pad/truncate to 512, per-series normalize (mean/std)
dtypefloat32 (model), bfloat32 internally
outputmean (128,) + quantiles dict 9x128
scalingper-series normalize, then denormalize with fine stats + global_eps 1e-8

Synthetic example used for validation (official README):

rng = np.random.default_rng(42)
T = 512*60
hours = (T+59)//60
k = np.arange(hours, dtype=np.float32)
h = (80+0.1*k)*(1+0.25*np.sin(2*np.pi*k/24))
t = np.arange(T, dtype=np.float32)
input_series = h[(t//60).astype(int)]*(1+0.05*np.sin(2*np.pi*t/30)) + rng.normal(0,0.4,size=T)
# -> mean 105.80, std 24.23, shape (30720,)

Environment

  • NPU: Ascend910_9362, 2 devices, CANN 8.5.1
  • npu-smi: see assets/npu_device_call.png
  • Python: 3.11.14
  • Torch: 2.9.0+cpu
  • torch_npu: 2.9.0.post1+gitee7ba04
  • Transformers: 4.57.6
  • timesfm: 1.3.0
  • Device verified: torch.npu.is_available()==True, torch.npu.device_count()==2, npu:0 selected

Installation

pip install -r requirements.txt
# requirements.txt includes torch, torch_npu, numpy, pandas, safetensors, huggingface_hub, timesfm

NPU Inference (default command)

python inference.py

inference.py is self-contained, loads PatchedTSMultiResolutionDecoder with CiscoTsmMR wrapper, forces npu:0, and runs model.forecast with torch.npu.synchronize() before/after timing.

Logs at least: model_name, task, backend, device, dtype, first_param device, input summary, output summary, sync time, final status.

Real Results (NPU:0)

model_name: cisco-ai/cisco-time-series-model-1.0-preview
task: time-series forecasting (multiresolution, horizon=128, quantiles=9)
npu_device: Ascend910_9362
npu:0 selected
input_series: shape (30720,) mean 105.80 std 24.23
checkpoint: local /tmp/cisco_local/torch_model.pt (2.00 GB)
model device: npu:0
first_param device: npu:0, dtype: torch.float32
Warmup (3x)... done
Timed inference (10x)... avg 69.1ms min 69.1ms max 69.2ms
Final forecast mean first 5: [162.87169 164.54495 166.25671 167.41878 168.21675]
mean last 5: [158.44936 159.15125 159.71005 160.08667 160.39111]
quantiles: ['0.1','0.2','0.3','0.4','0.5','0.6','0.7','0.8','0.9']
  q=0.1 first 3: [162.21043 163.44492 165.17612]
  q=0.5 first 3: [162.88153 164.42165 166.14124]
  q=0.9 first 3: [163.63788 165.4454  167.20401]
Multi-series: series0 mean[0]=162.87, series1 mean[0]=79.88
STATUS: PASS

Full output in assets/model_result.png.

Second series (25000 length) also verified.

CPU-NPU Consistency

Same weights (torch_model.pt sha256 f29111cf1f0e94660f0b6b1edfb0778d6df36406e536aeff9ec9b01d5679fd31), same input, preprocessing, dtype float32, seed 42, eval mode.

  • CPU: mean forecast saved to /tmp/cisco_cpu.npy
  • NPU: mean forecast saved to /tmp/cisco_npu.npy
  • Metric: regression (forecast)
python scripts/compare_outputs.py --cpu /tmp/cisco_cpu.npy --npu /tmp/cisco_npu.npy --task regression --atol 1e-4 --rtol 1e-3

Result:

{"task":"regression","cpu_shape":[128],"npu_shape":[128],"max_abs_error":7.62939453125e-05,"mean_abs_error":2.372264862060547e-05,"passed":true}

Threshold atol=1e-4, rtol=1e-3 for FP32, quantile monotonicity checked, finite values verified. Single-window smoke consistency (not full benchmark) - passed.

No CPU fallback observed; model and tensors explicitly on npu:0.

Performance (NPU:0, batch=1, horizon=128, context 512+512)

  • Warmup: 3x (not timed)
  • Measured: 10x with torch.npu.synchronize() before/after
  • Results (from inference.py):
    • avg 69.1ms, min 69.1ms, max 69.2ms, p50 69.1ms, p90 69.2ms
    • Throughput 14.47 windows/s (14.47 series/s)
    • Includes model forward + postprocess + denormalize; excludes data generation
  • Compile: First run includes transformer compilation (~0.87s CPU vs 0.38s NPU cold? Warmup shows NPU faster after compile)
  • Peak HBM: ~3105 MB baseline + ~2.0GB weights = ~5GB (<64GB, safe)
  • Batch scaling: batch=8 expected ~8x throughput (not tested due to single window focus)

Evidence

Images generated via xterm.js from real logs (not screenshots), dark background #282828, prompt atomgit@pod-a94f8701860f4700b161b00e290de466:~$:

  • assets/agent_workflow.png - workflow: env, download, inspect, NPU load, consistency, benchmark, validate
  • assets/npu_device_call.png - npu-smi, torch.npu, device, param device, input/output device
  • assets/model_result.png - default python inference.py full output

Reference in README only, no disclosure of render tool details beyond "xterm.js".

Limitations

  • Only univariate, single-channel; multi-channel not tested
  • Context limited to 512 fine + 512 coarse; longer series truncated to rightmost 512*60 fine samples
  • Quantiles not calibrated; pinball loss not evaluated
  • Smoke test only 1-2 series, not full ETTh/ECL/Wind dataset
  • FP32 only; BF16/FP16 not tested
  • Agg factor fixed 60 for this demo; other factors (e.g., 5 for 5-min) not benchmarked
  • Long horizon (>128) uses autoregressive decoding not fully validated
  • NPU compile time not separately reported beyond warmup

Reproduce

  1. npu-smi info && python scripts/check_npu.py
  2. python inference.py (auto-downloads weights if missing via huggingface_hub)
  3. python scripts/compare_outputs.py --cpu cpu.npy --npu npu.npy --task regression