w
gcw_uQ09W7jl/compressionkit-ppg-2x
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Ambiq/compressionkit-ppg-2x on Ascend NPU

模型与任务

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

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "npu_available": true,
  "npu_device_name": "Ascend910_9362",
  "model_dir": "./task_68b7a831_cache",
  "python": "3.11.14"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "modality": "ppg",
  "sample_rate_hz": 64,
  "frame_size": 320,
  "compression_ratio": 2,
  "signal_shape": [
    10,
    1920
  ],
  "frame_shape": [
    320
  ],
  "normalization": "per_frame_layer_norm eps 0.001",
  "codebook": "4 levels K=256 D=16",
  "signal_source": "demo_recordings.npz BIDMC PPG v1.0.0 ODC-By-1.0",
  "first_frame_sha256": "a6e0987ed721f61e"
}

真实推理结果

{
  "reconstruction_shape": [
    320
  ],
  "reconstruction_dtype": "float32",
  "reconstruction_range": [
    0.24378487467765808,
    0.7511654496192932
  ],
  "input_range": [
    0.24503304064273834,
    0.7596721053123474
  ],
  "output_device": "npu:0",
  "latent_shape": [
    1,
    16,
    1,
    160
  ],
  "indices_shape": [
    160,
    4
  ],
  "prd_faithful_cpu": 1.7127282917499542,
  "prd_faithful_npu": 1.4419794082641602,
  "psnr_cpu_vs_npu": 51.68620878484234
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.016350597143173218,
  "mean_abs_diff": 0.00018531238310970366,
  "mse_cpu_vs_npu": 1.7963238860829733e-06,
  "psnr_cpu_vs_npu_db": 51.68620878484234,
  "cosine_cpu_vs_npu": 0.9999964237213135,
  "prd_cpu_percent": 1.7127282917499542,
  "prd_npu_percent": 1.4419794082641602,
  "rmse_cpu": 0.0028207707218825817,
  "rmse_npu": 0.002374861855059862,
  "compression_ratio": 2,
  "atol": 0.05,
  "rtol": 0.001,
  "passed": true
}

性能

{
  "cpu_time_seconds": 0.05060696601867676,
  "npu_time_seconds": 0.2297217845916748,
  "total_frames": 30,
  "cpu_samples_per_sec": 189697.20485628542,
  "npu_samples_per_sec": 41789.6805784605,
  "cpu_windows_per_sec": 592.803765175892,
  "npu_windows_per_sec": 130.59275180768907,
  "window_length": 320,
  "dtype": "float32",
  "device": "npu:0",
  "first_inference_npu_ms": 7.657392819722494,
  "peak_memory": "single card Ascend910 achievable"
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

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

标签

#NPU #Ascend #Ascend910