Repository navigation
Reduce shared WavLM memory usage for MioCodec, MioTTS, and MeanVC2 - #954
Merged
Merged
Conversation
cunba-ai
pushed a commit
to cunba-ai/audio.cpp
that referenced
this pull request
Oct 28, 2026
…en3 one-pass voicing, voxcpm2 step graphs, f5 CUDA constants, WavLM, cosyvoice3 NPU) Upstream commits 9464bbe..a8f9858 (9): - perf(qwen3_tts): opt-in voicing chunked text in one decoder pass (0xShug0#910) - server: default_session_options for configured and UI-loaded models (0xShug0#944) - Kitten TTS 2 BF16/Q8/Q4 GGUF support (0xShug0#947) - perf(voxcpm2): size step graphs by the request, not max_length (0xShug0#950) - fix(f5_tts): free evicted graphs' staged CUDA constants (0xShug0#953) - feat(cosyvoice3): flow DiT estimator on the Rockchip NPU (0xShug0#951) - refactor(f5_tts): drop unused raw DiT weight store (0xShug0#956) - WavLM memory reduced with graph allocation (0xShug0#954) - server: voice presets carry request options (0xShug0#942) # Conflicts: # src/framework/modules/speech_encoders/wavlm_encoder.cpp # src/models/qwen3_tts/session.cpp
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.
Summary
Use gallocr unconditionally for the shared WavLM encoder instead of allocating storage for every context tensor. This lets non-overlapping intermediates reuse memory without changing model math or introducing an opt-in setting.
One framework source file changes. No model-local, public-option, spec, kernel, or build changes.
A/B Results
Baseline: main
977dc40a. Debug builds (-O3 -g), RTX 5090 / Ryzen 9 7900X, eight threads. Existing MioCodec/MioTTS original GGUFs and MeanVC2 FP32. Sequential runs using the existing CLI path-test tool, condaqwen3-tts,--log, and 20 ms process memory sampling.GPU memory is sampled process peak VRAM; CPU memory is sampled peak RSS. Peaks cover the entire session. Warm RTF aggregates inference wall time/output duration after excluding the first warmup request. No measured performance regression; small timing differences are not statistical speedup claims.
Correctness And Lifecycle
Each model was tested in one session with a short warmup, a normal request, an exact repeat, a changed shorter reference/input, and a longer reference/input. MioTTS additionally changes the reference recording without changing its length, exercising a reused WavLM graph on a reference-cache miss. Audio lengths span 1.6, 3.2, and 5.95 seconds.
2.632e-7, minimum cosine similarity is0.99999999999399. This is not byte-exact parity. Baseline CUDA repeated requests already show comparable tiny waveform variation (RMSE2.437e-7/1.611e-7).Plapre is not included in this validation. These are focused C++ allocation A/B checks, not new Python parity or ASR evaluations.