pipeline-codec: reset sched before encode alloc#12
Open
Radu0120 wants to merge 1 commit into
Open
Conversation
The codec encode path allocated its graph without first resetting the shared scheduler, unlike every sibling path (decode, prompt-builder, speaker_encoder_extract). After a synthesis call leaves the codec sched allocated, the next RVQ encode — e.g. registering a second cloned voice after a generation — trips GGML_ASSERT(!sched->is_alloc) in ggml_backend_sched_alloc_graph and crashes the server. Reset the sched before alloc to match the other call sites. Repro: register a voice (base model) -> generate speech -> register another voice. Second register crashes without this fix.
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.
The codec encode path (
pipeline_codec_encode) callsggml_backend_sched_alloc_graphwithout first callingggml_backend_sched_reset, unlike every sibling path — the decode path at the top of the same file,prompt-builder.h, andspeaker_encoder_extract.Once a synthesis call leaves the shared codec sched in the allocated state, the next RVQ encode allocs on a still-allocated sched and trips:
in
ggml_backend_sched_alloc_graph, crashing the server.Repro (base model,
POST /v1/voices)Second register crashes without this fix. Log ends with a successful
[SpkExtract] Extracted ...(the extract resets its own sched) immediately followed by the assert, because the crash is in the codec encode that runs right after.Fix
Reset the sched before alloc in the encode path, matching the other call sites. One line.