m
mengsihan/compressionkit-ecg-2x
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Ambiq/compressionkit-ecg-2x on Ascend NPU

模型与任务

  • 模型:Ambiq/compressionkit-ecg-2x
  • Revision:4d07900f24978ee3830ee2a6a4e2becaa0880645
  • 适配路线:biosignal-compression
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "python": "3.11.14",
  "cann": "8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "source": "demo_recordings.npz MIT-BIH",
  "sample_rate_hz": 256,
  "frame_size": 512,
  "channels": 1,
  "window": 1,
  "normalization": "per_frame_layer_norm",
  "epsilon": 0.001,
  "shape": [
    1,
    512
  ],
  "dtype": "float32",
  "sha256_first16": "b2745021e277617e"
}

真实推理结果

{
  "shape": [
    1,
    512
  ],
  "dtype": "float32",
  "prd_cpu": 0.7455735467374325,
  "prd_npu": 0.7490593940019608,
  "snr_cpu": 42.55019187927246,
  "snr_npu": 42.50967502593994,
  "sample_cpu": [
    -0.8860774040222168,
    -0.9339581727981567,
    -0.9293083548545837,
    -0.9457184672355652,
    -0.9515751004219055
  ],
  "sample_npu": [
    -0.8860715627670288,
    -0.9338582158088684,
    -0.9294149875640869,
    -0.9457626342773438,
    -0.9516324400901794
  ]
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.004001498222351074,
  "mean_abs_diff": 0.00012938445433974266,
  "latent_max_diff": 0.0016095638275146484,
  "atol": 0.005,
  "rtol": 0.001,
  "passed": true
}

性能

{
  "avg_latency_ms": 1.2396574020385742,
  "windows_per_sec": 806.6744879315319,
  "samples_per_sec": 413017.3378209443,
  "dtype": "float32",
  "device": "npu:0",
  "peak_memory": "N/A",
  "window_length": 512
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。

标签

#NPU #Ascend #Ascend910