Frame-level speaker segmentation model (PyanNet: SincNet frontend + 4-layer
BiLSTM + linear classifier, powerset output) adapted to run on Huawei Ascend
NPU with torch_npu. The model consumes 10 s / 16 kHz mono waveform chunks and
emits a frame probability matrix [B, 589, 7]: channel 0 is non-speech,
channels 1–3 are single speakers speaker#1..3, channels 4–6 are the three
pairwise-overlap classes. It outputs time-framed speaker activity
probabilities — it is not an ASR/transcription model and does not produce
text.
ivrit-ai/pyannote-segmentation-3.0
at revision main (config.yaml + pytorch_model.bin, sha256-verified structure).jfk.flac from the OpenAI Whisper test assets — 11 s of real
speech containing both speech regions and pauses.All numbers below come from real end-to-end runs on this device:
| Item | Value |
|---|---|
| Device | Ascend910 (Ascend910_9362), npu:0 |
| Stack | torch 2.9.0 + torch_npu 2.9.0.post1, CANN 8.5.1 |
| Model parameters | 1,473,265 |
| Model/input/output tensors | all verified on npu:0 |
| Probability matrix shape | [2, 589, 7] (11 s audio → two 10 s chunks) |
| CPU–NPU max abs diff | 0.0242 (mean 2.02e-4) |
| Flattened cosine similarity | 0.999995 |
| Speech-frame agreement (0.5 threshold) | 100% (ratio 37.69% both devices) |
| First-run latency (graph compile) | 3700.8 ms |
| Stable latency (mean of 7 runs) | 179.2 ms per 11 s file (p50 197.9 ms) |
| RTF (real-time factor) | 0.0163 |
| Throughput | ≈ 7013 frames/s |
| Peak host memory | ≈ 2.33 GB |
| NPU HBM allocated | 32.7 MB |
Consistency was measured with identical weights, identical resampled input, float32 dtype and identical chunking on both backends; thresholds were fixed in advance (max abs diff ≤ 0.05, cosine ≥ 0.999, speech-frame agreement ≥ 99.9%).
Workflow log (model inspection, offline load, CPU baseline, NPU inference):

NPU device verification (npu-smi, torch.npu.is_available(), tensor devices):

CPU–NPU consistency validation and synchronized benchmark:

pip install -r requirements.txt
# download a real speech file (any wav/flac/mp3 readable by soundfile),
# then run CPU baseline + real npu:0 inference:
python3 inference.py \
--model-dir <local pyannote-segmentation-3.0 dir> \
--audio <speech.wav> \
--out-dir output \
--stable-runs 6The script is fully offline: it loads config.yaml + pytorch_model.bin from
the local --model-dir (no hub access), restores minimal torchaudio 2.9
compatibility shims before importing pyannote.audio, resamples input to 16 kHz
mono, splits into zero-padded 10 s windows, runs the CPU baseline and the NPU
pass with torch.npu.synchronize() around every timed region, and writes
cpu_probs.npy, npu_probs.npy, npu_timing.jsonl and summary.json.
Weights are not included in this repository.