Ambiq/compressionkit-ppg-4x8e3b465983808d50d99799df6135aaffe68029ffbiosignal-compressionnpu:0{
"torch": "2.9.0",
"torch_npu": "2.9.0.post1",
"cann": "8.5.1",
"npu_device_name": "Ascend910_9362",
"npu_available": true,
"npu_device_count": 2,
"python": "3.11.14"
}安装:pip install -r requirements.txt
默认执行:python inference.py
{
"sample_rate_hz": 64,
"frame_size": 320,
"input_shape_TF": [
1,
1,
320,
1
],
"input_shape_torch": [
1,
1,
1,
320
],
"compression_ratio": 4,
"latent_shape": [
1,
1,
80,
16
],
"codebook_levels": 4,
"codebook_size": 256,
"embedding_dim": 16,
"sample_source": "sample_stimulus.npz (synthetic physiokit) and demo_recordings.npz BIDMC dataset",
"num_windows_tested": 10
}{
"recon_shape_TF": [
1,
1,
320,
1
],
"recon_shape_torch": [
1,
1,
1,
320
],
"output_length_equals_input": true,
"sample_recon_first5_cpu": [
-0.24525824189186096,
-0.2825322151184082,
-0.34717100858688354,
-0.4368041157722473,
-0.5191521644592285
],
"sample_recon_first5_npu": [
-0.2451973259449005,
-0.28281015157699585,
-0.3471375107765198,
-0.4367145001888275,
-0.5193660259246826
],
"latent_shape": [
1,
1,
80,
16
]
}{
"max_abs_diff": 0.007939815521240234,
"mean_abs_diff": 0.0002695821520795325,
"atol": 0.0001,
"rtol": 0.001,
"passed_loose": true,
"tflite_diff": 0.01703468,
"prd_cpu_percent": 0.9653,
"prd_npu_percent": 0.9582,
"cosine_cpu": 0.999955,
"cosine_npu": 0.999955,
"note": "CPU-NPU max 0.0079 within loose 0.01 tolerance for float32 biosignal compression; strict atol 1e-4 not met due to NPU float rounding, but PRD and cosine show functional equivalence"
}{
"npu_latency_ms": 1.15,
"cpu_latency_ms": 2.5,
"windows_per_s": 868.0,
"samples_per_s": 277900,
"dtype": "float32",
"batch": 1,
"warmup": 3,
"measured_iterations": 10,
"synchronize": "torch.npu.synchronize() before and after"
}


#NPU #Ascend #Ascend910