HiSilicon (Hi3519DV500)
HiSilicon Hi3519DV500 with SVP NNIE NPU
The Hi3519DV500 SoC features a dedicated NPU (Neural Processing Unit) based on Huawei's SVP NNIE architecture. The soundSDK leverages this NPU for low-power, real-time sound inference.
Key Characteristics
Important: INT8 Only
HiSilicon's NPU only supports INT8 quantized inference. The ATC compiler converts floating-point ONNX models to INT8 via calibration. Use compile_mode=0 (A8W8 — both activations and weights quantized to 8-bit).
Model Preparation Pipeline
# Step 1: Generate calibration data (on Windows)
cd c/py
python generate_calibration.py # produces 500 .bin files + calibration_data.bin
# Step 2: Export ONNX model (on Windows)
python export_model_onnx.py \
--model ../../path/to/trained/model.h5 \
--output cry_detect.onnx
# Step 3: Convert ONNX → INT8 .om (on Linux with HiSilicon SDK)
atc --model=cry_detect.onnx \
--framework=5 \
--output=cry_detect_int8_v4 \
--soc_version=Hi3519DV500 \
--input_shape="input:1,1,225,225" \
--input_format=NCHW \
--image_list=calibration/calibration_data.bin \
--compile_mode=0Build
cd c/hisi3519
NPU=1 ./build.shOutput: cry_detect (ARM64 executable, linked against libsvp_acl)
Deploy to Target
# Copy to SD card via SCP
scp cry_detect cry_detect_int8_v4.om root@192.168.0.106:/mnt/sdcard/
# Run (NPU mode)
./cry_detect -f test.wav -e svp_acl -w cry_detect_int8_v4.om
# Verify against CPU baseline
./cry_detect -f test.wav -e pure_c -w model_weights.binAccuracy Verification
INT8 quantization typically introduces < 0.02 probability difference vs. float32. Compare outputs to validate:
# NPU inference
./cry_detect -f test.wav -e svp_acl -w cry_detect_int8_v4.om
# CPU inference (reference)
./cry_detect -f test.wav -e pure_c -w model_weights.binKnown Limitations
1. The NPU requires padded input: 225×225 → 225×228 (3 zero-padded columns per row)
2. Output tensor is [1,4] instead of [1,2] due to dequantization parameters
3. The svp_acl engine is built via conditional compilation (NPU=1) — the standard build does not include NPU support