Repository navigation
Avoid redundant VoxCPM2 KV cache staging and resets - #1085
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VoxCPM2 still staged and uploaded full-capacity KV buffers on both reset and prefill import. Remove the redundant reset and enable direct prefix uploads with backend tail zeroing. This eliminates cache-sized host staging while preserving every cache byte.
The shared
TransformerKVCacheOptions::direct_importoption defaults to false and is enabled only by VoxCPM2. It requires dense F32 non-ring caches; existing callers retain their original behavior. Attention dimensions, precision, sampling, CFM conditioning uploads, and prefill graph construction are unchanged.#950 already addressed the maximum-length attention-cache sizing reported in #917. This PR addresses the remaining KV reset/import overhead; the smaller optimization suggestions in that issue are outside this change.
Validation used debug builds and an existing Q8 GGUF with its embedded spec:
CUDA RTX 5090, Q8, 8 threads, default settings (
mem_saver=true,perf_mode=off): three sequential paired sessions, each with one excluded warmup and five measured clone requests. Run order alternated. RTF uses canonicalsession.wall_msdivided by output duration.The measured RTF reduction is only 0.76%; no substantial speedup or peak-VRAM reduction is claimed. All 18 WAV pairs in the repeated performance comparison were byte-identical. The reported Jetson hardware was not tested.
Closes #917.