#NPU
ibm-granite/granite-timeseries-patchtst-fm-r1151f9c6d576281b95c2ff784d0863bd3f12c80f1 (config.json)PatchTSTFMForPrediction (d_model 1024, n_layer 20, n_head 16, d_patch 16, n_patch 512, context_length 8192, prediction_length 64, num_quantile 99)model.safetensors 984 MiB (1031608952 bytes, 253 tensors, float32)past_values tensor shape [B, T, C] with T = context_length = 8192, C = channels (tested with C=1, multivariate supported via channel independence), B = batch (tested 2)
torch.sin(freq * t) + 0.1*randn with t=linspace(0,4π,8192), freq=[1.0,1.2] per batch, seed=42, dtype=float32, device=npu:0std_min=1e-5, use_sinh=True)[batch, time, channel] — do not transpose to [B,C,T] (model uses rearrange internally for B N T)context_length=8192, prediction_length=64 (config), d_patch=16, n_patch=512B*N (verified channel independence)pred_mask|pad_mask|miss_mask; inverse transform on quantile outputsquantile_outputs shape [B, Q, P, C] with Q=99, P=64, C=1, dtype=float32, quantiles monotonic increasingTimeSeriesForecastingPipeline with same context/horizon.Ascend910_9362, 2 devices, torch.npu.is_available()==True, SOC_VERSION=ascend910_9391, CANN 8.5.1npu:0 explicit, torch.npu.synchronize() before/after each timed run, fp32pip install -r requirements.txt
# torch_npu and CANN are pre-installed on Ascend base image
# granite-tsfm from git provides tsfm_public (PatchTSTFMForPrediction)Default loads from local working/models/granite-timeseries-patchtst-fm-r1 if exists, otherwise from HF hub ibm-granite/granite-timeseries-patchtst-fm-r1 (requires HF_ENDPOINT=https://hf-mirror.com).
python inference.py
python inference.py --model-dir working/models/granite-timeseries-patchtst-fm-r1 --device npu:0Expected logs include [NPU] model device: npu:0, [NPU] input device: npu:0, [NPU] warmup, [BENCH], [RESULT], [DONE].
quantile_outputs shape [2,99,64,1] float32, median sample [0.0113, 0.0116, 0.0073, 0.0117, 0.0156] (batch0, q50, first 5 horizons)[2,99,64,1] on npu:0, median diff <1e-6, same monotonic ordering. Full arrays saved as working/cpu_quant.npy / working/npu_quant.npy during validation.model.safetensors sha 1031608952), same input, preprocessing, dtype float32, seed 42, eval mode.python scripts/compare_outputs.py --cpu cpu.npy --npu npu.npy --task forecasting --atol 1e-4 --rtol 1e-3 → PASSED.Three xterm.js rendered PNGs from real logs (style raw, prompt atomgit@pod-a94f8701860f4700b161b00e290de466:~$):
assets/agent_workflow.png — workflow logs (inspect, download, CPU/NPU, compare, bench)assets/npu_device_call.png — npu-smi info + torch.npu.is_available() + npu:0 device proofassets/model_result.png — python inference.py full stdout/stderr on npu:0Images are generated via node scripts/render_xterm_evidence.mjs --manifest evidence.json --output-dir submission/assets --style raw from actual captured logs; no synthetic drawing.
torch_npu and Ascend CANN 8.5.1; CPU-only fallback not validated for performance.npu:0 only; no multi-NPU or batched pipeline beyond 2 windows.