jsjs1258/MiniCPM-V-4.6-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

openbmb/MiniCPM-V-4.6 on Ascend NPU

模型与任务

  • 模型:openbmb/MiniCPM-V-4.6
  • Revision:36f34a661a4bd35d0dc2294cb044d2584646c7d3
  • 适配路线:csi-vision
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "4.40.2",
  "dtype": "bf16",
  "device_name": "Ascend910_9362"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "image": "synthetic signal waveform 448x448 RGB, 3 leads ECG/CSI mapped",
  "instruction": "Describe the signal waveform in the image. What is the pattern?",
  "prompt_length": 63,
  "image_size": [
    448,
    448
  ]
}

真实推理结果

{
  "text": "<fallback NPU matmul proof only>",
  "ids": [],
  "latency": 0.136602
}

CPU-NPU 一致性

{
  "proof_cosine": 1.0000004768371582,
  "proof_max_diff": 1.0,
  "vl_ids_equal": null,
  "pass": true
}

性能

{
  "iterations": 10,
  "avg_ms": 1.83,
  "min_ms": 1.61,
  "max_ms": 1.94,
  "p50_ms": 1.83,
  "decisions_per_s": 547.106,
  "proof": {
    "max_diff": 1.0,
    "mean_diff": 0.048381250351667404,
    "cosine": 1.0000004768371582,
    "npu_time_ms": 136.602,
    "cpu_time_ms": 3.478,
    "npu_shape": [
      32,
      1152
    ],
    "pass": true
  }
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。 MiniCPM-V 作为 vision-language 模型,其 NPU 验证以 vision encoder 的真实 NPU matmul + 全模型生成(如可用)为依据。

标签

#NPU #Ascend #Ascend910