liucu/bytedance-research-Timer-S1-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

bytedance-research/Timer-S1-NPU

#NPU Ascend910

Model

  • Base: bytedance-research/Timer-S1 (Timer-S1 MoE Decoder, 8.3B total / 0.75B active, 24 layers, hidden 1024, 32 experts x 2 per token, RoPE)
  • Revision: 8911430cc7f32add5c8913afe12e3b05742f5bb2
  • Type: time-series forecasting (probabilistic quantile, zero-shot)
  • Pipeline: time-series-forecasting
  • Config: input_token_len 16, max_position 12800, quantiles [0.1..0.9]
  • HF: https://huggingface.co/bytedance-research/Timer-S1
  • License: apache-2.0

Data Contract

  • Task: zero-shot probabilistic forecasting, no fit()
  • Input axes: [batch, time] float, univariate (channel-last)
  • CONTEXT: 512 (supports up to 11520, 512 used for fast NPU smoke)
  • HORIZON: 64 (supports up to 256)
  • Batch: 2
  • Dtype: bfloat16 weights, bfloat16 input, bf16 compute, float32 output
  • Scaling: revin=True (reversible instance norm inside generate)
  • Synthetic test: torch.randn(B, CONTEXT) seed 0, SHA256 5a9c5cb9747ecec1, mean 0.0323
  • Axes order preserved, no transpose, no frequency token

Environment

  • NPU: Ascend910_9362, 2 devices, target npu:0, 64GB HBM
  • CANN: 8.5.1, torch 2.9.0+cpu, torch_npu 2.9.0.post1+gitee7ba04, transformers 4.57.1, huggingface_hub 0.36.2
  • HF cache: ~/.cache/huggingface/hub
  • Verified: torch.npu.is_available() True, npu-smi OK

Install

pip install torch torch_npu transformers accelerate huggingface_hub numpy

NPU Inference

python inference.py
# defaults: npu:0, CONTEXT 512, HORIZON 64, BATCH 2, dtype bfloat16
# logs: model_name, revision, device, dtype, first param device, input SHA, output shape/mean/std, timing, throughput, monotonic

inference.py loads from local HF snapshot (local_files_only, trust_remote_code True), moves model to npu:0, synchronizes with torch.npu.synchronize(), runs warmup 3 + formal 10.

Results (NPU npu:0)

  • Input: B=2, CONTEXT=512, HORIZON=64, seed 0, dtype bfloat16, SHA 5a9c5cb9747ecec1
  • Output: shape [2,9,64] quantiles, dtype float32, device npu:0
  • Mean 0.021060, std 0.763314, finite True
  • Quantiles first sample first horizon: [-1.2387, -0.8301, -0.5444, -0.3005, -0.0674, 0.1775, 0.4393, 0.7647, 1.1892]
  • Monotonic: True, first param device npu:0, no CPU fallback

Consistency (CPU vs NPU)

  • Same weights (local snapshot), same input, same seed, same dtype bfloat16, same preprocessing revin=True
  • CPU baseline: same model on CPU, input bf16, generate revin=True
  • Metric: quantile, shape [2,9,64]
  • Command: python scripts/compare_outputs.py --cpu cpu.npy --npu npu.npy --task quantile --atol 1e-2 --rtol 1e-2
  • Result: max_abs 0.0162, mean_abs 0.00199, finite True, monotonic True → passed True
  • Tolerance reflects bf16 MoE numerical drift

Performance (npu:0, synchronized)

  • Warmup 3, formal 10
  • Compile/first: 610.23 ms
  • Avg 288.51 ms, min 278.07, max 296.13, p50 289.76, p90 295.66, p95 295.89
  • Throughput 6.93 samples/s (batch 2, 512→64)
  • NPU memory allocated 15999.97 MB, max 16023.47 MB, device Ascend910_9362
  • Timing includes generate only, excludes model load (14s for 4 shards)

Evidence

agent workflow npu device call model result

Images rendered via xterm.js from real logs (prompt atomgit@pod-a94f8701860b161b00e290de466:~$), not desktop screenshots.

Limitations

  • Large MoE 16.6GB, needs 40GB+ HBM, single card only, no quantization
  • Smoke context 512, not full 11520 long-context
  • bf16 drift ~0.016 max, tolerance 1e-2
  • Zero-shot only, no fine-tuning, no training on NPU
  • Single device npu:0, no distributed