TTS on OpenVINO
· 14 min read

Qwen3-TTS on Intel: OpenVINO inference without CUDA

Contents
  1. The missing primitives
  2. The bandwidth wall
  3. Hardware layout and caching
  4. Real-Time Factor

This series follows a Qwen3-TTS runtime built with OpenVINO for Intel devices: graph export, quantized weights and KV state, native execution and streaming scheduling. The bandwidth equations are estimates under stated assumptions. They do not establish measured throughput, and this project-specific implementation is not an inventory of everything available in the OpenVINO ecosystem.

The missing primitives

Moving off NVIDIA also removes the memory-management primitives this stack relies on. FlashAttention (Dao et al., 2022) avoids materializing the O(n2)O(n^2) attention matrix in high-bandwidth memory by tiling in SRAM. Without it, every attention layer consumes more memory bandwidth. Without CUDA graphs, each kernel launch incurs driver overhead for every token. Without PagedAttention, the default is padded tensors with substantial internal fragmentation.

You cannot simply export an ONNX graph and expect 12 Hz multi-codebook TTS to stream. The system requires an active KV cache manager, an online batching scheduler, and a chunked neural codec pipeline operating in real-time.

+-----------+        +-------------------+        +---------------------------+
|  PyTorch  |        |    OpenVINO IR    |        | Native C++ Runtime        |
| Qwen3-TTS | -----> | (Static Subgraph) | -----> | Paged-KV (U8), NPU Offload|
|           |        |                   |        | Continuous Batch Scheduler|
+-----------+        +-------------------+        +---------------------------+
                                                               |
                                                               v
                                                      [ WebSocket PCM Stream ]

The bandwidth wall

Autoregressive inference generates tokens sequentially. For each token, the hardware must read the entire model weight matrix and the growing KV cache. The limiting metric is arithmetic intensity:

I  =  FLOPsbytes readI \;=\; \frac{\text{FLOPs}}{\text{bytes read}}

For a forward pass with NN parameters and bb bytes per parameter, yielding a single token requires ≈2N\approx 2N FLOPs. Thus, I≈2/bI \approx 2/b. For fp16, this is roughly 1 FLOP per byte. Modern hardware has a theoretical ridge point in the tens to hundreds of FLOPs per byte. Because II is so low, the compute cores starve while waiting for the memory bus. You are entirely memory-bandwidth bound.

The physical time floor for a single token generation is bounded by:

ttoken  ≳  N⋅b  +  KV bytes readBWt_{\text{token}} \;\gtrsim\; \frac{N \cdot b \;+\; \text{KV bytes read}}{\text{BW}}

This equation drove every engineering choice I made in the runtime. I implemented INT8 weight quantization (int8_sym) to drop bb from 2 to 1. I quantized the KV cache to U8 to shrink the scaling context term.

Hardware layout and caching

OpenVINO provides the graph compiler and the device abstractions (ov.Core). In qwen3_tts_ov/runtime.py, the compile_model wrapper detects the device topology. If it finds a GPU, it enforces GPU_ENABLE_LARGE_ALLOCATIONS to bypass default driver caps.

config = {"INFERENCE_PRECISION_HINT": precision_hint}
if "GPU" in device:
    config["GPU_ENABLE_LARGE_ALLOCATIONS"] = "YES"
try:
    return core.compile_model(str(model_path), device, config)
except Exception as first_error:
    # Fallback to CPU if large allocations fail
    return core.compile_model(str(model_path), "CPU", fallback_config)

OpenVINO compiles on first use, which adds substantial startup latency. I added a warmup routine that triggers dummy compilation passes at boot, so the cache is ready for the first WebSocket request.

Real-Time Factor

The operational threshold for the entire pipeline is the Real-Time Factor (RTF):

RTF  =  compute timeduration of audio produced\text{RTF} \;=\; \frac{\text{compute time}}{\text{duration of audio produced}}

To stream 12 Hz frames without buffer underruns, RTF\text{RTF} must strictly be <1< 1. At 12 Hz, the absolute budget is ≈83 ms\approx 83\,\text{ms} per frame. This budget must encompass the Talker AR step, the greedy subcode generation, and the stream decoder chunk. Rebuilding the continuous batcher directly on the OpenVINO C++ bindings was the only way to squeeze the inference loop tight enough to clear that 83 ms83\,\text{ms} window under concurrent load.

I mapped the tensor memory boundaries, bypassed Python thread locks, and bound the decoder to the NPU.

Continue with Talker, Subcode and decoder graph splitting to see which parts of a frame need different scheduling.

llminferenceopenvinottsedge

Comments