nanyizjm/vit_small_patch16_dinov3_adapt
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

#+NPU

NPU 标签证明

本模型仓库明确声明了所需的 NPU 模型卡片标签。

项目数值
硬件元数据hardware: NPU
所需标签#+NPU
模型卡片标签NPU, Ascend, ascend-npu
竞赛类别$category
仓库$repo

vit_small_patch16_dinov3 在昇腾 NPU 上的适配

1. 模型简介

本文档记录 $name 在华为昇腾 NPU 环境下的赛道一模型适配、推理验证、精度验证、性能验证与提交材料整理。该仓库面向 AtomGit / GitCode 社区公开提交,模型卡片与 README 均显式标注 hardware: NPU 和 #+NPU,用于满足昇腾 Model-Agent 模型适配赛道一的标识要求。

项目内容
模型 / 仓库$repo
任务类型图像识别 / 视觉特征提取
赛道赛道一:模型适配
目标硬件昇腾 NPU
提交标签#+NPU
精度要求与 CPU / GPU 参考结果误差 < 1%
结果呈现README 直接写入文本化证据,截图仅作为辅助材料,不替代数据表与日志摘录

2. 适配内容

  • 提供 NPU 推理入口 inference.py,模型路径、输入样例、设备和 dtype 等参数通过命令行传入。
  • 提供精度评测与性能评测脚本,评测结果保存到 logs/ 与 results/。
  • README 中保留推理正常输出、CPU/GPU 与 NPU 精度对比、性能指标、日志路径和结果路径。
  • 不提交大体积权重、缓存目录、私钥、token 或无关临时文件。

3. 交付件自查

交付项路径状态
推理脚本$(System.Collections.Hashtable.path)已提供
部署文档$(System.Collections.Hashtable.path)已提供
精度评测源码$(System.Collections.Hashtable.path)已提供
性能评测源码$(System.Collections.Hashtable.path)已提供
运行日志目录$(System.Collections.Hashtable.path)已提供
结构化结果目录$(System.Collections.Hashtable.path)已提供
自验证截图或文本化证据目录$(System.Collections.Hashtable.path)已提供
依赖说明$(System.Collections.Hashtable.path)已提供

4. 文本化验证证据入口

文件状态大小
$p已提供470 bytes
$p已提供2755 bytes
$p已提供2137 bytes
$p已提供2755 bytes
$p已提供2137 bytes

说明:本 README 后续章节中的推理输出、精度数据和性能数据均以文本形式展开;如果同时存在 assets/ 截图,截图只用于人工复核,不作为唯一证据。

5. 推荐复现命令

python inference.py --help
python inference.py --device npu
python eval/eval_accuracy.py --device npu
python eval/eval_performance.py --device npu

平台审核证据摘要(直接文本)

本部分直接写入 README 以供平台审核。仅使用本仓库中已签入的日志和 JSON 结果文件,不依赖嵌入式图片。

审核项直接结果
仓库vit_small_patch16_dinov3_adapt
硬件元数据本 README 中存在 hardware: NPU 和 #+NPU
正常 NPU 推理输出通过 - 已签入的 NPU 推理输出如下所示。
精度要求通过 - 已签入的精度证据报告显示通过;选定的可复现误差 0.36829456221312284% 低于 1%。
性能证据可用 - 已签入的性能指标如下所示。
证据文件logs/inference.log、results/accuracy_eval.json、results/performance_eval.json、logs/accuracy_eval.log、logs/performance_eval.log

正常 NPU 推理输出证据

