Marimba audio encoder for ONNX Runtime
ONNX exports of the frozen audio encoder that Marimba reads for its window questions (turn end, voice activity, same speaker, speaker change, speaker count), in 32-bit float, 16-bit float and several 8-bit variants made with ONNX Runtime.
The files hold only the audio encoder, which is the audio tower of Qwen/Qwen3-ASR-0.6B. The decision heads and readouts stay in charcot-ai/marimba. The text decoder is not here, so language and term questions are not covered.
Every variant that was built is published, with its measured scores. Read the evaluation table before picking one: most 8-bit folders change turn-end scores noticeably.
Files
Each folder is one variant and is self-contained:
| File | Input | Output |
|---|---|---|
tower_l12.onnx |
mel, float32 [B, 128, 800] |
layer9, layer12, float32 [B, 104, 896] |
tower_l13_18.onnx |
layer12, float32 [B, 104, 896] |
layer18, float32 [B, 104, 896] |
mel_filters.npy |
the 128-band mel filter bank used to build mel |
|
quantization.json |
how the folder was made (absent in fp32) |
The batch size B is dynamic. A window is eight seconds of 16 kHz mono audio; the log-mel spectrogram is computed outside the graphs (see the example). Voice activity reads layer 9, the speaker questions read layer 12 and turn end reads layer 18, so a call that does not ask for turn end runs only tower_l12.onnx.
Evaluation results
Scores of the Marimba heads on the states each folder produces, on 1,170 public eight-second windows (see Data). Binary questions report AUROC, speaker count reports accuracy. The first row is the PyTorch float32 encoder. "Changed decisions" counts the windows, summed over the six decisions, whose thresholded decision differs from that row; "largest probability change" is the maximum over the binary questions.
| Folder | Scheme | Size | Turn end | Voice activity (last 1 s) | Voice activity (8 s) | Same speaker | Speaker change | Speaker count | Changed decisions | Largest probability change |
|---|---|---|---|---|---|---|---|---|---|---|
| PyTorch fp32 reference | 32-bit float, one window per call | - | 0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | - | - |
fp32 |
32-bit float | 739 MB | 0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | 0 | 0.000 |
fp16 |
16-bit float | 370 MB | 0.9312 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | 2 | 0.034 |
int8_dynamic |
8-bit dynamic: MatMul weights unsigned per-tensor, activations quantized at run time | 198 MB | 0.9290 | 0.9968 | 0.9999 | 0.9916 | 0.9534 | 0.7874 | 179 | 0.437 |
int8_dynamic_pc |
8-bit dynamic: MatMul weights signed per-channel, 7-bit range | 199 MB | 0.9364 | 0.9969 | 0.9999 | 0.9920 | 0.9545 | 0.7828 | 107 | 0.423 |
int8_minmax |
8-bit static QDQ, MinMax calibration | 187 MB | 0.9282 | 0.9968 | 0.9999 | 0.9928 | 0.9555 | 0.7920 | 308 | 0.823 |
int8_entropy |
8-bit static QDQ, entropy calibration | 187 MB | 0.9251 | 0.9962 | 0.9999 | 0.9931 | 0.9537 | 0.7954 | 275 | 0.751 |
int8_percentile |
8-bit static QDQ, percentile (99.999) calibration | 187 MB | 0.9186 | 0.9970 | 0.9999 | 0.9922 | 0.9544 | 0.7874 | 185 | 0.616 |
int8_minmax_u8 |
8-bit static QDQ, MinMax, unsigned activations, 7-bit weights | 187 MB | 0.9153 | 0.9960 | 0.9999 | 0.9926 | 0.9533 | 0.7954 | 365 | 0.801 |
int8_minmax_lin |
8-bit static QDQ, MinMax, attention products in float | 186 MB | 0.9192 | 0.9969 | 0.9999 | 0.9927 | 0.9528 | 0.7931 | 298 | 0.775 |
int8_minmax_lin_fout |
as int8_minmax_lin, MatMul outputs in float |
186 MB | 0.9293 | 0.9968 | 0.9999 | 0.9931 | 0.9540 | 0.7943 | 208 | 0.577 |
int8_minmax_x20 |
as int8_minmax_lin, 9 more MatMul nodes in float |
244 MB | 0.9253 | 0.9969 | 0.9999 | 0.9931 | 0.9530 | 0.7908 | 203 | 0.506 |
int8_minmax_x25 |
as int8_minmax_lin, 20 more MatMul nodes in float |
300 MB | 0.9248 | 0.9967 | 0.9999 | 0.9918 | 0.9547 | 0.7931 | 171 | 0.535 |
int8_minmax_x30 |
as int8_minmax_lin, 75 more MatMul nodes and the 3 convolutions in float |
657 MB | 0.9312 | 0.9969 | 0.9999 | 0.9927 | 0.9553 | 0.7897 | 10 | 0.078 |
fp32 and the 8-bit folders were scored with the CPU provider, fp16 with the CUDA provider. With the TensorRT provider building a 16-bit float engine from fp32, the scores in the same column order are 0.9308, 0.9969, 0.9999, 0.9927, 0.9558 and 0.7862, with 3 changed decisions.
The encoder has 109 MatMul nodes with weights, 36 attention products (MatMul of two activations) and 3 convolutions. In int8_minmax_x20, _x25 and _x30, a node stays in float when the quantize/dequantize pair on its output or on its activation input has a signal-to-quantization-noise ratio under 20, 25 or 30 dB, measured on 16 calibration windows of int8_minmax with ONNX Runtime's QDQ debugging tools. The node names are in each quantization.json.
Latency
Median time of one call that computes the log-mel spectrogram and runs the encoder, in milliseconds. "Layers 1-12" is the call for voice activity and speaker questions, "layers 1-18" adds turn end. The PyTorch rows run the marimba-audio batched encoder on the same machine; with a batch of one, that path always runs all 18 layers.
NVIDIA L4
One NVIDIA L4 (23 GB), host CPU AMD EPYC 7542. TensorRT engines were built for batch sizes 1 to 32 (optimized for 16). The first load builds the engines; later loads read the engine cache.
| Variant | Layers 1-12, batch 1 | Layers 1-12, batch 16 | Layers 1-18, batch 1 | Layers 1-18, batch 16 | Windows/s (1-12, batch 16) | Load | VRAM, batch 16 |
|---|---|---|---|---|---|---|---|
| PyTorch bf16 (baseline) | 11.1 | 34.3 | 11.5 | 40.0 | 464.1 | 7.7 s | 2.8 GB |
| PyTorch fp32 | 14.1 | 102.5 | 14.4 | 130.8 | 156.2 | 8.1 s | 6.1 GB |
fp32, CUDA provider |
6.4 | 69.7 | 8.0 | 80.0 | 228.7 | 1.5 s | 7.1 GB |
fp16, CUDA provider |
4.1 | 40.2 | 5.2 | 46.6 | 392.2 | 1.0 s | 2.7 GB |
fp32, TensorRT provider, fp16 engine |
4.4 | 27.3 | 6.0 | 32.5 | 583.9 | 5.7 s (160 s first build) | 2.4 GB |
fp16, TensorRT provider, fp16 engine |
4.5 | 28.9 | 6.1 | 32.8 | 552.9 | 4.0 s (161 s first build) | 2.4 GB |
fp32, TensorRT provider, fp32 engine |
5.9 | 53.4 | 7.7 | 62.8 | 299.2 | 5.6 s (70 s first build) | 4.3 GB |
CPU, 4 threads
AMD EPYC 7702 (Zen 2, AVX2, no AVX-512, no VNNI, no AMX), process pinned to 4 logical CPUs on 2 physical cores, 4 intra-op threads. The 8-bit folders were measured three at a time on separate cores of the same host; the second fp32 row was measured under that same condition. int8_minmax_x30 was measured alone, like the first fp32 row.
| Variant | Layers 1-12, batch 1 | Layers 1-12, batch 16 | Layers 1-18, batch 1 | Layers 1-18, batch 16 | Windows/s (1-12, batch 16) | Load | Peak RSS |
|---|---|---|---|---|---|---|---|
| PyTorch fp32 (baseline) | 577.9 | 7609.6 | 578.4 | 8959.6 | 2.1 | 7.2 s | 6.4 GB |
fp32 |
407.6 | 5874.8 | 561.9 | 6721.5 | 2.7 | 1.5 s | 5.1 GB |
fp32, measured with the 8-bit folders |
398.0 | 6420.3 | 551.0 | 7400.6 | 2.5 | 1.5 s | 5.2 GB |
int8_dynamic |
381.5 | 5800.0 | 530.0 | 6893.7 | 2.8 | 0.4 s | 4.6 GB |
int8_dynamic_pc |
405.3 | 5817.2 | 519.5 | 6927.5 | 2.7 | 0.5 s | 4.6 GB |
int8_minmax |
599.9 | 7031.1 | 794.5 | 8367.6 | 2.3 | 0.5 s | 6.6 GB |
int8_entropy |
636.6 | 6999.6 | 785.8 | 8433.1 | 2.3 | 0.5 s | 6.6 GB |
int8_percentile |
559.0 | 7192.4 | 776.0 | 9014.4 | 2.2 | 0.5 s | 6.6 GB |
int8_minmax_u8 |
426.7 | 6052.8 | 556.0 | 7616.3 | 2.7 | 0.5 s | 6.4 GB |
int8_minmax_lin |
621.9 | 6999.4 | 753.3 | 8096.3 | 2.3 | 0.4 s | 6.6 GB |
int8_minmax_lin_fout |
607.8 | 6836.2 | 788.9 | 8067.0 | 2.3 | 0.4 s | 6.6 GB |
int8_minmax_x20 |
622.9 | 6962.0 | 753.5 | 8132.8 | 2.3 | 0.5 s | 6.7 GB |
int8_minmax_x25 |
556.4 | 7034.3 | 723.3 | 7672.6 | 2.3 | 0.7 s | 6.7 GB |
int8_minmax_x30 |
463.6 | 5683.1 | 609.7 | 6756.2 | 2.8 | 1.4 s | 5.2 GB |
int8_dynamic for layers 1-12, fp32 for 1-18 |
387.3 | 5781.1 | 982.7 | 13496.5 | 2.8 | 1.8 s | 8.7 GB |
CPU, 15 threads
Same host, 15 intra-op threads, one process at a time, not pinned. The PyTorch and fp32 rows were measured five hours before the 8-bit rows; the host is shared with other tenants.
| Variant | Layers 1-12, batch 1 | Layers 1-12, batch 16 | Layers 1-18, batch 1 | Layers 1-18, batch 16 | Windows/s (1-12, batch 16) | Load | Peak RSS |
|---|---|---|---|---|---|---|---|
| PyTorch fp32 (baseline) | 166.7 | 1861.6 | 168.6 | 2132.0 | 8.5 | 6.6 s | 6.4 GB |
fp32 |
108.9 | 1190.7 | 220.9 | 1612.6 | 13.6 | 1.5 s | 5.1 GB |
int8_dynamic |
87.1 | 962.9 | 170.9 | 1214.6 | 16.6 | 0.4 s | 4.6 GB |
int8_minmax_u8 |
111.2 | 1326.2 | 199.3 | 1674.6 | 12.1 | 0.4 s | 6.4 GB |
int8_minmax |
461.8 | 2462.4 | 689.2 | 2948.2 | 6.5 | 0.4 s | 6.6 GB |
int8_minmax_x30 |
317.5 | 1358.7 | 449.9 | 1664.0 | 11.8 | 1.4 s | 5.1 GB |
On this AVX2-only CPU with 4 threads, no 8-bit folder is faster than fp32. With 15 threads, int8_dynamic is about 20% faster than fp32 and the static folders are slower. CPUs with VNNI were not measured.
Data
Evaluation. 1,170 eight-second windows from public test data, none of it used for calibration:
| Source | Split | Windows | Revision |
|---|---|---|---|
| pipecat-ai/smart-turn-data-v3.2-test | test | 300 | dfc17924 |
| diarizers-community/voxconverse | test | 513 | 3acfa1b4 |
diarizers-community/ami (ihm) |
test | 107 | 8cdaae2e |
| ashraq/esc50 | non-human classes | 150 | e3e2a63f |
google/fleurs (pt_br) |
validation | 100 | 168de341 |
Calibration. The static 8-bit folders were calibrated on 192 other public eight-second windows: 74 from Smart Turn v3.2 train (pipecat-ai/smart-turn-data-v3.2-train, f8c95d28), 69 from VoxConverse dev, 16 from AMI ihm train, 13 from the human classes of ESC-50, and 10 each from FLEURS pt_br train and en_us train, at the revisions above. Windows whose audio also occurs in the evaluation set were removed. The dynamic 8-bit folders and fp16 need no calibration data.
No audio is distributed here.
How to use
python -m pip install onnxruntime==1.32.0 numpy torch huggingface_hub
Use onnxruntime-gpu==1.32.0 for the CUDA and TensorRT providers (CUDA 13 and cuDNN 9; TensorRT 10.16 for the TensorRT provider).
import numpy as np
import onnxruntime as ort
import torch
from huggingface_hub import snapshot_download
folder = "fp16" # any folder of this repository
root = snapshot_download("charcot-ai/marimba-quant-onnxruntime", allow_patterns=[f"{folder}/*"])
filters = torch.from_numpy(np.load(f"{root}/{folder}/mel_filters.npy")).float()
def log_mel(windows: np.ndarray) -> np.ndarray:
"""[B, 128000] float32 audio (8 s, 16 kHz, mono) -> [B, 128, 800] log-mel."""
stft = torch.stft(
torch.from_numpy(windows), 400, 160, window=torch.hann_window(400), return_complex=True
)
power = stft[..., :-1].abs() ** 2
spectrum = torch.clamp(filters.T @ power, min=1e-10).log10()
spectrum = torch.maximum(spectrum, spectrum.amax(dim=(1, 2), keepdim=True) - 8.0)
return ((spectrum + 4.0) / 4.0).numpy()
providers = ["CPUExecutionProvider"] # or ["CUDAExecutionProvider"] for fp32 and fp16
head = ort.InferenceSession(f"{root}/{folder}/tower_l12.onnx", providers=providers)
tail = ort.InferenceSession(f"{root}/{folder}/tower_l13_18.onnx", providers=providers)
windows = np.zeros((2, 128000), dtype=np.float32) # replace with real audio
layer9, layer12 = head.run(None, {"mel": log_mel(windows)}) # each [B, 104, 896] float32
(layer18,) = tail.run(None, {"layer12": layer12}) # only needed for turn_end
layer9, layer12 and layer18 are the hidden states after encoder layers 9, 12 and 18. The marimba-audio package rounds these states to 16-bit float before its readouts. It does not load these graphs by itself, so connecting them to the heads is left to the caller.
How the files were made
- Export: the batched encoder path of
marimba-audioat commitf58980a, with PyTorch 2.8.0 (torch.onnx.export, TorchScript exporter, opset 17). Against that path the float32 graphs differ by at most 2.3e-4 of the largest activation. fp16: weights and intermediate values converted to 16-bit float; inputs and outputs stay float32.- Dynamic 8-bit:
quantize_dynamiconMatMul. The three convolutions stay in float. - Static 8-bit:
quantize_staticin QDQ format onMatMulandConv, per-channel weights, after ONNX Runtime's quantization pre-processing (symbolic shape inference and graph optimization). - Tools: ONNX Runtime 1.32.0, ONNX 1.23.2, TensorRT 10.16.1 for the TensorRT rows.
Limitations
- Windows are exactly eight seconds (800 mel frames). Shorter audio must be left-padded by the caller.
- Scores come from one evaluation set of 1,170 windows; other domains may move differently, turn end in particular.
- CPU latency was measured on one AVX2-only server CPU and GPU latency on one NVIDIA L4. Other hardware will differ.
- TensorRT engines are specific to the GPU model and the TensorRT version, and are not distributed here.
- Not for diagnosis, identity verification, surveillance or safety-critical automation.
License and credits
These files are derived from the Qwen3-ASR-0.6B audio tower and are released under Apache-2.0.
| Source | License | Use |
|---|---|---|
| Qwen/Qwen3-ASR-0.6B | Apache-2.0 | Audio tower weights, revision 5eb144179a02acc5e5ba31e748d22b0cf3e303b0 |
| charcot-ai/marimba | Apache-2.0 | Heads and readouts used for the evaluation |
| ONNX Runtime 1.32.0 | MIT | Quantization tools and inference |