#NPU
npu:0[B, C, T] 连续序列,输出为 forecast tensor [B, C, H][batch, channel, time],示例 batch 2, channel 1, time 512;不要转置为 [B, T, C],模型内部会自行 patchn_channels * d_model 拼接torch.npu.is_available()==True, device_count==2, 目标设备 npu:0 (逻辑 0 对应物理 6)pip install -r requirements.txt (已配置 hf-mirror, 无需手动设置 HF_ENDPOINT)huggingface-cli download AutonLab/MOMENT-1-small --local-dir /tmp/moment_small 或由 inference.py 自动通过 MOMENTPipeline.from_pretrained 走镜像直连pip install -r requirements.txt
# 权重已由环境变量 HF_ENDPOINT=https://hf-mirror.com 走镜像,如需手动下载:
# huggingface-cli download AutonLab/MOMENT-1-small --local-dir /tmp/moment_small默认命令(已在 npu:0 验证通过):
python inference.py/tmp/moment_small 加载相同权重(若不存在则从 HF Hub 直连下载),显式 .to("npu:0"),所有 Tensor 同步迁移到 npu:0torch.npu.synchronize() 包裹python inference.py 日志,已保存 CPU/NPU .npy 并通过 compare_outputs.py.npy,运行:python scripts/compare_outputs.py --cpu cpu.npy --npu npu.npy --task regression --atol 1e-4 --rtol 1e-3torch.npu.synchronize() 包围,首轮编译与稳定推理分开报告,预热 3 次、正式测试 10 次assets/agent_workflow.png - 侦察、下载、加载、NPU 推理、一致性、benchmark、校验assets/npu_device_call.png - npu-smi、NPU 可用性、设备名、模型参数 device/dtype、输入输出 deviceassets/model_result.png - 默认 python inference.py 完整输出、schema/窗口摘要、真实预测、同步耗时、状态atomgit@pod-a94f8701860f4700b161b00e290de466:~$ 仅为展示标签,不证明服务器身份