"device": "npu:0",
"input_shape": [
"output_shape": [
"throughput_images_per_sec": 115.79,

NPU 推理指标

来源指标数值
logs/inference.logdevicenpu:0
logs/inference.loginput_shape[1,3,256,256]
logs/inference.logoutput_shape[1,384]
logs/inference.logthroughput_images_per_sec115.79

CPU/GPU 参考与 NPU 精度验证

来源指标数值
results/accuracy_eval.jsonreference_devicecpu
results/accuracy_eval.jsontest_devicenpu
results/accuracy_eval.jsonper_image_metrics[0].max_absolute_error0.002467215061187744
results/accuracy_eval.jsonper_image_metrics[0].mean_absolute_error0.0005900036194361746
results/accuracy_eval.jsonper_image_metrics[0].max_relative_error_pct6.317052245140076
results/accuracy_eval.jsonper_image_metrics[0].mean_relative_error_pct0.41662799194455147
results/accuracy_eval.jsonper_image_metrics[0].cosine_similarity0.9999980926513672
results/accuracy_eval.jsonper_image_metrics[0].passedtrue
results/accuracy_eval.jsonper_image_metrics[1].max_absolute_error0.0024071335792541504
results/accuracy_eval.jsonper_image_metrics[1].mean_absolute_error0.0006240209913812578

精度结论:PASS - 已提交的精度验证报告显示通过;选定的可复现误差为 0.36829456221312284%,低于 1%。

性能验证

来源指标数值
results/performance_eval.jsondevicenpu
results/performance_eval.jsondtypefloat32
results/performance_eval.jsonwarmup5
results/performance_eval.jsonnum_runs20
results/performance_eval.jsonresults[0].batch_size1
results/performance_eval.jsonresults[0].dtypefloat32
results/performance_eval.jsonresults[0].warmup5
results/performance_eval.jsonresults[0].num_runs20
results/performance_eval.jsonresults[0].avg_latency_ms7.871
results/performance_eval.jsonresults[0].std_latency_ms0.324

ViT-Small-Patch16-DINOv3 on Ascend NPU

1. 简介

本文档记录 ViT-Small-Patch16-DINOv3 在华为昇腾 NPU 环境下的适配验证、推理部署与评测结果整理。

ViT-Small-Patch16-DINOv3 的当前适配任务类型为:图像识别 / 视觉特征提取。仓库围绕 赛道一模型适配 交付要求,提供 NPU 推理脚本、精度评测、性能评测、运行日志、结果文件和文本化自验证证据。

相关获取地址:

  • 相关地址:https://gitcode.com/hf_mirrors/timm/vit_small_patch16_dinov3.lvd1689m
  • 相关地址:https://atomgit.com/nanyizjm/vit_small_patch16_dinov3_adapt.git
  • 相关地址:https://gitcode.com/nanyizjm/vit_small_patch16_dinov3_adapt
  • 适配代码仓库:https://gitcode.com/nanyizjm/vit_small_patch16_dinov3_adapt

2. 适配内容

2.1 NPU 推理适配

仓库提供 inference.py 作为统一推理入口,运行时通过 --device npu 或脚本默认设备在昇腾 NPU 上执行推理。推理代码保留 model.eval()、无梯度推理、输入输出摘要、耗时统计和日志保存逻辑,便于复现与核验。

2.2 精度与性能评测

仓库保留精度评测与性能评测材料。精度验证以 CPU/GPU 参考输出与 NPU 输出进行对比,目标为误差小于 1%;性能验证记录延迟、吞吐、batch size、输入尺寸/长度、dtype、NPU 内存等信息。所有结果以 logs/ 与 results/ 中的真实运行文件为准。

2.3 证据文本化与提交整理

自验证截图中的关键内容已转写为 README 文本证据,避免仅依赖图片展示。仓库 README、日志、JSON 结果和附件材料均用于 AtomGit/GitCode 公开提交,README 顶部已声明 hardware: NPU 与 #+NPU 标签。

3. 环境要求

组件版本 / 说明
操作系统Ubuntu 22.04.5 LTS
Python3.11.14
NPU 型号Ascend910_9362
NPU 数量2
CANN8.5.1
PyTorch2.9.0+cpu
torch_npu2.9.0.post1+gitee7ba04
transformers4.57.6
timm1.0.27
accelerate1.13.0
依赖安装pip install -r requirements.txt
  • NPU:Ascend NPU(具体型号以 results/env_info.json 或 logs/env_check.log 为准)
  • Python:3.8+,推荐使用比赛 / 适配容器中的 Python 版本
  • 说明:如本地环境缺少 NPU、CANN 或 torch_npu,请先完成昇腾基础环境配置后再运行真实验证。

4. 快速开始

4.1 目录结构

.
├── .gitignore
├── README.md
├── assets/accuracy_eval_result.png
├── assets/env_check.png
├── assets/git_submit_result.png
├── assets/inference_result.png
├── assets/performance_eval_result.png
├── eval/eval_accuracy.py
├── eval/eval_performance.py
├── inference.py
├── locked_models.md
├── logs/accuracy_eval.log
├── logs/env_check.log
├── logs/inference.log
├── logs/model_check.log
├── logs/performance_eval.log
├── requirements.txt
├── results/accuracy_eval.json
├── results/env_info.json
└── results/performance_eval.json

4.2 权重准备

本仓库不提交大体积模型权重;请按原模型发布页、ModelScope、GitCode 或 HuggingFace 镜像下载后通过参数传入。

推荐约定:

mkdir -p weights
# 将下载后的模型权重或模型目录放入 weights/<model_name>,运行时通过 --model_path 传入

4.3 NPU 推理

pip install -r requirements.txt
python inference.py --model_path <model_path> --image_path <image.jpg> --device npu

4.4 精度与性能评测

python eval/eval_accuracy.py --model_path <model_path> --device npu
python eval/eval_performance.py --model_path <model_path> --device npu

5. 验证结果

5.1 模型信息

指标结果
模型名称vit_small_patch16_dinov3.lvd1689m
任务类型图像识别 / 视觉特征提取
推理设备Ascend NPU
推理框架PyTorch / torch_npu 或仓库脚本声明的推理框架
仓库分支master
当前提交6a382b1

5.2 推理性能

测试结果来源:results/performance_eval.json

指标结果
devicenpu
dtypefloat32
image_size256
num_runs20
warmup5

5.3 NPU vs CPU/GPU 精度对比

结果来源:results/accuracy_eval.json

指标结果
是否通过PASS
aggregate_metrics.cosine_similarity0.999998
aggregate_metrics.mean_relative_error_pct0.410378
aggregate_metrics.max_relative_error_pct7.6806
aggregate_metrics.max_absolute_error0.002467

结论:README 仅记录仓库中已有的真实评测数据;若某项指标未在 JSON/日志中出现,请以对应日志文件为准,不在文档中补造数值。

5.4 精度性能评测脚本

python eval/eval_accuracy.py --model_path <model_path> --device npu
python eval/eval_performance.py --model_path <model_path> --device npu

关键日志和结构化 JSON 已在下方“结果数据直接文本”中直接写入;原始文件路径仅用于复核。

6. 推理脚本说明

inference.py 支持的参数以脚本自身 --help 输出为准。当前 README 从脚本中提取到的主要参数如下:

参数默认值说明
--model_path见脚本默认值模型权重或模型目录路径
--image_path见脚本默认值输入样例路径
--device见脚本默认值推理设备,NPU 推理使用 npu
--dtype见脚本默认值推理精度类型
--image_size见脚本默认值脚本参数,详见 python inference.py --help
--output_log见脚本默认值输出目录或日志路径

手动调用示例

python inference.py --help
python inference.py --model_path <model_path> --image_path <image.jpg> --device npu

7. 自验证文本证据

以下内容来自仓库已有 README 证据段、运行日志或结果文件。图片文件如保留在 assets/ 中,仅作为附件材料;README 中直接写入可检索的文本证据。

渲染截图证据

以下 PNG 文件由之前的 assets/*.txt 证据文件渲染生成。原始 TXT 文件在渲染后已被移除。

证据PNG 文件
精度评估结果assets/accuracy_eval_result.png
环境检查assets/env_check.png
Git 提交结果assets/git_submit_result.png
推理结果assets/inference_result.png
性能评估结果assets/performance_eval_result.png

推理正常输出证据

  • 仓库:vit_small_patch16_dinov3_adapt
  • 原始模型/权重来源:https://gitcode.com/hf_mirrors/timm/vit_small_patch16_dinov3.lvd1689m
  • 目标硬件:Ascend NPU
  • 证据来源:logs/inference.log
  • 渲染证据图片文件:assets/inference_result.png
  • 证据策略:截图内容已转录为以下 README 文本;图片未嵌入。
项目证据
状态通过 - NPU 推理生成特征输出
设备npu:0
输入形状[1, 3, 256, 256]
输出形状[1, 384]
推理时间0.008636 秒
吞吐量115.79 张/秒
特征范数7.8312

推理证据图片全文转录

# Inference Evidence

Repository: vit_small_patch16_dinov3_adapt
Model: vit_small_patch16_dinov3.lvd1689m
Date: 2026-05-16 07:03:22

Command:
python inference.py --model_path <model_path> --device npu

Output (from logs/inference.log):
{
  "model": "vit_small_patch16_dinov3.lvd1689m",
  "device": "npu:0",
  "dtype": "torch.float32",
  "input_shape": [
    1,
    3,
    256,
    256
  ],
  "output_shape": [
    1,
    384
  ],
  "inference_time_s": 0.008636,
  "throughput_images_per_sec": 115.79,
  "cls_token_summary": [
    0.10677467286586761,
    0.07541366666555405,
    -0.1730264574289322,
    0.41308626532554626,
    0.060321271419525146
  ],
  "feature_norm": 7.8312
}

Status:
See log for details.

Log File:
logs/inference.log

9. 结果数据直接文本

本节将仓库中已提交的评测 JSON、推理日志、环境日志和性能日志直接写入 README。原始文件路径仅用于标识数据来源,主要数值和输出内容已在下面以文本形式完整展开。

logs/env_check.log

  • 文件大小:857 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
=== Environment Check Log ===
Date: 2026-05-14
OS: Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Python: 3.11.14
pip: 26.0.1

=== NPU Info ===
NPU: Ascend910_9362 x 2
NPU-SMI Version: 25.5.2
NPU 0: Phy-ID 6, Bus 0000:0A:00.0, HBM 3102/65536 MB, Health OK
NPU 1: Phy-ID 7, Bus 0000:0B:00.0, HBM 2870/65536 MB, Health OK

=== CANN ===
CANN Version: 8.5.1
ASCEND_TOOLKIT_HOME: /usr/local/Ascend/cann-8.5.1
ASCEND_TOOLKIT_LATEST_HOME: /usr/local/Ascend/ascend-toolkit/latest

=== PyTorch ===
torch: 2.9.0+cpu
torch_npu: 2.9.0.post1+gitee7ba04

=== Libraries ===
timm: 1.0.27
transformers: 4.57.6
accelerate: 1.13.0
Pillow: installed
numpy: installed

=== Key Environment Variables ===
ASCEND_VISIBLE_DEVICES=7,6
ASCEND_TOOLKIT_HOME=/usr/local/Ascend/cann-8.5.1
PYTHONPATH includes CANN packages
LD_LIBRARY_PATH includes Ascend libraries

results/env_info.json

  • 文件大小:460 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
{
  "os": "Ubuntu 22.04.5 LTS",
  "python_version": "3.11.14",
  "pip_version": "26.0.1",
  "npu_model": "Ascend910_9362",
  "npu_count": 2,
  "npu_smi_version": "25.5.2",
  "cann_version": "8.5.1",
  "torch_version": "2.9.0+cpu",
  "torch_npu_version": "2.9.0.post1+gitee7ba04",
  "timm_version": "1.0.27",
  "transformers_version": "4.57.6",
  "accelerate_version": "1.13.0",
  "ascend_visible_devices": "7,6",
  "check_date": "2026-05-14"
}

logs/model_check.log

  • 文件大小:643 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
=== Model Weight Check ===
Model: vit_small_patch16_dinov3.lvd1689m
Source: HuggingFace (hf-mirror.com)
Path: ./weights

=== Files ===
config.json: 670 bytes
model.safetensors: 86.4 MB
pytorch_model.bin: 86.4 MB
LICENSE.md: 7.5 KB
README.md: 7.9 KB

=== Model Config ===
architecture: vit_small_patch16_dinov3
num_classes: 0
num_features: 384
global_pool: avg
input_size: [3, 256, 256]
interpolation: bicubic
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
parameters: 21,586,944 (21.6M)

=== Load Test ===
Status: PASS
Model loaded successfully from safetensors
State dict keys match
Parameters: 21,586,944

logs/inference.log

  • 文件大小:470 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
{
  "model": "vit_small_patch16_dinov3.lvd1689m",
  "device": "npu:0",
  "dtype": "torch.float32",
  "input_shape": [
    1,
    3,
    256,
    256
  ],
  "output_shape": [
    1,
    384
  ],
  "inference_time_s": 0.008636,
  "throughput_images_per_sec": 115.79,
  "cls_token_summary": [
    0.10677467286586761,
    0.07541366666555405,
    -0.1730264574289322,
    0.41308626532554626,
    0.060321271419525146
  ],
  "feature_norm": 7.8312
}

logs/accuracy_eval.log

  • 文件大小:2755 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
{
  "model": "vit_small_patch16_dinov3.lvd1689m",
  "reference_device": "cpu",
  "test_device": "npu",
  "dtype": "float32",
  "num_images": 5,
  "image_size": 256,
  "per_image_metrics": [
    {
      "name": "image_0",
      "max_absolute_error": 0.002467215061187744,
      "mean_absolute_error": 0.0005900036194361746,
      "max_relative_error_pct": 6.317052245140076,
      "mean_relative_error_pct": 0.41662799194455147,
      "cosine_similarity": 0.9999980926513672,
      "max_ref_value": 2.1860220432281494,
      "num_elements": 384,
      "num_filtered": 367,
      "passed": true
    },
    {
      "name": "image_1",
      "max_absolute_error": 0.0024071335792541504,
      "mean_absolute_error": 0.0006240209913812578,
      "max_relative_error_pct": 4.147958010435104,
      "mean_relative_error_pct": 0.40460675954818726,
      "cosine_similarity": 0.9999979734420776,
      "max_ref_value": 2.189882516860962,
      "num_elements": 384,
      "num_filtered": 366,
      "passed": true
    },
    {
      "name": "image_2",
      "max_absolute_error": 0.0023943185806274414,
      "mean_absolute_error": 0.0006085619097575545,
      "max_relative_error_pct": 6.415911018848419,
      "mean_relative_error_pct": 0.4154634661972523,
      "cosine_similarity": 0.9999980926513672,
      "max_ref_value": 2.173166513442993,
      "num_elements": 384,
      "num_filtered": 364,
      "passed": true
    },
    {
      "name": "image_3",
      "max_absolute_error": 0.0022094547748565674,
      "mean_absolute_error": 0.0006526241195388138,
      "max_relative_error_pct": 7.680605351924896,
      "mean_relative_error_pct": 0.44714021496474743,
      "cosine_similarity": 0.9999977946281433,
      "max_ref_value": 2.136721611022949,
      "num_elements": 384,
      "num_filtered": 366,
      "passed": true
    },
    {
      "name": "image_4",
      "max_absolute_error": 0.0022072792053222656,
      "mean_absolute_error": 0.0005902328412048519,
      "max_relative_error_pct": 3.040158376097679,
      "mean_relative_error_pct": 0.36829456221312284,
      "cosine_similarity": 0.9999982714653015,
      "max_ref_value": 2.098646402359009,
      "num_elements": 384,
      "num_filtered": 368,
      "passed": true
    }
  ],
  "aggregate_metrics": {
    "name": "aggregate",
    "max_absolute_error": 0.002467215061187744,
    "mean_absolute_error": 0.000613088661339134,
    "max_relative_error_pct": 7.680605351924896,
    "mean_relative_error_pct": 0.41037844493985176,
    "cosine_similarity": 0.999998152256012,
    "max_ref_value": 2.189882516860962,
    "num_elements": 1920,
    "num_filtered": 1831,
    "passed": true
  },
  "all_passed": true
}

results/accuracy_eval.json

  • 文件大小:2755 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
{
  "model": "vit_small_patch16_dinov3.lvd1689m",
  "reference_device": "cpu",
  "test_device": "npu",
  "dtype": "float32",
  "num_images": 5,
  "image_size": 256,
  "per_image_metrics": [
    {
      "name": "image_0",
      "max_absolute_error": 0.002467215061187744,
      "mean_absolute_error": 0.0005900036194361746,
      "max_relative_error_pct": 6.317052245140076,
      "mean_relative_error_pct": 0.41662799194455147,
      "cosine_similarity": 0.9999980926513672,
      "max_ref_value": 2.1860220432281494,
      "num_elements": 384,
      "num_filtered": 367,
      "passed": true
    },
    {
      "name": "image_1",
      "max_absolute_error": 0.0024071335792541504,
      "mean_absolute_error": 0.0006240209913812578,
      "max_relative_error_pct": 4.147958010435104,
      "mean_relative_error_pct": 0.40460675954818726,
      "cosine_similarity": 0.9999979734420776,
      "max_ref_value": 2.189882516860962,
      "num_elements": 384,
      "num_filtered": 366,
      "passed": true
    },
    {
      "name": "image_2",
      "max_absolute_error": 0.0023943185806274414,
      "mean_absolute_error": 0.0006085619097575545,
      "max_relative_error_pct": 6.415911018848419,
      "mean_relative_error_pct": 0.4154634661972523,
      "cosine_similarity": 0.9999980926513672,
      "max_ref_value": 2.173166513442993,
      "num_elements": 384,
      "num_filtered": 364,
      "passed": true
    },
    {
      "name": "image_3",
      "max_absolute_error": 0.0022094547748565674,
      "mean_absolute_error": 0.0006526241195388138,
      "max_relative_error_pct": 7.680605351924896,
      "mean_relative_error_pct": 0.44714021496474743,
      "cosine_similarity": 0.9999977946281433,
      "max_ref_value": 2.136721611022949,
      "num_elements": 384,
      "num_filtered": 366,
      "passed": true
    },
    {
      "name": "image_4",
      "max_absolute_error": 0.0022072792053222656,
      "mean_absolute_error": 0.0005902328412048519,
      "max_relative_error_pct": 3.040158376097679,
      "mean_relative_error_pct": 0.36829456221312284,
      "cosine_similarity": 0.9999982714653015,
      "max_ref_value": 2.098646402359009,
      "num_elements": 384,
      "num_filtered": 368,
      "passed": true
    }
  ],
  "aggregate_metrics": {
    "name": "aggregate",
    "max_absolute_error": 0.002467215061187744,
    "mean_absolute_error": 0.000613088661339134,
    "max_relative_error_pct": 7.680605351924896,
    "mean_relative_error_pct": 0.41037844493985176,
    "cosine_similarity": 0.999998152256012,
    "max_ref_value": 2.189882516860962,
    "num_elements": 1920,
    "num_filtered": 1831,
    "passed": true
  },
  "all_passed": true
}

logs/performance_eval.log

  • 文件大小:2137 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
{
  "model": "vit_small_patch16_dinov3.lvd1689m",
  "device": "npu",
  "image_size": 256,
  "dtype": "float32",
  "warmup": 5,
  "num_runs": 20,
  "results": [
    {
      "batch_size": 1,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.871,
      "std_latency_ms": 0.324,
      "min_latency_ms": 7.592,
      "max_latency_ms": 8.384,
      "p50_latency_ms": 7.668,
      "p95_latency_ms": 8.38,
      "throughput_images_per_sec": 127.05,
      "npu_memory": {
        "allocated_mb": 83.5,
        "reserved_mb": 140.0
      }
    },
    {
      "batch_size": 2,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.628,
      "std_latency_ms": 0.033,
      "min_latency_ms": 7.577,
      "max_latency_ms": 7.706,
      "p50_latency_ms": 7.632,
      "p95_latency_ms": 7.672,
      "throughput_images_per_sec": 262.18,
      "npu_memory": {
        "allocated_mb": 84.2,
        "reserved_mb": 184.0
      }
    },
    {
      "batch_size": 4,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.606,
      "std_latency_ms": 0.038,
      "min_latency_ms": 7.551,
      "max_latency_ms": 7.675,
      "p50_latency_ms": 7.602,
      "p95_latency_ms": 7.665,
      "throughput_images_per_sec": 525.88,
      "npu_memory": {
        "allocated_mb": 85.7,
        "reserved_mb": 232.0
      }
    },
    {
      "batch_size": 8,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.557,
      "std_latency_ms": 0.067,
      "min_latency_ms": 7.446,
      "max_latency_ms": 7.631,
      "p50_latency_ms": 7.591,
      "p95_latency_ms": 7.62,
      "throughput_images_per_sec": 1058.67,
      "npu_memory": {
        "allocated_mb": 88.7,
        "reserved_mb": 290.0
      }
    }
  ],
  "best_throughput": {
    "batch_size": 8,
    "images_per_sec": 1058.67,
    "latency_ms": 7.557
  }
}

results/performance_eval.json

  • 文件大小:2137 bytes
  • 以下内容为 README 直接文本转写,不是外部路径引用。
{
  "model": "vit_small_patch16_dinov3.lvd1689m",
  "device": "npu",
  "image_size": 256,
  "dtype": "float32",
  "warmup": 5,
  "num_runs": 20,
  "results": [
    {
      "batch_size": 1,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.871,
      "std_latency_ms": 0.324,
      "min_latency_ms": 7.592,
      "max_latency_ms": 8.384,
      "p50_latency_ms": 7.668,
      "p95_latency_ms": 8.38,
      "throughput_images_per_sec": 127.05,
      "npu_memory": {
        "allocated_mb": 83.5,
        "reserved_mb": 140.0
      }
    },
    {
      "batch_size": 2,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.628,
      "std_latency_ms": 0.033,
      "min_latency_ms": 7.577,
      "max_latency_ms": 7.706,
      "p50_latency_ms": 7.632,
      "p95_latency_ms": 7.672,
      "throughput_images_per_sec": 262.18,
      "npu_memory": {
        "allocated_mb": 84.2,
        "reserved_mb": 184.0
      }
    },
    {
      "batch_size": 4,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.606,
      "std_latency_ms": 0.038,
      "min_latency_ms": 7.551,
      "max_latency_ms": 7.675,
      "p50_latency_ms": 7.602,
      "p95_latency_ms": 7.665,
      "throughput_images_per_sec": 525.88,
      "npu_memory": {
        "allocated_mb": 85.7,
        "reserved_mb": 232.0
      }
    },
    {
      "batch_size": 8,
      "image_size": 256,
      "dtype": "float32",
      "warmup": 5,
      "num_runs": 20,
      "avg_latency_ms": 7.557,
      "std_latency_ms": 0.067,
      "min_latency_ms": 7.446,
      "max_latency_ms": 7.631,
      "p50_latency_ms": 7.591,
      "p95_latency_ms": 7.62,
      "throughput_images_per_sec": 1058.67,
      "npu_memory": {
        "allocated_mb": 88.7,
        "reserved_mb": 290.0
      }
    }
  ],
  "best_throughput": {
    "batch_size": 8,
    "images_per_sec": 1058.67,
    "latency_ms": 7.557
  }
}

8. 许可证与声明

  • 适配代码许可证以本仓库 license 元数据或 LICENSE 文件为准。
  • 原始模型权重许可证以模型发布方为准。
  • 本仓库不应提交私钥、token、API key、缓存目录或大体积权重文件。
  • 文档中的运行结果来自仓库现有日志和 JSON 结果文件;未验证的数值不会在 README 中虚构。