Downloads · 30 days
0
DimQ1/sortformer-4spk-v2-onnx-int8-cpu
sortformer-4spk-v2-onnx-int8-cpu is a audio classification model from DimQ1. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as cc-by-4.0.
INT8 quantized ONNX model of NVIDIA's Sortformer 4spk-v2 speaker diarization. Uses MatMulNBits (ORT ≥ 1.18) for real 8-bit weight compression.
Downloads · 30 days
0
Access
Public
Updated Jul 12, 2026
Repo size
136 MB
Likes
0
Public
Click a slice to open those files.
.data114 MB · 84%
From the Hugging Face model README
INT8 quantized ONNX model of NVIDIA's Sortformer 4spk-v2 speaker diarization. Uses MatMulNBits (ORT ≥ 1.18) for real 8-bit weight compression.
processed_signal — log-mel spectrogram [B, 128, mel_frames]speaker_logits — per-frame sigmoid probabilities [B, diar_frames, 4]Audio (16 kHz mono) → STFT → 128 mel bins
→ ConformerEncoder (17 layers, d=512)
→ SortformerModules (4 speakers)
→ TransformerEncoder (18 layers, d=192)
→ Sigmoid → [B, diar_frames, 4] speaker logits
All 265 constant-weight MatMul nodes replaced with MatMulNBits (INT8, block_size=64). 87 dynamic MatMul nodes (attention scores) remain in FP32.
| Metric | Value |
|---|---|
| RTF | 0.034 (29.4× real-time) |
| DER | 21.64% (LibriCSS test set) |
| Size | 129 MB (3.6× smaller than FP32) |
| cos_sim vs FP32 | 0.989–0.999 |
Benchmarked on 100-file LibriCSS subset (1954.8 s audio). ORT 1.27.1 with ORT_PARALLEL + memory optimizations.
🚀 INT8 is the fastest variant — 29.4× real-time on 12-core CPU (66.6 s for 1954.8 s audio).
| Variant | Size | DER | RTF | Link |
|---|---|---|---|---|
| FP32 | 469 MB | 17.82% | 0.037 | sortformer-4spk-v2-onnx-fp32-cpu |
| INT4 | 135 MB | 19.11% | 0.043 | sortformer-4spk-v2-onnx-int4-cpu |
.data file must be in the same directory as sortformer.onnximport onnxruntime as ort
session = ort.InferenceSession(
"sortformer.onnx",
providers=["CPUExecutionProvider"],
)
speaker_logits = session.run(None, {"processed_signal": mel})[0]
using var session = new InferenceSession("sortformer.onnx");
var inputs = new List<NamedOnnxValue>
{
NamedOnnxValue.CreateFromTensor("processed_signal", melTensor),
};
using var results = session.Run(inputs);
Quantized from FP32 ONNX using MatMulNBitsQuantizer (ORT ≥ 1.18, opset 21):
python scripts/quantize_nbits.py --int8
See nemotron-speech-csharp/DiarizationConverter