Marimba audio encoder in GGUF
GGUF files of the audio encoder that Marimba reads, with the weights stored in ggml block types from F32 down to Q4_0, plus a small ggml runtime that returns the hidden states Marimba's readouts consume.
Each file holds only the audio encoder of Qwen/Qwen3-ASR-0.6B (revision 5eb144179a02acc5e5ba31e748d22b0cf3e303b0): the three-convolution stem, conv_out, the 18 transformer layers and the mel filter bank. The text decoder and the encoder's output projection are not included, because Marimba's window questions read the hidden states after layers 9, 12 and 18. The readouts that turn those states into decisions are not in this repository; they come from charcot-ai/marimba.
Files
Quantization is weight-only and uses no calibration data. The source weights are bfloat16. The 2-D weights of the attention projections, the feed-forward layers and conv_out take the file's type. Convolution kernels stay F16; biases, LayerNorm parameters and the mel filter bank stay F32.
ggml K-quants need rows whose length is a multiple of 256. Only fc2 and conv_out qualify (rows of 3,584 and 7,680). The other linear weights have rows of 896 and fall back to a non-K type, as llama.cpp does: Q4_K to Q5_0, Q5_K to Q5_1, Q6_K to Q8_0. The table shows the resulting mix by parameter count.
| file | types of the linear weights | bytes | MB | bits per encoder parameter |
|---|---|---|---|---|
marimba-encoder-F32.gguf |
F32 (100%) | 738,729,504 | 739 | 32.01 |
marimba-encoder-F16.gguf |
F16 (100%) | 369,847,456 | 370 | 16.02 |
marimba-encoder-BF16.gguf |
BF16 (100%) | 369,847,456 | 370 | 16.02 |
marimba-encoder-Q8_0.gguf |
Q8_0 (100%) | 200,826,016 | 201 | 8.70 |
marimba-encoder-Q6_K.gguf |
Q8_0 (64%), Q6_K (36%) | 185,160,352 | 185 | 8.02 |
marimba-encoder-Q5_K.gguf |
Q5_1 (64%), Q5_K (36%) | 140,442,784 | 140 | 6.08 |
marimba-encoder-Q5_0.gguf |
Q5_0 (100%) | 133,217,440 | 133 | 5.77 |
marimba-encoder-Q4_K.gguf |
Q5_0 (64%), Q4_K (36%) | 125,131,936 | 125 | 5.42 |
marimba-encoder-Q4_0.gguf |
Q4_0 (100%) | 110,681,248 | 111 | 4.80 |
For comparison, the same encoder takes 373 MB as bfloat16 inside the Qwen3-ASR-0.6B checkpoint, and the whole checkpoint is 1.88 GB.
Evaluation
All numbers are on 1,170 public 8-second windows (16 kHz mono) drawn from Smart Turn v3.2 test (pipecat-ai/smart-turn-data-v3.2-test@dfc17924), VoxConverse test (diarizers-community/voxconverse@3acfa1b4), AMI ihm test (diarizers-community/ami@8cdaae2e), ESC-50 without human-sound classes (ashraq/esc50@e3e2a63f) and FLEURS pt_br validation (google/fleurs@168de341). The encoder variant produces the hidden states and the unmodified Marimba readouts (package commit f58980ab80a54943929074aff23159caa026c7cf) produce the decisions.
The reference row is the PyTorch float32 encoder on CPU. "Max probability difference" is the largest absolute change of any output probability against that reference, over all questions. "Changed decisions" counts windows whose decision differs from the reference, summed over the six outputs.
ggml CUDA backend, weights in the file's type
| variant | turn_end AUROC | voice_activity AUROC (1 s tail) | voice_activity AUROC (8 s) | same_speaker AUROC | speaker_change AUROC | speaker_count accuracy | max probability difference | changed decisions |
|---|---|---|---|---|---|---|---|---|
| fp32 reference (PyTorch, CPU) | 0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | - | - |
F32 |
0.9314 | 0.9969 | 0.9999 | 0.9926 | 0.9558 | 0.7862 | 0.058 | 2 |
F16 |
0.9312 | 0.9969 | 0.9999 | 0.9927 | 0.9557 | 0.7862 | 0.070 | 5 |
BF16 |
0.9312 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | 0.055 | 4 |
Q8_0 |
0.9293 | 0.9969 | 0.9999 | 0.9931 | 0.9557 | 0.7897 | 0.102 | 19 |
Q6_K |
0.9283 | 0.9969 | 0.9999 | 0.9926 | 0.9559 | 0.7908 | 0.149 | 25 |
Q5_K |
0.9345 | 0.9969 | 0.9999 | 0.9937 | 0.9560 | 0.7839 | 0.354 | 137 |
Q5_0 |
0.9276 | 0.9969 | 0.9999 | 0.9912 | 0.9554 | 0.7655 | 0.372 | 132 |
Q4_K |
0.9188 | 0.9968 | 0.9999 | 0.9922 | 0.9552 | 0.7724 | 0.459 | 167 |
Q4_0 |
0.9241 | 0.9968 | 0.9999 | 0.9943 | 0.9568 | 0.7644 | 0.810 | 283 |
ggml CPU backend, weights in the file's type
| variant | turn_end AUROC | voice_activity AUROC (1 s tail) | voice_activity AUROC (8 s) | same_speaker AUROC | speaker_change AUROC | speaker_count accuracy | max probability difference | changed decisions |
|---|---|---|---|---|---|---|---|---|
| fp32 reference (PyTorch, CPU) | 0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | - | - |
F32 |
0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | 0.000 | 0 |
F16 |
0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | 0.000 | 0 |
Q8_0 |
0.9305 | 0.9969 | 0.9999 | 0.9924 | 0.9558 | 0.7908 | 0.083 | 24 |
Q5_K |
0.9353 | 0.9968 | 0.9999 | 0.9939 | 0.9560 | 0.7862 | 0.357 | 124 |
Q4_K |
0.9212 | 0.9967 | 0.9999 | 0.9921 | 0.9552 | 0.7736 | 0.452 | 156 |
In these two tables ggml multiplies the weights in their stored type. For quantized types it also converts the activations of each matrix product to 8-bit blocks, so the result reflects both weight and activation rounding.
Weights dequantized at load
Here the file is only a storage format: the weights are expanded to floating point when loaded and every operation runs in floating point, either in ggml (F32) or in the PyTorch encoder of the marimba-audio package (bfloat16).
| variant | turn_end AUROC | voice_activity AUROC (1 s tail) | voice_activity AUROC (8 s) | same_speaker AUROC | speaker_change AUROC | speaker_count accuracy | max probability difference | changed decisions |
|---|---|---|---|---|---|---|---|---|
| fp32 reference (PyTorch, CPU) | 0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | - | - |
F16, dequantized at load, ggml F32 (CPU) |
0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | 0.000 | 0 |
BF16, dequantized at load, ggml F32 (CPU) |
0.9310 | 0.9969 | 0.9999 | 0.9926 | 0.9557 | 0.7862 | 0.000 | 0 |
Q8_0, dequantized at load, ggml F32 (CPU) |
0.9308 | 0.9969 | 0.9999 | 0.9927 | 0.9558 | 0.7897 | 0.094 | 15 |
Q6_K, dequantized at load, ggml F32 (CPU) |
0.9296 | 0.9969 | 0.9999 | 0.9926 | 0.9558 | 0.7897 | 0.095 | 24 |
Q5_K, dequantized at load, ggml F32 (CPU) |
0.9352 | 0.9969 | 0.9999 | 0.9939 | 0.9560 | 0.7851 | 0.344 | 124 |
Q5_0, dequantized at load, ggml F32 (CPU) |
0.9274 | 0.9969 | 0.9999 | 0.9910 | 0.9554 | 0.7632 | 0.394 | 138 |
Q4_K, dequantized at load, ggml F32 (CPU) |
0.9210 | 0.9967 | 0.9999 | 0.9924 | 0.9552 | 0.7736 | 0.459 | 159 |
Q4_0, dequantized at load, ggml F32 (CPU) |
0.9251 | 0.9968 | 0.9999 | 0.9941 | 0.9567 | 0.7713 | 0.809 | 282 |
F16, dequantized at load, ggml F32 (CUDA) |
0.9314 | 0.9969 | 0.9999 | 0.9926 | 0.9558 | 0.7862 | 0.075 | 0 |
Q8_0, dequantized at load, ggml F32 (CUDA) |
0.9309 | 0.9969 | 0.9999 | 0.9927 | 0.9558 | 0.7885 | 0.093 | 14 |
Q5_K, dequantized at load, ggml F32 (CUDA) |
0.9352 | 0.9969 | 0.9999 | 0.9939 | 0.9561 | 0.7862 | 0.344 | 124 |
Q4_K, dequantized at load, ggml F32 (CUDA) |
0.9208 | 0.9967 | 0.9999 | 0.9924 | 0.9552 | 0.7724 | 0.458 | 160 |
Q8_0, dequantized into PyTorch, bfloat16 (CUDA) |
0.9302 | 0.9969 | 0.9999 | 0.9927 | 0.9560 | 0.7897 | 0.112 | 17 |
Q5_K, dequantized into PyTorch, bfloat16 (CUDA) |
0.9350 | 0.9969 | 0.9999 | 0.9939 | 0.9560 | 0.7862 | 0.342 | 129 |
Q4_K, dequantized into PyTorch, bfloat16 (CUDA) |
0.9203 | 0.9967 | 0.9999 | 0.9924 | 0.9552 | 0.7736 | 0.455 | 158 |
Latency
Encoder only, from 16 kHz samples to hidden states, median of repeated calls. "Layers 1-12" stops after layer 12 and "layers 1-18" runs the whole encoder. Each table was measured in one session on one machine, with the PyTorch encoder of the marimba-audio package as the base.
NVIDIA L4 (24 GB), AMD EPYC 9254 host, 4 threads
Every row ran with 4 CPU threads (torch.set_num_threads(4), OMP_NUM_THREADS=4, 4 ggml threads). The container saw 48 logical CPUs with a CPU quota of 5.1 cores.
| runtime and weights | layers 1-12, batch 1 (ms) | layers 1-12, batch 16 (ms) | layers 1-12, batch 16 (windows/s) | layers 1-18, batch 1 (ms) | layers 1-18, batch 16 (ms) | layers 1-18, batch 16 (windows/s) |
|---|---|---|---|---|---|---|
| PyTorch bfloat16 (base) | 7.4 | 34.2 | 467 | 7.6 | 40.0 | 400 |
| PyTorch float32 | 12.5 | 103.7 | 154 | 12.7 | 133.1 | 120 |
ggml CUDA, F32 |
8.4 | 109.9 | 146 | 10.3 | 122.7 | 130 |
ggml CUDA, F16 |
7.7 | 102.2 | 156 | 9.3 | 116.7 | 137 |
ggml CUDA, Q8_0 |
8.1 | 104.4 | 153 | 10.0 | 117.3 | 137 |
ggml CUDA, Q5_K |
8.1 | 105.9 | 152 | 10.0 | 119.8 | 134 |
PyTorch bfloat16, weights from Q8_0 |
7.3 | 34.4 | 464 | 7.4 | 40.0 | 399 |
PyTorch bfloat16, weights from Q5_K |
7.4 | 34.3 | 465 | 6.8 | 40.0 | 400 |
Small batches on the same GPU:
| runtime | batch 1 (ms) | batch 2 (ms) | batch 4 (ms) | batch 8 (ms) | batch 16 (ms) |
|---|---|---|---|---|---|
| PyTorch bfloat16, layers 1-12 | 7.6 | 5.2 | 9.1 | 17.3 | 34.8 |
| PyTorch bfloat16, layers 1-18 | 7.2 | 6.3 | 10.8 | 19.9 | 40.0 |
ggml CUDA, F16, layers 1-12 |
7.7 | 13.4 | 25.1 | 50.4 | 102.3 |
ggml CUDA, F16, layers 1-18 |
9.3 | 15.2 | 28.2 | 56.3 | 115.6 |
One-window calls, 60 per row, 4 threads: PyTorch bf16 p50 7.30 ms, p95 10.52 ms, 26.6 ms of process CPU time per call; ggml F16 p50 7.66 ms, p95 7.82 ms, 7.7 ms of process CPU time per call. With the default PyTorch thread pool (24 threads on this host, whose container is limited to 5.1 CPU cores) the same PyTorch call has p50 8.24 ms, p95 89.6 ms, and 185 ms of process CPU time, so set the thread count to the cores you actually have.
CPU backend on the same host, 4 threads:
| runtime and weights | layers 1-12, batch 1 (ms) | layers 1-12, batch 16 (ms) | layers 1-12, batch 16 (windows/s) | layers 1-18, batch 1 (ms) | layers 1-18, batch 16 (ms) | layers 1-18, batch 16 (windows/s) |
|---|---|---|---|---|---|---|
| PyTorch float32 (base) | 304.5 | 3579.3 | 4.4 | 282.4 | 4542.8 | 3.5 |
ggml CPU, F16 |
540.6 | 7875.9 | 2.0 | 621.2 | 9293.1 | 1.7 |
ggml CPU, Q8_0 |
521.8 | 8040.5 | 2.0 | 624.4 | 8956.8 | 1.8 |
NVIDIA A40 (48 GB), Intel Xeon Gold 6342 host
Batch 16 only: the PyTorch rows on this host ran with the default thread pool, which distorts one-window timings, so those are left out.
| runtime and weights | layers 1-12, batch 16 (ms) | layers 1-12, batch 16 (windows/s) | layers 1-18, batch 16 (ms) | layers 1-18, batch 16 (windows/s) |
|---|---|---|---|---|
| PyTorch bfloat16 (base) | 21.6 | 740 | 25.6 | 626 |
| PyTorch float32 | 58.0 | 276 | 72.5 | 221 |
ggml CUDA, F32 |
72.4 | 221 | 82.8 | 192 |
ggml CUDA, F16 |
70.9 | 225 | 79.9 | 200 |
ggml CUDA, BF16 |
69.1 | 229 | 77.3 | 207 |
ggml CUDA, Q8_0 |
69.6 | 230 | 78.3 | 204 |
ggml CUDA, Q6_K |
71.1 | 223 | 79.0 | 202 |
ggml CUDA, Q5_K |
71.0 | 224 | 80.8 | 197 |
ggml CUDA, Q5_0 |
69.4 | 229 | 79.4 | 201 |
ggml CUDA, Q4_K |
74.3 | 214 | 78.8 | 203 |
ggml CUDA, Q4_0 |
69.0 | 230 | 78.4 | 203 |
PyTorch bfloat16, weights from Q8_0 |
21.4 | 743 | 25.4 | 631 |
PyTorch bfloat16, weights from Q5_K |
21.2 | 753 | 25.6 | 615 |
PyTorch bfloat16, weights from Q4_K |
21.3 | 752 | 25.2 | 635 |
AMD EPYC 9575F, 16 vCPU, 16 threads
| runtime and weights | layers 1-12, batch 1 (ms) | layers 1-12, batch 16 (ms) | layers 1-12, batch 16 (windows/s) | layers 1-18, batch 1 (ms) | layers 1-18, batch 16 (ms) | layers 1-18, batch 16 (windows/s) |
|---|---|---|---|---|---|---|
| PyTorch float32 (base) | 273.9 | 2376.9 | 6.6 | 277.9 | 2700.4 | 5.8 |
ggml CPU, F32 |
310.6 | 4692.1 | 3.4 | 370.5 | 5180.5 | 3.0 |
ggml CPU, F16 |
336.6 | 5338.6 | 3.0 | 373.3 | 5534.0 | 2.9 |
ggml CPU, Q8_0 |
286.9 | 5777.6 | 3.0 | 419.0 | 5624.9 | 2.9 |
ggml CPU, Q5_K |
337.4 | 4908.0 | 3.2 | 379.0 | 5217.4 | 3.0 |
ggml CPU, Q4_K |
308.4 | 5550.3 | 2.9 | 348.5 | 5831.1 | 2.8 |
AMD EPYC 9575F, 16 vCPU, 4 threads
| runtime and weights | layers 1-12, batch 1 (ms) | layers 1-12, batch 16 (ms) | layers 1-12, batch 16 (windows/s) | layers 1-18, batch 1 (ms) | layers 1-18, batch 16 (ms) | layers 1-18, batch 16 (windows/s) |
|---|---|---|---|---|---|---|
| PyTorch float32 (base) | 509.6 | 5232.9 | 3.1 | 494.6 | 6676.9 | 2.4 |
ggml CPU, F32 |
969.4 | 12044.7 | 1.3 | 1152.2 | 14860.4 | 1.1 |
ggml CPU, F16 |
776.7 | 13382.0 | 1.2 | 1198.5 | 14782.2 | 1.0 |
ggml CPU, Q8_0 |
759.5 | 10961.2 | 1.4 | 794.8 | 12179.0 | 1.3 |
ggml CPU, Q5_K |
643.3 | 9868.1 | 1.6 | 891.2 | 10282.8 | 1.5 |
ggml CPU, Q4_K |
519.9 | 8830.3 | 1.8 | 666.6 | 13723.5 | 1.3 |
The EPYC 9575F host was shared with other workloads during the measurement, so its numbers carry more noise than the others.
How to use
The runtime is in runtime/: mqenc.cpp (the encoder graph on ggml), mqenc.py (a ctypes binding), mqquant.cpp (the quantizer that produced these files), convert_encoder.py (safetensors to F32 GGUF) and torch_loader.py (GGUF into the PyTorch encoder). It was built and measured with ggml at commit ef4555b7aede4467a5de803b103615e0a5f30dd8 of ServeurpersoCom/ggml, CMake 4.4 (the build files declare 3.14 as the minimum), Python 3.12, NumPy 2.1, PyTorch 2.8.0 with CUDA 12.8, and marimba-audio 0.1.2.
hf download charcot-ai/marimba-quant-gguf --include "runtime/*" "marimba-encoder-Q8_0.gguf" --local-dir marimba-gguf
git clone https://github.com/ServeurpersoCom/ggml.git
git -C ggml checkout ef4555b7aede4467a5de803b103615e0a5f30dd8
cmake -S marimba-gguf/runtime -B build -DGGML_SOURCE_DIR="$PWD/ggml" # add -DGGML_CUDA=ON for the CUDA backend
cmake --build build -j
import sys
import numpy as np
sys.path.insert(0, "marimba-gguf/runtime")
from mqenc import Encoder
encoder = Encoder("build/libmqenc.so", "marimba-gguf/marimba-encoder-Q8_0.gguf", device="CPU", threads=4) # or device="CUDA0"
windows = np.zeros((2, 128000), dtype=np.float32) # 8 s of 16 kHz mono in [-1, 1) per row
states = encoder(windows, last_layer=18) # last_layer=12 stops early and omits layer 18
for layer, hidden in states.items():
print(layer, hidden.shape) # 9, 12 and 18: (2, 104, 896) float32
Pass force_f32=True to Encoder to expand the weights to F32 at load.
To use a file only as a storage format for the PyTorch encoder of the marimba-audio package, runtime/torch_loader.py expands each tensor with gguf.quants.dequantize (gguf 0.19) and copies it into the audio tower:
from marimba import Marimba
from torch_loader import load_gguf_into
model = Marimba.from_pretrained(backend="torch", device="cuda", dtype="bfloat16")
load_gguf_into(model._engine.thinker.audio_tower, "marimba-gguf/marimba-encoder-Q8_0.gguf")
Marimba.from_pretrained still downloads the full Qwen3-ASR-0.6B checkpoint, so this path shows what the decisions and the latency would be, not a smaller download.
Limitations
- These files replace only the audio encoder. Questions that need the Qwen3-ASR text decoder (term detection, language identification) are not covered.
- The runtime takes full 8-second windows; shorter audio has to be padded by the caller, and the validity mask of the
marimba-audiopackage is not reproduced. - The readouts were fitted on floating-point encoder states. The tables above show how each variant moves their outputs;
turn_end, which reads layer 18, moves the most. - Latency was measured on the hardware named in each table and does not transfer to other GPUs or CPUs.
- The runtime is a research artifact: it has no streaming API and rebuilds its compute graph on every call.
Attribution
The encoder weights come from Qwen/Qwen3-ASR-0.6B (Apache-2.0). Quantization and inference use ggml (MIT) at the commit above; the encoder graph in runtime/mqenc.cpp is adapted from ServeurpersoCom/qwenasr.cpp (MIT, license text in runtime/LICENSE.qwenasr.cpp). The decision readouts are from charcot-ai/marimba.
- Downloads last month
- 107
4-bit
5-bit
6-bit
8-bit
16-bit
32-bit