凤
weixin_44093752/pyannote-segmentation-3-0-ascend-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

pyannote/segmentation-3.0 Ascend NPU adaptation

This repository adapts the official pyannote/segmentation-3.0 checkpoint for a real Ascend NPU smoke run. The official Hugging Face page and Google search were rechecked on 2026-08-22. The model is MIT licensed, accepts 10 seconds of mono 16 kHz audio, and produces a 7-class segmentation matrix.

Adaptation

  • Keeps the official pyannote.audio 3.0.0 PyanNet architecture and checkpoint state dictionary.
  • Adds a small compatibility shim for the container's newer torchaudio API.
  • Supports cpu, npu, and auto device selection.
  • Does not include the gated checkpoint; download it from the official model page into /tmp.

Real Ascend910 validation

The official checkpoint loaded on Ascend910 npu:0 after loading the CANN environment:

MetricCPUNPU (Ascend910 npu:0)
Parameters1,473,2651,473,265
Input shape[1,1,160000][1,1,160000]
Output shape[1,589,7][1,589,7]
Output dtypefloat32float32
Forward0.298 s3.725 s
Finite outputtruetrue

CPU/NPU smoke comparison cosine is 0.9999998212, max absolute difference is 0.0020027161, and mean absolute difference is 0.0009162365. This is an NPU execution smoke result only, as requested for the remaining competition time. It is not a complete task-level precision gate.

Run

Source the CANN environment before using --device npu:

source /usr/local/Ascend/ascend-toolkit/set_env.sh
python inference.py --model-path /tmp/model-agent/pyannote19/pytorch_model.bin --device npu

Official model: https://huggingface.co/pyannote/segmentation-3.0

Official training/runtime version: pyannote.audio==3.0.0.

Agent workflow

NPU device call

Model result