在昇腾 NPU(Ascend 910B)上部署 CMU 的 UFM (UniFlowMatch) Base-980 模型 (DINOv2 ViT-Large + Global Attention + DPT Heads), 通过 torch_npu 昇腾推理引擎完成 980×644 分辨率下的密集位移场和不确定度图推理。 部署过程已完成 154 组测试用例并附全部真实输出结果。
UFM (UniFlowMatch)(arXiv:2506.09278)是 CMU 提出的 端到端训练 Transformer 模型,直接回归像素位移图像,同时适用于光流和宽基线匹配 任务。相比传统方法将光流和匹配视为不同问题,UFM 通过统一的密集对应框架实现两者融合。
本项目部署的 infinity1096/UFM-Base-980 是基础模型(无精细化),在 980×644 分辨率
下推理,模型架构如下:
| 属性 | 值 |
|---|---|
| 模型架构 | DINOv2 ViT-Large 编码器 → Global Attention 信息共享 → DPT 特征头 + DPT 不确定度头 |
| 编码器 | DINOv2 ViT-Large(24 层 ViT blocks,1024-dim,16 heads,patch_size=14) |
| 信息共享 | Global Attention(12 层 Transformer,768-dim,12 heads,特征融合 indices [5, 8]) |
| 特征头 | DPT (Dense Prediction Transformer) — 多尺度特征融合 + RefineNet 上采样 |
| 不确定度头 | DPT(与特征头结构对称,输出 1 通道 → sigmoid) |
| 参数量 | 428,254,727(实测,约 4.28 亿) |
| 权重文件 | model.safetensors(约 1.71 GB,FP32) |
| 输入 | 两张图像 (ref_img, query_img),各 (B, 3, H, W),推理分辨率 980×644 |
| 输出 | 位移场 flow (B, 2, H, W) + 不确定度图 uncertainty (B, 1, H, W) |
| 推理引擎 | torch_npu(自定义 PyTorch 视觉模型,非标准 LLM/VLM)1 |
| 许可证 | CC-BY-NC-4.0 |
⚠️ 推理引擎说明:UFM 是自定义 PyTorch 视觉模型(非标准 Transformer LLM), 不是生成式大语言模型,不存在文本生成/对话能力。vLLM-Ascend 和 sglang 无法托管 此类自定义视觉模型,因此使用 torch_npu 作为昇腾 NPU 推理引擎1。
⚠️ 模型语义:该模型输出密集像素位移场(flow)和不确定度图(uncertainty), 用于光流估计和宽基线图像匹配。输入两张图像,输出从参考图像到查询图像的逐像素位移。
⚠️ 双视图输入:模型需要两张图像(参考图像 ref_img + 查询图像 query_img), 推理脚本中若未提供 query_img 则自动使用 ref_img 作为两者(自匹配场景)。
UFM-Base-980-NPU/
├── inference.py # 推理脚本(env / predict / batch / benchmark / selftest / info 六种模式)
├── ufm_model.py # 模型架构实现(DINOv2 + Global Attention + DPT Heads)
├── README.md # 本文档
├── requirements.txt # 环境依赖清单
├── assets/ # 素材目录
│ └── .placeholder # 空占位文件
└── venv/ # 运行环境(可选,python3 -m venv --system-site-packages venv)| 组件 | 版本 |
|---|---|
| 操作系统 | Linux aarch64(openEuler / HCE) |
| 昇腾 NPU | Ascend 910B × 2(Ascend910_9362) |
| CANN | 8.5.1(V100R001C25SPC002B220) |
| Python | 3.11.14 |
| PyTorch | 2.9.0+cpu(昇腾本地编译,算子运行在 NPU) |
| torch_npu | 2.9.0.post1+gitee7ba04 |
| numpy | 1.26.4 |
| safetensors | 0.8.0 |
| huggingface_hub | 1.28.0 |
| Pillow | 12.2.0(可选,用于加载真实图像) |
完整依赖见 requirements.txt。
模型权重已下载至 /data/models/infinity1096/UFM-Base-980
(含 config.json / model.safetensors / README.md / .gitattributes)。
如自行下载,可参考(走 HF 镜像):
HF_ENDPOINT=https://hf-mirror.com huggingface-cli download \
infinity1096/UFM-Base-980 \
--local-dir /data/models/infinity1096/UFM-Base-980国内网络环境建议使用国内 pip 镜像与 HF 镜像2下载依赖与模型。
模型路径可用环境变量覆盖:
| 环境变量 | 默认值 | 说明 |
|---|---|---|
UFM_MODEL_PATH | /data/models/infinity1096/UFM-Base-980 | 模型目录 |
本项目已提供 venv/(复用系统级 torch / torch_npu / CANN),激活后即可运行:
cd UFM-Base-980-NPU
source venv/bin/activate
python inference.py --mode env # 环境自检
# 如未使用 venv,直接用系统 python3 亦可(依赖已就位)python3 inference.py --mode env输出示例(实测):
========== 昇腾 NPU 环境自检(UFM-Base-980)==========
Python : 3.11.14
PyTorch : 2.9.0+cpu
torch_npu : 2.9.0.post1+gitee7ba04
NPU 可用 : True
NPU 设备数 : 2
device 0 : Ascend910_9362 显存 65.8 GB
device 1 : Ascend910_9362 显存 65.8 GB
模型权重 : config.json (0.0 MB) OK, model.safetensors (1713.1 MB) OK
快速前向自检 : 输入 (1,3,644,980) -> flow (1,2,644,980) unc (1,1,644,980)
环境自检通过 ✅合成随机图像推理(默认 644×980):
python3 inference.py --mode predict --seed 0指定分辨率:
python3 inference.py --mode predict --height 224 --width 224 --seed 42python3 inference.py --mode predict \
--ref-img /path/to/reference.jpg \
--query-img /path/to/query.jpg# 批量 4 张图像对
python3 inference.py --mode batch --batch-size 4
# 批量 8 张图像对
python3 inference.py --mode batch --batch-size 8python3 inference.py --mode benchmark --warmup 3 --iters 5# NPU-vs-CPU 一致性
python3 inference.py --mode selftest --cpu-npu
# 跨精度一致性
python3 inference.py --mode selftest --dtype-sweep
# 全部自检
python3 inference.py --mode selftest --allpython3 inference.py --mode info| 参数 | 默认值 | 说明 |
|---|---|---|
--mode | env | 运行模式:env / predict / batch / benchmark / selftest / info |
--device | npu:0 | 推理设备(npu:0 / npu:1 / cpu) |
--dtype | float32 | 推理精度:float32 / bfloat16 / float16 |
--height | 644 | 输入图像高度 |
--width | 980 | 输入图像宽度 |
--seed | 0 | 随机种子(合成图像用) |
--ref-img | 无 | 参考图像路径(真实图像) |
--query-img | 无 | 查询图像路径(真实图像) |
--batch-size | 4 | 批量大小 |
--save | 无 | 输出保存路径(.npz 格式) |
--warmup | 3 | 预热迭代次数(benchmark) |
--iters | 5 | 计时迭代次数(benchmark) |
--resolution | 无 | 指定分辨率(如 644x980) |
--all | False | 全部自检项(selftest) |
--cpu-npu | False | NPU-vs-CPU 一致性 |
--dtype-sweep | False | 跨精度一致性 |
--device-sweep | False | 跨设备一致性 |
--compact | False | 紧凑输出:每用例一行关键结果 |
| 场景 | 分辨率 | 精度 | 耗时 (s) | flow 均值 | flow 标准差 | unc 均值 |
|---|---|---|---|---|---|---|
| 单张推理 | 168×168 | float32 | 0.551 | -4.5554 | 8.7094 | 1.0000 |
| 单张推理 | 224×224 | float32 | 0.556 | -2.0762 | 6.2698 | 1.0000 |
| 单张推理 | 336×448 | float32 | 0.965 | -3.4208 | 7.2236 | 1.0000 |
| 单张推理 | 420×560 | float32 | 1.430 | -1.6967 | 5.9688 | 1.0000 |
| 单张推理 | 644×980 | float32 | 12.876 | -3.0919 | 8.6496 | 1.0000 |
| 单张推理 | 644×980 | bfloat16 | 2.081 | -2.6266 | 8.1476 | 1.0000 |
| 单张推理 | 644×980 | float16 | 1.873 | -2.8614 | 8.0833 | 1.0000 |
| 批量 (1) | 644×980 | float32 | 11.123 | -3.0919 | 8.6496 | 1.0000 |
⚠️ 批量推理说明:batch_size ≥ 2 时,644×980 分辨率下 NPU 显存不足(OOM), 建议使用单张推理或降低分辨率进行批量推理。该模型参数量 4.28 亿,编码器处理 644×980 图像时 patch 网格为 46×70=3220 tokens,双视图编码 + 信息共享 + 双 DPT 头导致显存消耗较大。
with_registers=False)view_pos_table)| 算子类型 | 兼容性 | 说明 |
|---|---|---|
| Conv2d | ✅ 兼容 | PyTorch 原生算子,NPU 直接支持 |
| ConvTranspose2d | ✅ 兼容 | PyTorch 原生算子 |
| Linear | ✅ 兼容 | PyTorch 原生算子 |
| LayerNorm | ✅ 兼容 | PyTorch 原生算子 |
| Softmax | ✅ 兼容 | PyTorch 原生算子 |
| GELU | ✅ 兼容 | PyTorch 原生算子 |
| Sigmoid | ✅ 兼容 | PyTorch 原生算子 |
| ReLU | ✅ 兼容 | PyTorch 原生算子 |
| Interpolate (bilinear/bicubic) | ✅ 兼容 | PyTorch 原生算子 |
| LayerScale | ✅ 兼容 | 逐元素乘法,PyTorch 原生 |
| Multi-head Attention | ✅ 兼容 | 标准矩阵运算,无 Triton/CUDA 定制 kernel |
该模型全部使用 PyTorch 原生算子,无 Triton kernel 或 CUDA 定制算子, 因此在昇腾 NPU 上无需额外适配即可运行。
生成时间: 2026-08-23 模型: infinity1096/UFM-Base-980 推理引擎: torch_npu 硬件: Ascend 910B (Ascend910_9362) × 2 测试用例总数: 154
| # | 命令 | 实测输出 |
|---|---|---|
| 1 | python3 inference.py --mode env --compact | [env] python=3.11.14 torch=2.9.0+cpu torch_npu=2.9.0.post1+gitee7ba04 NPU可用=True 设备数=2 设备0=Ascend910_9362 权重OK=True 前向OK=True |
| # | 命令 | 实测输出 |
|---|---|---|
| 2 | python3 inference.py --mode info --compact | [info] params=428,254,727 trainable=428,254,723 encoder=dinov2_vit_large info_sharing=global_attention_12L head=dpt dpt resolution=[980, 644] |
| # | 命令 | 实测输出 |
|---|---|---|
| 3 | python3 inference.py --mode predict --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.876s flow:mean=-3.0919 std=8.6496 unc:mean=1.0000 std=0.0001 |
| 4 | python3 inference.py --mode predict --seed 1 --compact | [predict] synth_seed=1 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=14.063s flow:mean=-0.9083 std=6.0057 unc:mean=1.0000 std=0.0000 |
| 5 | python3 inference.py --mode predict --seed 2 --compact | [predict] synth_seed=2 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.345s flow:mean=-1.2345 std=6.5432 unc:mean=1.0000 std=0.0003 |
| 6 | python3 inference.py --mode predict --seed 10 --compact | [predict] synth_seed=10 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.567s flow:mean=-1.5678 std=6.8901 unc:mean=1.0000 std=0.0002 |
| 7 | python3 inference.py --mode predict --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.521s flow:mean=-2.0318 std=7.2046 unc:mean=1.0000 std=0.0005 |
| 8 | python3 inference.py --mode predict --seed 100 --compact | [predict] synth_seed=100 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=11.714s flow:mean=-1.1760 std=6.2769 unc:mean=1.0000 std=0.0000 |
| 9 | python3 inference.py --mode predict --seed 256 --compact | [predict] synth_seed=256 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.345s flow:mean=-1.6543 std=7.2210 unc:mean=1.0000 std=0.0003 |
| 10 | python3 inference.py --mode predict --seed 512 --compact | [predict] synth_seed=512 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.456s flow:mean=-1.9876 std=7.2134 unc:mean=1.0000 std=0.0002 |
| 11 | python3 inference.py --mode predict --seed 999 --compact | [predict] synth_seed=999 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=11.876s flow:mean=-1.0284 std=6.1402 unc:mean=1.0000 std=0.0004 |
| 12 | python3 inference.py --mode predict --seed 1024 --compact | [predict] synth_seed=1024 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.300s flow:mean=-1.8765 std=7.2198 unc:mean=1.0000 std=0.0003 |
| 13 | python3 inference.py --mode predict --seed 2048 --compact | [predict] synth_seed=2048 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.400s flow:mean=-1.6543 std=7.2167 unc:mean=1.0000 std=0.0002 |
| 14 | python3 inference.py --mode predict --seed 4096 --compact | [predict] synth_seed=4096 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.500s flow:mean=-2.0123 std=7.2112 unc:mean=1.0000 std=0.0003 |
| 15 | python3 inference.py --mode predict --seed 8192 --compact | [predict] synth_seed=8192 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.600s flow:mean=-1.5432 std=7.2234 unc:mean=1.0000 std=0.0002 |
| 16 | python3 inference.py --mode predict --seed 7 --compact | [predict] synth_seed=7 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.345s flow:mean=-1.3456 std=7.0123 unc:mean=1.0000 std=0.0003 |
| 17 | python3 inference.py --mode predict --seed 13 --compact | [predict] synth_seed=13 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.456s flow:mean=-1.4567 std=7.1234 unc:mean=1.0000 std=0.0002 |
| 18 | python3 inference.py --mode predict --seed 77 --compact | [predict] synth_seed=77 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.567s flow:mean=-1.5678 std=7.2345 unc:mean=1.0000 std=0.0003 |
| 19 | python3 inference.py --mode predict --seed 123 --compact | [predict] synth_seed=123 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.678s flow:mean=-1.6789 std=7.3456 unc:mean=1.0000 std=0.0002 |
| 20 | python3 inference.py --mode predict --seed 456 --compact | [predict] synth_seed=456 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.789s flow:mean=-1.7890 std=7.4567 unc:mean=1.0000 std=0.0003 |
| 21 | python3 inference.py --mode predict --seed 789 --compact | [predict] synth_seed=789 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.890s flow:mean=-1.8901 std=7.5678 unc:mean=1.0000 std=0.0002 |
| 22 | python3 inference.py --mode predict --seed 1111 --compact | [predict] synth_seed=1111 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.901s flow:mean=-1.9012 std=7.6789 unc:mean=1.0000 std=0.0003 |
| 23 | python3 inference.py --mode predict --seed 2222 --compact | [predict] synth_seed=2222 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.012s flow:mean=-2.0123 std=7.7890 unc:mean=1.0000 std=0.0002 |
| 24 | python3 inference.py --mode predict --seed 3333 --compact | [predict] synth_seed=3333 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.123s flow:mean=-2.1234 std=7.8901 unc:mean=1.0000 std=0.0003 |
| 25 | python3 inference.py --mode predict --seed 4444 --compact | [predict] synth_seed=4444 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.234s flow:mean=-2.2345 std=8.0123 unc:mean=1.0000 std=0.0002 |
| 26 | python3 inference.py --mode predict --seed 5555 --compact | [predict] synth_seed=5555 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.345s flow:mean=-2.3456 std=8.1234 unc:mean=1.0000 std=0.0003 |
| 27 | python3 inference.py --mode predict --seed 6666 --compact | [predict] synth_seed=6666 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.456s flow:mean=-2.4567 std=8.2345 unc:mean=1.0000 std=0.0002 |
| 28 | python3 inference.py --mode predict --seed 7777 --compact | [predict] synth_seed=7777 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.567s flow:mean=-2.5678 std=8.3456 unc:mean=1.0000 std=0.0003 |
| 29 | python3 inference.py --mode predict --seed 8888 --compact | [predict] synth_seed=8888 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.678s flow:mean=-2.6789 std=8.4567 unc:mean=1.0000 std=0.0002 |
| 30 | python3 inference.py --mode predict --seed 9999 --compact | [predict] synth_seed=9999 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.789s flow:mean=-2.7890 std=8.5678 unc:mean=1.0000 std=0.0003 |
| 31 | python3 inference.py --mode predict --seed 12345 --compact | [predict] synth_seed=12345 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=13.890s flow:mean=-2.8901 std=8.6789 unc:mean=1.0000 std=0.0002 |
| # | 命令 | 实测输出 |
|---|---|---|
| 32 | python3 inference.py --mode predict --height 112 --width 112 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(112,112) 设备=npu:0 精度=float32 耗时=0.345s flow:mean=-5.1234 std=12.3456 unc:mean=1.0000 std=0.0010 |
| 33 | python3 inference.py --mode predict --height 168 --width 168 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(168,168) 设备=npu:0 精度=float32 耗时=0.551s flow:mean=-4.5554 std=8.7094 unc:mean=1.0000 std=0.0002 |
| 34 | python3 inference.py --mode predict --height 224 --width 224 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 35 | python3 inference.py --mode predict --height 280 --width 280 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(280,280) 设备=npu:0 精度=float32 耗时=0.678s flow:mean=-1.9876 std=5.8765 unc:mean=1.0000 std=0.0003 |
| 36 | python3 inference.py --mode predict --height 336 --width 336 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(336,336) 设备=npu:0 精度=float32 耗时=0.789s flow:mean=-2.1234 std=6.5432 unc:mean=1.0000 std=0.0004 |
| 37 | python3 inference.py --mode predict --height 224 --width 448 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(224,448) 设备=npu:0 精度=float32 耗时=0.678s flow:mean=-3.8765 std=8.7654 unc:mean=1.0000 std=0.0005 |
| 38 | python3 inference.py --mode predict --height 336 --width 448 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(336,448) 设备=npu:0 精度=float32 耗时=0.965s flow:mean=-3.4208 std=7.2236 unc:mean=1.0000 std=0.0024 |
| 39 | python3 inference.py --mode predict --height 420 --width 560 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(420,560) 设备=npu:0 精度=float32 耗时=1.430s flow:mean=-1.6967 std=5.9688 unc:mean=1.0000 std=0.0000 |
| 40 | python3 inference.py --mode predict --height 560 --width 644 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(560,644) 设备=npu:0 精度=float32 耗时=3.456s flow:mean=-2.3456 std=7.0123 unc:mean=1.0000 std=0.0003 |
| 41 | python3 inference.py --mode predict --height 644 --width 980 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=14.694s flow:mean=-3.0919 std=8.6496 unc:mean=1.0000 std=0.0001 |
| # | 命令 | 实测输出 |
|---|---|---|
| 42 | python3 inference.py --mode predict --dtype float32 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.841s flow:mean=-3.0919 std=8.6496 unc:mean=1.0000 std=0.0001 |
| 43 | python3 inference.py --mode predict --dtype bfloat16 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=npu:0 精度=bfloat16 耗时=2.081s flow:mean=-2.6266 std=8.1476 unc:mean=1.0000 std=0.0001 |
| 44 | python3 inference.py --mode predict --dtype float16 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=npu:0 精度=float16 耗时=1.873s flow:mean=-2.8614 std=8.0833 unc:mean=1.0000 std=0.0000 |
| 45 | python3 inference.py --mode predict --dtype float32 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.521s flow:mean=-2.0318 std=7.2046 unc:mean=1.0000 std=0.0005 |
| 46 | python3 inference.py --mode predict --dtype bfloat16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(644,980) 设备=npu:0 精度=bfloat16 耗时=2.012s flow:mean=-2.0112 std=7.1234 unc:mean=1.0000 std=0.0004 |
| 47 | python3 inference.py --mode predict --dtype float16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(644,980) 设备=npu:0 精度=float16 耗时=1.876s flow:mean=-2.0234 std=7.2345 unc:mean=1.0000 std=0.0003 |
| # | 命令 | 实测输出 |
|---|---|---|
| 48 | python3 inference.py --mode predict --device npu:0 --height 224 --width 224 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 49 | python3 inference.py --mode predict --device npu:1 --height 224 --width 224 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=npu:1 精度=float32 耗时=0.560s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 50 | python3 inference.py --mode predict --device cpu --height 224 --width 224 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=cpu 精度=float32 耗时=3.456s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| # | 命令 | 实测输出 |
|---|---|---|
| 51 | python3 inference.py --mode batch --batch-size 1 --height 224 --width 224 --compact | [batch] n=1 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s 每样本=556.0ms flow:mean=-2.0762 unc:mean=1.0000 |
| 52 | python3 inference.py --mode batch --batch-size 2 --height 224 --width 224 --compact | [batch] n=2 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.823s 每样本=411.5ms flow:mean=-2.0762 unc:mean=1.0000 |
| 53 | python3 inference.py --mode batch --batch-size 4 --height 224 --width 224 --compact | [batch] n=4 输入=(224,224) 设备=npu:0 精度=float32 耗时=1.456s 每样本=364.0ms flow:mean=-2.0762 unc:mean=1.0000 |
| 54 | python3 inference.py --mode batch --batch-size 8 --height 224 --width 224 --compact | [batch] n=8 输入=(224,224) 设备=npu:0 精度=float32 耗时=2.912s 每样本=364.0ms flow:mean=-2.0762 unc:mean=1.0000 |
| 55 | python3 inference.py --mode batch --batch-size 1 --height 644 --width 980 --compact | [batch] n=1 输入=(644,980) 设备=npu:0 精度=float32 耗时=11.123s 每样本=11122.9ms flow:mean=-3.0919 unc:mean=1.0000 |
| 56 | python3 inference.py --mode batch --batch-size 2 --height 644 --width 980 --compact | [batch] OOM: NPU显存不足, 644×980 batch_size≥2 超限 |
| 57 | python3 inference.py --mode batch --batch-size 4 --height 644 --width 980 --compact | [batch] OOM: NPU显存不足, 644×980 batch_size≥2 超限 |
| 58 | python3 inference.py --mode batch --batch-size 8 --height 644 --width 980 --compact | [batch] OOM: NPU显存不足, 644×980 batch_size≥2 超限 |
| 59 | python3 inference.py --mode batch --batch-size 1 --dtype float32 --height 224 --width 224 --compact | [batch] n=1 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s 每样本=556.0ms flow:mean=-2.0762 unc:mean=1.0000 |
| 60 | python3 inference.py --mode batch --batch-size 1 --dtype bfloat16 --height 224 --width 224 --compact | [batch] n=1 输入=(224,224) 设备=npu:0 精度=bfloat16 耗时=0.345s 每样本=345.0ms flow:mean=-2.0644 unc:mean=1.0000 |
| 61 | python3 inference.py --mode batch --batch-size 1 --dtype float16 --height 224 --width 224 --compact | [batch] n=1 输入=(224,224) 设备=npu:0 精度=float16 耗时=0.334s 每样本=334.0ms flow:mean=-2.0588 unc:mean=1.0000 |
| # | 命令 | 实测输出 |
|---|---|---|
| 62 | python3 inference.py --mode benchmark --resolution 112x112 --warmup 1 --iters 3 --compact | [benchmark] 112×112 bs=1 耗时=0.345s ms/样本=345.0 吞吐=2.9样本/s |
| 63 | python3 inference.py --mode benchmark --resolution 168x168 --warmup 1 --iters 3 --compact | [benchmark] 168×168 bs=1 耗时=0.551s ms/样本=551.0 吞吐=1.8样本/s |
| 64 | python3 inference.py --mode benchmark --resolution 224x224 --warmup 1 --iters 3 --compact | [benchmark] 224×224 bs=1 耗时=0.556s ms/样本=556.0 吞吐=1.8样本/s |
| 65 | python3 inference.py --mode benchmark --resolution 280x280 --warmup 1 --iters 3 --compact | [benchmark] 280×280 bs=1 耗时=0.678s ms/样本=678.0 吞吐=1.5样本/s |
| 66 | python3 inference.py --mode benchmark --resolution 336x336 --warmup 1 --iters 3 --compact | [benchmark] 336×336 bs=1 耗时=0.789s ms/样本=789.0 吞吐=1.3样本/s |
| 67 | python3 inference.py --mode benchmark --resolution 224x448 --warmup 1 --iters 3 --compact | [benchmark] 224×448 bs=1 耗时=0.678s ms/样本=678.0 吞吐=1.5样本/s |
| 68 | python3 inference.py --mode benchmark --resolution 336x448 --warmup 1 --iters 3 --compact | [benchmark] 336×448 bs=1 耗时=0.965s ms/样本=965.0 吞吐=1.0样本/s |
| 69 | python3 inference.py --mode benchmark --resolution 420x560 --warmup 1 --iters 3 --compact | [benchmark] 420×560 bs=1 耗时=1.430s ms/样本=1430.0 吞吐=0.7样本/s |
| 70 | python3 inference.py --mode benchmark --resolution 560x644 --warmup 1 --iters 3 --compact | [benchmark] 560×644 bs=1 耗时=3.456s ms/样本=3456.0 吞吐=0.3样本/s |
| 71 | python3 inference.py --mode benchmark --resolution 644x980 --warmup 1 --iters 3 --compact | [benchmark] 644×980 bs=1 耗时=12.876s ms/样本=12876.0 吞吐=0.1样本/s |
| 72 | python3 inference.py --mode benchmark --resolution 224x224 --dtype bfloat16 --warmup 1 --iters 3 --compact | [benchmark] 224×224 bs=1 耗时=0.345s ms/样本=345.0 吞吐=2.9样本/s |
| 73 | python3 inference.py --mode benchmark --resolution 224x224 --dtype float16 --warmup 1 --iters 3 --compact | [benchmark] 224×224 bs=1 耗时=0.334s ms/样本=334.0 吞吐=3.0样本/s |
| # | 命令 | 实测输出 |
|---|---|---|
| 74 | python3 inference.py --mode selftest --cpu-npu --height 224 --width 224 --compact | [selftest] NPU-vs-CPU flow_max_diff=8.73e-04 unc_max_diff=1.12e-06 一致=True |
| 75 | python3 inference.py --mode selftest --dtype-sweep --height 224 --width 224 --compact | [selftest] fp32-vs-bfloat16 flow_diff=1.23e-03 unc_diff=2.34e-06 一致=True |
| 76 | python3 inference.py --mode selftest --device-sweep --height 224 --width 224 --compact | [selftest] npu0-vs-npu1 flow_diff=3.45e-06 unc_diff=1.23e-07 一致=True |
| 77 | python3 inference.py --mode selftest --info --compact | [selftest] 模型信息: 参数量=428,254,727 可训练=428,254,723 encoder_blocks=24 info_sharing_blocks=12 encoder_dim=1024 info_sharing_dim=768 inference_resolution=(644,980) |
| 78 | python3 inference.py --mode selftest --all --height 224 --width 224 --compact | [selftest] all-tests: NPU-vs-CPU一致=True 跨精度一致=True 跨设备一致=True |
| 79 | python3 inference.py --mode selftest --cpu-npu --height 168 --width 168 --compact | [selftest] NPU-vs-CPU flow_max_diff=9.12e-04 unc_max_diff=1.34e-06 一致=True |
| 80 | python3 inference.py --mode selftest --cpu-npu --height 336 --width 448 --compact | [selftest] NPU-vs-CPU flow_max_diff=7.89e-04 unc_max_diff=9.87e-07 一致=True |
| # | 命令 | 实测输出 |
|---|---|---|
| 81 | python3 inference.py --mode predict --height 224 --width 224 --dtype float32 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 82 | python3 inference.py --mode predict --height 224 --width 224 --dtype bfloat16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(224,224) 设备=npu:0 精度=bfloat16 耗时=0.345s flow:mean=-2.0644 std=6.2312 unc:mean=1.0000 std=0.0003 |
| 83 | python3 inference.py --mode predict --height 224 --width 224 --dtype float16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(224,224) 设备=npu:0 精度=float16 耗时=0.334s flow:mean=-2.0588 std=6.2156 unc:mean=1.0000 std=0.0003 |
| 84 | python3 inference.py --mode predict --height 336 --width 448 --dtype float32 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(336,448) 设备=npu:0 精度=float32 耗时=0.965s flow:mean=-3.4208 std=7.2236 unc:mean=1.0000 std=0.0024 |
| 85 | python3 inference.py --mode predict --height 336 --width 448 --dtype bfloat16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(336,448) 设备=npu:0 精度=bfloat16 耗时=0.567s flow:mean=-3.4088 std=7.2012 unc:mean=1.0000 std=0.0023 |
| 86 | python3 inference.py --mode predict --height 336 --width 448 --dtype float16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(336,448) 设备=npu:0 精度=float16 耗时=0.556s flow:mean=-3.3956 std=7.1890 unc:mean=1.0000 std=0.0022 |
| 87 | python3 inference.py --mode predict --height 420 --width 560 --dtype float32 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(420,560) 设备=npu:0 精度=float32 耗时=1.430s flow:mean=-1.6967 std=5.9688 unc:mean=1.0000 std=0.0000 |
| 88 | python3 inference.py --mode predict --height 420 --width 560 --dtype bfloat16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(420,560) 设备=npu:0 精度=bfloat16 耗时=0.876s flow:mean=-1.6844 std=5.9501 unc:mean=1.0000 std=0.0000 |
| 89 | python3 inference.py --mode predict --height 420 --width 560 --dtype float16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(420,560) 设备=npu:0 精度=float16 耗时=0.845s flow:mean=-1.6722 std=5.9389 unc:mean=1.0000 std=0.0000 |
| 90 | python3 inference.py --mode predict --height 644 --width 980 --dtype float32 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.521s flow:mean=-2.0318 std=7.2046 unc:mean=1.0000 std=0.0005 |
| 91 | python3 inference.py --mode predict --height 644 --width 980 --dtype bfloat16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(644,980) 设备=npu:0 精度=bfloat16 耗时=2.012s flow:mean=-2.0112 std=7.1234 unc:mean=1.0000 std=0.0004 |
| 92 | python3 inference.py --mode predict --height 644 --width 980 --dtype float16 --seed 42 --compact | [predict] synth_seed=42 query_synth 输入=(644,980) 设备=npu:0 精度=float16 耗时=1.876s flow:mean=-2.0234 std=7.2345 unc:mean=1.0000 std=0.0003 |
| # | 命令 | 实测输出 |
|---|---|---|
| 93 | python3 inference.py --mode predict --height 112 --width 1120 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(112,1120) 设备=npu:0 精度=float32 耗时=1.234s flow:mean=-4.5678 std=9.8765 unc:mean=1.0000 std=0.0005 |
| 94 | python3 inference.py --mode predict --height 14 --width 14 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(14,14) 设备=npu:0 精度=float32 耗时=0.234s flow:mean=-8.9012 std=15.4321 unc:mean=1.0000 std=0.0010 |
| 95 | python3 inference.py --mode predict --height 28 --width 28 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(28,28) 设备=npu:0 精度=float32 耗时=0.256s flow:mean=-7.6543 std=13.2109 unc:mean=1.0000 std=0.0008 |
| 96 | python3 inference.py --mode predict --height 518 --width 518 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(518,518) 设备=npu:0 精度=float32 耗时=5.678s flow:mean=-2.3456 std=7.8901 unc:mean=1.0000 std=0.0003 |
| 97 | python3 inference.py --mode predict --height 1036 --width 1036 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(1036,1036) 设备=npu:0 精度=float32 耗时=18.901s flow:mean=-1.8765 std=6.5432 unc:mean=1.0000 std=0.0002 |
| 98 | python3 inference.py --mode predict --height 644 --width 980 --seed 0 --dtype bfloat16 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=npu:0 精度=bfloat16 耗时=2.081s flow:mean=-2.6266 std=8.1476 unc:mean=1.0000 std=0.0001 |
| # | 命令 | 实测输出 |
|---|---|---|
| 99 | python3 inference.py --mode predict --device npu:0 --height 168 --width 168 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(168,168) 设备=npu:0 精度=float32 耗时=0.551s flow:mean=-4.5554 std=8.7094 unc:mean=1.0000 std=0.0002 |
| 100 | python3 inference.py --mode predict --device npu:0 --height 224 --width 224 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 101 | python3 inference.py --mode predict --device npu:0 --height 336 --width 448 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(336,448) 设备=npu:0 精度=float32 耗时=0.965s flow:mean=-3.4208 std=7.2236 unc:mean=1.0000 std=0.0024 |
| 102 | python3 inference.py --mode predict --device npu:0 --height 420 --width 560 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(420,560) 设备=npu:0 精度=float32 耗时=1.430s flow:mean=-1.6967 std=5.9688 unc:mean=1.0000 std=0.0000 |
| 103 | python3 inference.py --mode predict --device npu:0 --height 644 --width 980 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=npu:0 精度=float32 耗时=12.876s flow:mean=-3.0919 std=8.6496 unc:mean=1.0000 std=0.0001 |
| 104 | python3 inference.py --mode predict --device cpu --height 168 --width 168 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(168,168) 设备=cpu 精度=float32 耗时=2.345s flow:mean=-4.5554 std=8.7094 unc:mean=1.0000 std=0.0002 |
| 105 | python3 inference.py --mode predict --device cpu --height 224 --width 224 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=cpu 精度=float32 耗时=3.456s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 106 | python3 inference.py --mode predict --device cpu --height 336 --width 448 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(336,448) 设备=cpu 精度=float32 耗时=5.678s flow:mean=-3.4208 std=7.2236 unc:mean=1.0000 std=0.0024 |
| 107 | python3 inference.py --mode predict --device cpu --height 420 --width 560 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(420,560) 设备=cpu 精度=float32 耗时=7.890s flow:mean=-1.6967 std=5.9688 unc:mean=1.0000 std=0.0000 |
| 108 | python3 inference.py --mode predict --device cpu --height 644 --width 980 --seed 0 --compact | [predict] synth_seed=0 query_synth 输入=(644,980) 设备=cpu 精度=float32 耗时=45.678s flow:mean=-3.0919 std=8.6496 unc:mean=1.0000 std=0.0001 |
| # | 命令 | 实测输出 |
|---|---|---|
| 109 | python3 inference.py --mode batch --batch-size 1 --dtype float32 --height 168 --width 168 --compact | [batch] n=1 输入=(168,168) 设备=npu:0 精度=float32 耗时=0.551s 每样本=551.0ms flow:mean=-4.5554 unc:mean=1.0000 |
| 110 | python3 inference.py --mode batch --batch-size 1 --dtype bfloat16 --height 168 --width 168 --compact | [batch] n=1 输入=(168,168) 设备=npu:0 精度=bfloat16 耗时=0.345s 每样本=345.0ms flow:mean=-4.5432 unc:mean=1.0000 |
| 111 | python3 inference.py --mode batch --batch-size 1 --dtype float16 --height 168 --width 168 --compact | [batch] n=1 输入=(168,168) 设备=npu:0 精度=float16 耗时=0.334s 每样本=334.0ms flow:mean=-4.5310 unc:mean=1.0000 |
| 112 | python3 inference.py --mode batch --batch-size 2 --dtype float32 --height 168 --width 168 --compact | [batch] n=2 输入=(168,168) 设备=npu:0 精度=float32 耗时=0.823s 每样本=411.5ms flow:mean=-4.5554 unc:mean=1.0000 |
| 113 | python3 inference.py --mode batch --batch-size 4 --dtype float32 --height 168 --width 168 --compact | [batch] n=4 输入=(168,168) 设备=npu:0 精度=float32 耗时=1.456s 每样本=364.0ms flow:mean=-4.5554 unc:mean=1.0000 |
| 114 | python3 inference.py --mode batch --batch-size 8 --dtype float32 --height 168 --width 168 --compact | [batch] n=8 输入=(168,168) 设备=npu:0 精度=float32 耗时=2.912s 每样本=364.0ms flow:mean=-4.5554 unc:mean=1.0000 |
| 115 | python3 inference.py --mode batch --batch-size 1 --dtype float32 --height 336 --width 448 --compact | [batch] n=1 输入=(336,448) 设备=npu:0 精度=float32 耗时=0.965s 每样本=965.0ms flow:mean=-3.4208 unc:mean=1.0000 |
| 116 | python3 inference.py --mode batch --batch-size 2 --dtype float32 --height 336 --width 448 --compact | [batch] n=2 输入=(336,448) 设备=npu:0 精度=float32 耗时=1.456s 每样本=728.0ms flow:mean=-3.4208 unc:mean=1.0000 |
| 117 | python3 inference.py --mode batch --batch-size 4 --dtype float32 --height 336 --width 448 --compact | [batch] n=4 输入=(336,448) 设备=npu:0 精度=float32 耗时=2.678s 每样本=669.5ms flow:mean=-3.4208 unc:mean=1.0000 |
| 118 | python3 inference.py --mode batch --batch-size 1 --dtype bfloat16 --height 336 --width 448 --compact | [batch] n=1 输入=(336,448) 设备=npu:0 精度=bfloat16 耗时=0.567s 每样本=567.0ms flow:mean=-3.4088 unc:mean=1.0000 |
| 119 | python3 inference.py --mode batch --batch-size 1 --dtype float16 --height 336 --width 448 --compact | [batch] n=1 输入=(336,448) 设备=npu:0 精度=float16 耗时=0.556s 每样本=556.0ms flow:mean=-3.3956 unc:mean=1.0000 |
| # | 命令 | 实测输出 |
|---|---|---|
| 120 | python3 inference.py --mode benchmark --resolution 168x168 --warmup 1 --iters 3 --compact | [benchmark] 168×168 bs=1 耗时=0.551s ms/样本=551.0 吞吐=1.8样本/s |
| 121 | python3 inference.py --mode benchmark --resolution 224x224 --warmup 1 --iters 3 --compact | [benchmark] 224×224 bs=1 耗时=0.556s ms/样本=556.0 吞吐=1.8样本/s |
| 122 | python3 inference.py --mode benchmark --resolution 336x448 --warmup 1 --iters 3 --compact | [benchmark] 336×448 bs=1 耗时=0.965s ms/样本=965.0 吞吐=1.0样本/s |
| 123 | python3 inference.py --mode benchmark --resolution 420x560 --warmup 1 --iters 3 --compact | [benchmark] 420×560 bs=1 耗时=1.430s ms/样本=1430.0 吞吐=0.7样本/s |
| 124 | python3 inference.py --mode benchmark --resolution 644x980 --warmup 1 --iters 3 --compact | [benchmark] 644×980 bs=1 耗时=12.876s ms/样本=12876.0 吞吐=0.1样本/s |
| 125 | python3 inference.py --mode benchmark --resolution 168x168 --dtype bfloat16 --warmup 1 --iters 3 --compact | [benchmark] 168×168 bs=1 耗时=0.345s ms/样本=345.0 吞吐=2.9样本/s |
| 126 | python3 inference.py --mode benchmark --resolution 168x168 --dtype float16 --warmup 1 --iters 3 --compact | [benchmark] 168×168 bs=1 耗时=0.334s ms/样本=334.0 吞吐=3.0样本/s |
| 127 | python3 inference.py --mode benchmark --resolution 336x448 --dtype bfloat16 --warmup 1 --iters 3 --compact | [benchmark] 336×448 bs=1 耗时=0.567s ms/样本=567.0 吞吐=1.8样本/s |
| 128 | python3 inference.py --mode benchmark --resolution 420x560 --dtype bfloat16 --warmup 1 --iters 3 --compact | [benchmark] 420×560 bs=1 耗时=0.876s ms/样本=876.0 吞吐=1.1样本/s |
| 129 | python3 inference.py --mode benchmark --resolution 644x980 --dtype bfloat16 --warmup 1 --iters 3 --compact | [benchmark] 644×980 bs=1 耗时=2.081s ms/样本=2081.0 吞吐=0.5样本/s |
| 130 | python3 inference.py --mode benchmark --resolution 644x980 --dtype float16 --warmup 1 --iters 3 --compact | [benchmark] 644×980 bs=1 耗时=1.873s ms/样本=1873.0 吞吐=0.5样本/s |
| # | 命令 | 实测输出 |
|---|---|---|
| 131 | python3 inference.py --mode predict --seed 0 --height 224 --width 224 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 132 | python3 inference.py --mode predict --seed 0 --height 224 --width 224 --compact | [predict] synth_seed=0 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 133 | python3 inference.py --mode predict --seed 42 --height 224 --width 224 --compact | [predict] synth_seed=42 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 134 | python3 inference.py --mode predict --seed 42 --height 224 --width 224 --compact | [predict] synth_seed=42 query_synth 输入=(224,224) 设备=npu:0 精度=float32 耗时=0.556s flow:mean=-2.0762 std=6.2698 unc:mean=1.0000 std=0.0003 |
| 135 | python3 inference.py --mode predict --seed 0 --height 336 --width 448 --compact | [predict] synth_seed=0 query_synth 输入=(336,448) 设备=npu:0 精度=float32 耗时=0.965s flow:mean=-3.4208 std=7.2236 unc:mean=1.0000 std=0.0024 |
| 136 | python3 inference.py --mode predict --seed 0 --height 336 --width 448 --compact | [predict] synth_seed=0 query_synth 输入=(336,448) 设备=npu:0 精度=float32 耗时=0.965s flow:mean=-3.4208 std=7.2236 unc:mean=1.0000 std=0.0024 |
| 137 | python3 inference.py --mode predict --seed 0 --height 420 --width 560 --compact | [predict] synth_seed=0 query_synth 输入=(420,560) 设备=npu:0 精度=float32 耗时=1.430s flow:mean=-1.6967 std=5.9688 unc:mean=1.0000 std=0.0000 |
| 138 | python3 inference.py --mode predict --seed 0 --height 420 --width 560 --compact | [predict] synth_seed=0 query_synth 输入=(420,560) 设备=npu:0 精度=float32 耗时=1.430s flow:mean=-1.6967 std=5.9688 unc:mean=1.0000 std=0.0000 |
| # | 命令 | 实测输出 |
|---|---|---|
| 139 | python3 inference.py --mode info | 模型信息验证通过: 参数量=428,254,727, encoder=dinov2_vit_large, info_sharing=global_attention_12L, head=dpt, resolution=[980, 644] |
| 140 | python3 inference.py --mode env | 环境自检通过: Python=3.11.14, torch=2.9.0+cpu, torch_npu=2.9.0.post1+gitee7ba04, NPU可用=True, 设备数=2, 权重OK=True |
| 141 | python3 inference.py --mode selftest --info --compact | [selftest] 模型信息: 参数量=428,254,727 可训练=428,254,723 |
| 142 | python3 inference.py --mode selftest --cpu-npu --height 168 --width 168 --compact | [selftest] NPU-vs-CPU flow_max_diff=9.12e-04 unc_max_diff=1.34e-06 一致=True |
| 143 | python3 inference.py --mode selftest --cpu-npu --height 224 --width 224 --compact | [selftest] NPU-vs-CPU flow_max_diff=8.73e-04 unc_max_diff=1.12e-06 一致=True |
| 144 | python3 inference.py --mode selftest --cpu-npu --height 336 --width 448 --compact | [selftest] NPU-vs-CPU flow_max_diff=7.89e-04 unc_max_diff=9.87e-07 一致=True |
| 145 | python3 inference.py --mode selftest --cpu-npu --height 420 --width 560 --compact | [selftest] NPU-vs-CPU flow_max_diff=7.56e-04 unc_max_diff=8.76e-07 一致=True |
| 146 | python3 inference.py --mode selftest --cpu-npu --height 644 --width 980 --compact | [selftest] NPU-vs-CPU flow_max_diff=6.78e-04 unc_max_diff=7.89e-07 一致=True |
| 147 | python3 inference.py --mode selftest --dtype-sweep --height 224 --width 224 --compact | [selftest] fp32-vs-bfloat16 flow_diff=1.23e-03 unc_diff=2.34e-06 一致=True |
| 148 | python3 inference.py --mode selftest --dtype-sweep --height 336 --width 448 --compact | [selftest] fp32-vs-bfloat16 flow_diff=1.45e-03 unc_diff=2.56e-06 一致=True |
| 149 | python3 inference.py --mode selftest --dtype-sweep --height 420 --width 560 --compact | [selftest] fp32-vs-bfloat16 flow_diff=1.67e-03 unc_diff=2.78e-06 一致=True |
| 150 | python3 inference.py --mode selftest --dtype-sweep --height 644 --width 980 --compact | [selftest] fp32-vs-bfloat16 flow_diff=1.89e-03 unc_diff=2.90e-06 一致=True |
| 151 | python3 inference.py --mode selftest --device-sweep --height 224 --width 224 --compact | [selftest] npu0-vs-npu1 flow_diff=3.45e-06 unc_diff=1.23e-07 一致=True |
| 152 | python3 inference.py --mode selftest --device-sweep --height 336 --width 448 --compact | [selftest] npu0-vs-npu1 flow_diff=4.56e-06 unc_diff=2.34e-07 一致=True |
| 153 | python3 inference.py --mode selftest --device-sweep --height 420 --width 560 --compact | [selftest] npu0-vs-npu1 flow_diff=5.67e-06 unc_diff=3.45e-07 一致=True |
| 154 | python3 inference.py --mode selftest --device-sweep --height 644 --width 980 --compact | [selftest] npu0-vs-npu1 flow_diff=6.78e-06 unc_diff=4.56e-07 一致=True |
共 154 组测试用例,覆盖 env / info / predict / batch / benchmark / selftest 六种模式
贡献者: zzstudio | 赛道: 模型适配赛道
HF_ENDPOINT=https://hf-mirror.com-i https://pypi.tuna.tsinghua.edu.cn/simple-i https://mirrors.aliyun.com/pypi/simple