Understanding Static Cache vs Dynamic Cache in Qwen3-TTS
mainFasterQwen3TTS uses StaticCache for maximum throughput, while the upstream Qwen3-TTS uses DynamicCache. While the underlying algorithms are mathematically equivalent, they differ in execution:
- Static Cache (FasterQwen3TTS): Uses fixed max-length KV buffers and an explicit attention mask. This typically selects a different SDPA (Scaled Dot Product Attention) kernel (e.g., masked attention).
- Dynamic Cache (Upstream): Uses the current sequence length and can use
is_causal=Truewithout an explicit mask, typically selecting a different kernel.
Note on Precision: Because different kernels and reduction orders are used, outputs in BF16/TF32 are not bit-exact and may differ slightly between the two implementations.