#NPU
Maple728/TimeMoE-50M (https://huggingface.co/Maple728/TimeMoE-50M), local snapshot /tmp/TimeMoE-50M revision cached 2026-08-20model.safetensors 217MB (226,760,264 bytes), torch_dtype bfloat16 config but inference uses float32[1,8,32,64], validated horizon 32 with context 512[B, T] where T=context (512), output [B, T+H] (544), channel 1, univariate seriestransformers AutoModelForCausalLM.from_pretrained(..., trust_remote_code=True) + torch_npu on npu:0series[t] = 0.5*sin(2πt/24)+0.3*sin(2πt/96)+0.01*t + N(0,0.1), length 600, seed 42, np.random.RandomState(42)context + pred_len = 544 points, inp = series[-544:-32] (512 context), forecast horizon 32mean = inp.mean() = 3.100524, std = inp.std()+1e-5 = 1.538619, inp_norm = (inp-mean)/std, SHA256 prefix of inp_norm = 3d0869b35ae00ea8[B,T], dtype float32, no transpose, scaling method and stats persisted in meta.json style logs, channel=1torch.npu.synchronize()fit) required; model is zero-shot forecastingnpu:0npu-smi info: Ascend910, Health OK, HBM 65536 MB, AICore utilization captured in benchmarktorch 2.9.0+cpu, torch_npu 2.9.0.post1+gitee7ba04, transformers 4.40.1, numpy 1.26.4, ASCEND_TOOLKIT_HOME /usr/local/Ascend/cann-8.5.1torch.npu.is_available()==True, device_count=2, device_name Ascend910_9362pip install -r requirements.txtModel snapshot will be downloaded automatically by transformers if /tmp/TimeMoE-50M not present; for offline verification download via:
hf download Maple728/TimeMoE-50M --local-dir /tmp/TimeMoE-50MDefault command (real NPU path, no fallback):
python inference.pyWhat it does:
npu:0 (model.to("npu:0"), 463/463 params on NPU, verified first_param.device==npu:0)[1,512] on npu:0, reports input shape/dtype/device/samplemodel.generate(seq, max_length=544) with torch.npu.synchronize() before/after timingnpu:0 (fails if fallback), prints output shape, forecast tail, finite check, and throughputFrom python inference.py on npu:0 (float32):
[−1.521775, −1.543307, −1.572856, −1.612721, −1.794189][1,544] on npu:0[0.91513115, 0.92191237, 0.92960113, 0.95438886, 1.02315307][4.50856256, 4.51899624, 4.53082657, 4.56896496, 4.67476702]CPU baseline (same weights/input/seed/dtype, float32):
[0.91513002, 0.92191082, 0.92959929, 0.95438600, 1.02315009] (denorm [4.50856066, 4.51899385, 4.53082371, 4.56896067, 4.67476273])SHA256 prefix of normalized input 3d0869b35ae00ea8 matches across runs.
Saved raw arrays and compared with scripts/compare_outputs.py:
python scripts/compare_outputs.py --cpu working/timemoe-50M/cpu_forecast.npy --npu working/timemoe-50M/npu_forecast.npy --task regression --atol 1e-4 --rtol 1e-3
# {"cpu_shape":[32],"npu_shape":[32],"finite":true,"max_abs_error":2.98e-06,"mean_abs_error":1.38e-06,"passed":true}
python scripts/compare_outputs.py --cpu working/timemoe-50M/cpu_output.npy --npu working/timemoe-50M/npu_output.npy --task regression --atol 1e-4 --rtol 1e-3
# {"cpu_shape":[1,544],"npu_shape":[1,544],"finite":true,"max_abs_error":2.98e-06,"mean_abs_error":8.13e-08,"passed":true}regression with thresholds atol=1e-4, rtol=1e-3 (FP32, MoE one_hot custom op note: allow_internal_format=False warning but numerically negligible)out.device.type==npu asserted, 463/463 params on NPUNPU npu:0 benchmark (synchronized, batch 1, [1,512] -> [1,544], float32):
0.3188s, 0.0630s, 0.0618s0.0609s, min 0.0602s, max 0.0617s, p50 0.0609s, p90 0.0611s, p95 0.0614s, throughput 16.43 windows/s0.0632s, second stable 0.0610s~3730 / 65536 MB on NPU 01.2321s → NPU speedup ~20.2xPreprocessing (series generation + z-score) excluded from model latency; end-to-end including preprocessing ~same as model latency since preprocessing <1ms.
Three PNGs generated by scripts/render_xterm_evidence.mjs --style raw from real logs (xterm.js white on dark gray, prompt atomgit@pod-a94f8701860f4700b161b00e290de466:~$ is display-only, not host proof).
– reconnaissance, download, inspect, NPU check, baseline, NPU inference, compare, benchmark, validate.
– npu-smi, torch_npu check, device name, param device/dtype, I/O device.
– python inference.py full output, schema, forecast, timing, SUCCESS.Prompt used: atomgit@pod-a94f8701860f4700b161b00e290de466:~$ (display label, not server proof). Logs sanitized.
[1,8,64] and real datasets (ETThm1, etc.) not yet covered but architecture supports themone_hot kernel emits allow_internal_format=False warning on NPU but remains correct and within tolerancemodel, public, topics NPU Ascend Ascend910)