NeoQuasar/Kronos-Tokenizer-base revision 0e0117387f39004a9016484a186a908917e22426 — Kronos 专用分层离散化器,将连续 K 线 (OHLCV 6维) 量化为 hierarchical discrete tokens (s1_bits=10, s2_bits=10, codebook_dim=20, d_model=256, n_enc=4 n_dec=4)NeoQuasar/Kronos-small revision 901c26c1332695a2a8f243eb2f37243a37bea320 — 自回归 Transformer (d_model=512, n_layers=8, n_heads=8, s1_bits=10 s2_bits=10) 负责 token 级自回归预测,上下文窗口 512NPU, Ascend, Ascend910, Kronos, Time-Series, Financial, Tokenizer[batch, time, channel] 其中 channel=6 (open, high, low, close, volume, amount),context 512,时间戳衍生5维时间特征 (minute/hour/weekday/day/month),数值经标准化 (mean/std) 并 clip 到 [-5,5][batch, pred_len, 6] 预测的未来 OHLCV,pred_len=8 (可扩展),值经逆标准化还原到原始价格空间time-series-models.md 判定为 Token 化自回归 (Kronos) 路线,验收对象为 forecast tensor + MAE/RMSE,一致性比较原始 forecast/tmp/Kronos2/tests/data/regression_input.csv (同样发布于 https://raw.githubusercontent.com/shiyu-coder/Kronos/master/tests/data/regression_input.csv) — 2500 行 5分钟 K 线,6 列 OHLCV + timestampsaa5efe0121b7 | 行列数 2500×7 | 列顺序 timestamps, open, high, low, close, volume, amount 固定,dtype float64 (OHLCV) + datetimedf[cols].isnull().any()=False,缺 volume/amount 时以 0 填充并从 close 均值推导 amount[B,T,C],通道 6(x-mean)/ (std+1e-5) 并 clip 到 [-5,5];预测后逆标准化 pred*(std+1e-5)+mean;时间戳通过 calc_time_stamps 生成 5 维周期特征npu:0 | 设备名 Ascend910_9362 | 健康 OK | Power 167W Temp 42C | npu-smi 25.5.5 | CANN 8.5.1torch.npu.is_available()==True, device_count>=1, torch.npu.get_device_name(0)==Ascend910_9362pip install -r requirements.txt
# requirements.txt 已锁定:
# torch>=2.0.0, torch_npu>=2.9.0, numpy, pandas==2.2.2, einops==0.8.1,
# huggingface_hub==0.33.1, tqdm==4.67.1, safetensors==0.6.2, transformers==4.57.6python inference.py默认完成真实 NPU 推理,自动加载本地 working/models/* 或从 HF_ENDPOINT 下载权重,不需额外参数,返回 0 表示成功。
# 指定日志
python inference.py 2>&1 | tee logs/inference.log
# 检查设备
npu-smi info
python -c "import torch; import torch_npu; print(torch.npu.is_available(), torch.npu.get_device_name(0))"torch.npu.set_device(0) + model.to("npu:0") + tokenizer.to("npu:0"),首个参数 device 打印验证.to(device),计时前后 torch.npu.synchronize(),区分首轮编译与稳定推理all(p.device.type=='npu') 校验失败则退出非零open high low close volume amount
11.27 11.28 11.26 11.27 379.0 427161.0
11.27 11.28 11.27 11.27 277.0 312192.0
11.27 11.27 11.26 11.27 380.0 427954.0 open high low close volume amount
2024-07-03 09:55:00 10.897451 10.931036 10.800024 10.917972 1545.138672 1665960.375
2024-07-03 10:00:00 10.900613 10.907956 10.871778 10.884289 719.924438 792042.500
2024-07-03 10:05:00 10.882399 10.890674 10.864932 10.873750 659.090332 716547.000
2024-07-03 10:10:00 10.871227 10.881202 10.857913 10.867245 629.606445 681494.375
2024-07-03 10:15:00 10.864513 10.875556 10.853280 10.863286 607.795288 656790.250
... (剩余 3 行).npy 后 compare_outputs.py --task regression --atol 1e-4 --rtol 1e-3regression_output_512.csv (rtol 1e-5)torch.npu.synchronize() 前后测量三图由 xterm.js 根据本次真实日志生成 (raw 风格, 深灰背景, 提示符 atomgit@pod-a94f8701860f4700b161b00e290de466:~$):
assets/agent_workflow.png — 完整工作流: 侦察、数据检查、下载、加载、NPU 推理、一致性、benchmarkassets/npu_device_call.png — 设备调用: npu-smi、check_npu、torch_npu 可用性、参数 device/dtype、输入输出 deviceassets/model_result.png — 默认 python inference.py 真实输出: schema/窗口摘要、真实预测、同步耗时、SUCCESS 状态

npu:0 FP32;FP16/BF16 未测,阈值需重新校准npu-smi info
python scripts/check_npu.py
python inference.py
# 期望: [STATUS] NPU inference SUCCESS + exit 0 + 预测表格