任务ID 10702e1f0ffa42bf9a82fb8a9253faf4 · 原始权重 https://huggingface.co/NX-AI/TiRex-1.1-gifteval
#NPU
本仓库将 HuggingFace 上的 NX-AI/TiRex-1.1-gifteval(TiRexZero, 35M 参数, xLSTM sLSTM 架构, patch 32, 9分位数, 训练上下文 2048)适配为可在单卡昇腾 Ascend 910B(npu:0)上真实运行的 GitCode AI model 仓库。支持单变量时序的零样本概率预测(horizon 64),已在 npu:0 上完成真实推理与 CPU-NPU 一致性验证。
model.ckpt 141 MB, Lightning checkpoint, ~35M params, float32tirex.models.tirex.TiRexZero, tirex.ts 1.4.2)| 项 | 值 |
|---|---|
| 模型 | NX-AI/TiRex-1.1-gifteval(~35.3M params, 141 MB ckpt) |
| 架构 | TiRexZero(PatchedTokenizer patch 32 + ResidualBlock + 12×sLSTMBlock embedding 512 heads 4 + Quantile Head 9×32) |
| 任务 | 时间序列预测 probabilistic forecasting(单变量分位数预测,horizon 64),quantiles 9 |
| 输入 | context [batch, time] float32(batch 2, time 512 → 内部至 2048) |
| 输出 | quantiles [batch, horizon, 9] + mean [batch, horizon] |
| 数据契约 | 轴 [batch, time] → [batch, horizon, quantiles];context 512演示,horizon 64,patch 32,raw 数值 |
| 路由 | time-series 概率预测 |
pip install -r requirements.txtpython inference.py[DEVICE] torch.npu.is_available()=True, device_count=2, device_name=Ascend910_9362
[MODEL] loaded, first param device npu:0, dtype torch.float32
[MODEL] total params 35291200
[RESULT] NPU inference elapsed 0.7393s (synchronized)
[RESULT] quantiles shape (2, 64, 9) dtype torch.float32
[RESULT] quantiles[0,:3,:] [[5.9577, 5.9777, 5.9937, 6.0069, 6.0199, 6.0280, 6.0317, 6.0504, 6.0678], ...]
[BENCH] avg 0.7394s throughput 2.70 windows/s
[MEM] NPU:0 allocated 138.4 MB
[DONE] NPU inference SUCCESS| 输出 | shape | max_abs | mean_abs | 阈值 | 结果 |
|---|---|---|---|---|---|
| quantiles | [2,64,9] | 0.01794 | 0.00546 | atol 0.02 rtol 0.01 | PASS |
| mean | [2,64] | 0.01652 | 0.00556 | atol 0.02 rtol 0.01 | PASS |
阈值说明:sLSTMCell 内部 bf16,NPU/CPU 误差约 0.3%。
context 512 → horizon 64, batch 2, float32, warmup 2 + 10 runs:avg 0.7394s per batch, throughput 2.70 windows/s, CPU 1.5738s (NPU 2.13×), 显存 138 MB.
assets/agent_workflow.png — 侦察、环境、加载、NPU 推理、一致性、benchmarkassets/npu_device_call.png — npu-smi、NPU 可用性、参数 deviceassets/model_result.png — python inference.py 完整输出
