Whole clip · 30 s
227.65× realtime131.78 ms p50 · BF16 SDPA
NVIDIA RTX 6000 Ada · Single stream
Decode latency and causal streaming
Whole clips decode up to 227.65× realtime on this GPU. The live decoder emitted each chunk without waiting for future codes.
Read the measurements ↓Whole clip · 30 s
227.65× realtime131.78 ms p50 · BF16 SDPA
Causal · 80 ms chunks
0.86× realtime93.03 ms steady p50 · BF16 SDPA
Causal · 160 ms chunks
1.68× realtime93.97 ms steady p50 · BF16 SDPA
48 kHz stereo, batch size 1, 32 codebooks. Realtime multiples divide audio duration by measured decode time. Higher is faster.
From precomputed codes on the GPU, the 30 s BF16 SDPA decode took 131.78 ms p50. A single 80 ms frame took 84.21 ms p50. Full FP32 SDPA took 70.04 ms for the same single-frame shape.
At 30 s, peak PyTorch tensor allocation was 4,474 MiB with BF16 codec weights and 8,596 MiB with FP32 codec weights and BF16 compute. Both include the loaded encoder and decoder.
Timing starts with GPU-resident codec IDs and ends with GPU-resident waveform output. End-to-end latency also includes token generation or encoding, data transfer, buffering and playback.
| Audio | Frames | Wall p50 (ms) | Wall p95 (ms) | CUDA event p50 (ms) | Peak (MiB) | Realtime |
|---|---|---|---|---|---|---|
| 80 ms | 1 | 84.21 | 86.34 | 84.18 | 4,126 | 0.95× |
| 320 ms | 4 | 85.14 | 87.13 | 85.11 | 4,129 | 3.76× |
| 960 ms | 12 | 85.52 | 86.62 | 85.50 | 4,137 | 11.23× |
| 2 s | 25 | 86.88 | 87.49 | 86.85 | 4,153 | 23.02× |
| 6 s | 75 | 89.05 | 91.62 | 89.03 | 4,196 | 67.37× |
| 12 s | 150 | 95.42 | 96.05 | 95.40 | 4,266 | 125.76× |
| 30 s | 375 | 131.78 | 133.60 | 131.76 | 4,474 | 227.65× |
| Audio | Frames | Wall p50 (ms) | Wall p95 (ms) | CUDA event p50 (ms) | Peak (MiB) | Realtime |
|---|---|---|---|---|---|---|
| 80 ms | 1 | 83.91 | 84.64 | 83.88 | 8,259 | 0.95× |
| 320 ms | 4 | 83.90 | 85.23 | 83.87 | 8,259 | 3.81× |
| 960 ms | 12 | 84.59 | 85.50 | 84.56 | 8,259 | 11.35× |
| 2 s | 25 | 85.92 | 86.95 | 85.90 | 8,270 | 23.28× |
| 6 s | 75 | 88.05 | 89.16 | 88.02 | 8,318 | 68.15× |
| 12 s | 150 | 94.69 | 96.34 | 94.67 | 8,387 | 126.73× |
| 30 s | 375 | 132.37 | 132.94 | 132.35 | 8,596 | 226.63× |
| Audio | Frames | Wall p50 (ms) | Wall p95 (ms) | CUDA event p50 (ms) | Peak (MiB) | Realtime |
|---|---|---|---|---|---|---|
| 80 ms | 1 | 70.04 | 71.06 | 70.01 | 8,248 | 1.14× |
| 320 ms | 4 | 70.98 | 72.92 | 70.95 | 8,252 | 4.51× |
| 960 ms | 12 | 71.12 | 81.27 | 71.10 | 8,261 | 13.50× |
| 2 s | 25 | 71.68 | 72.59 | 71.67 | 8,276 | 27.90× |
| 6 s | 75 | 92.42 | 93.04 | 92.40 | 8,352 | 64.92× |
| 12 s | 150 | 152.29 | 153.09 | 152.27 | 8,428 | 78.80× |
| 30 s | 375 | 349.53 | 352.78 | 349.51 | 8,690 | 85.83× |
One codec frame represents 80 ms of audio. The decoder can emit its 3,840 samples per channel as soon as that frame’s codes are available.
160 ms was the smallest BF16 chunk that held realtime. All 225 steady full chunks fit the playout window. Adding frames improves throughput and can increase queueing delay when codes arrive one frame at a time.
At 80 ms, FP32 reached 0.80× realtime with 104.33 ms p95 and 456/456 steady chunks above budget.
| Chunk | Frames | First p50 (ms) | Steady p50 (ms) | Steady p95 (ms) | Steady over budget | Session speed | RMSE vs full | Peak error | SNR |
|---|---|---|---|---|---|---|---|---|---|
| 80 ms | 1 | 97.10 | 93.03 | 97.45 | 456/456 | 0.86× | 0.00069 | 0.012 | 40.9 dB |
| 160 ms | 2 | 98.44 | 93.97 | 99.60 | 0/225 | 1.68× | 0.00074 | 0.023 | 40.2 dB |
| 320 ms | 4 | 97.19 | 93.55 | 107.01 | 0/111 | 3.35× | 0.00072 | 0.012 | 40.5 dB |
| 640 ms | 8 | 96.82 | 93.67 | 96.99 | 0/54 | 6.53× | 0.00074 | 0.02 | 40.2 dB |
Three warmed sessions per chunk size of the same 12.24 s input. First p50 is measured across fresh state within an already loaded process. Steady p95 uses full chunks after the first, and session speed includes the first and any shorter final chunk. Times use the private frame method to isolate decode in a live context. Context setup, waveform concatenation, code arrival and playback are outside the timed calls. Signal errors compare each concatenated stereo waveform to the unchunked output from the same precision and backend.
| Chunk | Frames | First p50 (ms) | Steady p50 (ms) | Steady p95 (ms) | Steady over budget | Session speed | RMSE vs full | Peak error | SNR |
|---|---|---|---|---|---|---|---|---|---|
| 80 ms | 1 | 104.15 | 100.65 | 104.33 | 456/456 | 0.80× | 7.9e-08 | 3.5e-06 | 119.7 dB |
| 320 ms | 4 | 107.76 | 102.09 | 105.48 | 0/111 | 3.06× | 8.5e-08 | 5e-06 | 119.0 dB |
| Codec precision | Chunk | First (ms) | Steady p50 (ms) | Steady p95 (ms) | Steady over budget | Session speed |
|---|---|---|---|---|---|---|
| BF16 | 160 ms | 101.34 | 100.28 | 102.80 | 0/75 | 1.58× |
| FP32 | 320 ms | 88.98 | 84.66 | 86.61 | 0/37 | 3.70× |
One warmed session per row, timed using model.decode(step, return_dict=True) inside the persistent context. The two series used the same fixture in separate runs. Observed process-to-process timing variation limits direct comparison of wrapper overhead.
Replaced all codes after 37 frames. For the common prefix, RMSE 0, peak 0, SNR ∞ dB. The suffix changed by RMSE 0.12.
Compared the first 37 frames decoded alone with the same prefix of the full waveform. RMSE 0.00079, peak 0.024, SNR 39.5 dB.
Public incremental decode at 320 ms per call versus the built-in chunked helper gave RMSE 0, peak 0, SNR ∞ dB. Against the unchunked result, RMSE 0.00072, peak 0.012, SNR 40.5 dB.
Cloned the module-local state after a prefix and restored it into a fresh context. The continuation versus uninterrupted decode gave RMSE 0, peak 0, SNR ∞ dB.
For later 320 ms chunks, fresh context RMSE was 0.14. Clearing only K/V and key positions gave 0.14. Zeroing only attention offsets gave 0.11. Compare with the persistent 320 ms row.
An inactive slot returned length zero and its cached tensors and offsets were checked bit for bit. Its resumed audio versus the independently decoded slot gave RMSE 0.0011, peak 0.021, SNR 37.6 dB.
With TF32 disabled, the 320 ms persistent decode versus full FP32 gave RMSE 8.5e-08, peak 5e-06, SNR 119.0 dB. The prefix under same-shape suffix mutation gave RMSE 0, peak 0, SNR ∞ dB. The prefix decoded alone gave RMSE 9.7e-08, peak 3.9e-06, SNR 117.7 dB.
Keep a single streaming context alive for the session. The pinned implementation attaches mutable state to its decoder modules.
# Each new_codes is a CUDA LongTensor [32, frames] for one lane.
with torch.inference_mode(), model.streaming(batch_size=1):
for new_codes in code_chunks:
result = model.decode(new_codes, return_dict=True)
pcm = result.audio[0, :, :new_codes.shape[-1] * 3840]
emit(pcm) # Queue or play [2, samples] immediately.
Use complete code frames. The pointwise quantizer, reshape upsampling and stereo restoration need no additional history or overlap. The chunk_duration convenience argument manages its own context and returns assembled audio, so keep it outside a live context.
| Stage | Attention layers | Width | Internal rate | Cache slots | Window |
|---|---|---|---|---|---|
| 1 | 32 | 1,280 | 12.5 Hz | 125 | 10 s |
| 2 | 12 | 768 | 25 Hz | 250 | 10 s |
| 3 | 12 | 768 | 50 Hz | 400 | 8 s |
| 4 | 12 | 768 | 100 Hz | 400 | 4 s |
| 5 | 12 | 768 | 200 Hz | 400 | 2 s |
| 6 | 12 | 768 | 400 Hz | 400 | 1 s |
The 92 decoder attention layers retain approximately 84.77 MiB of BF16 K/V and 64-bit key positions per lane when allocated. Weights, transient tensors and allocator overhead are separate. In the 12.24 s test, every attention window rolled over. The first stage retained positions 28–152, with next offset 153. The last stage retained 4496–4895, with next offset 4896. These limits apply layer by layer. Since the windows compose across layers, reconstructing exact state after a restart can require more raw code history than the largest individual window. The checkpoint exposes a context manager for state ownership and reset. Session migration would require exporting and restoring the module-local tensors, offsets, masks and lane mapping. Pinned configuration
Scripts and machine-readable results are embedded in this report for offline access.
Run in a CUDA-enabled Python environment matching the versions shown. Install the Python dependencies with the matching PyTorch CUDA build. The default scripts fetch the pinned Hugging Face checkpoint. To reuse a local copy, pass --snapshot /path/to/snapshot.
python -m pip install transformers==5.24.1 accelerate==1.16.0 huggingface_hub==2.4.0 numpy==2.5.2 soundfile==0.14.0
python benchmark_decode.py
python causal_decode.py
python causal_decode.py --public-cross-checkPinned model-card demo, linearly resampled from 24 to 48 kHz, mono duplicated to stereo, frame-aligned, encoded once, then code sequence repeated and cropped for longer cases. Each offline public decode shape had 5 warmups and 30 synchronized timed repetitions. GPU event times are reported alongside host wall time.
The streaming run instead repeated the resampled waveform before encoding 153 frames. The same BF16-encoded IDs were used for both BF16 and FP32 causality checks. RMSE and peak error are in waveform amplitude units. SNR is 20 × log10(reference RMS / error RMS).
The precision labels describe the codec. The quantizer remains FP32 in every setting. The timings use PyTorch SDPA. Native FlashAttention 2 was unavailable in the benchmark environment.
A separate profile of a cached 320 ms BF16 step showed aten::_scaled_dot_product_efficient_attention dispatched by PyTorch SDPA. Separate public whole-clip traces dispatched the same operator for BF16 and FP32 at 1, 25 and 375 frames. All latency measurements were taken without profiling.
Primary sources · Pinned Hugging Face model card · Pinned implementation · CAT research paper