pipeline-codec: reset sched before encode alloc

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 commit is contained in:
RaduAdumitroaei
2026-07-17 21:13:57 +02:00
committed by Pascal
parent 0e2b672329
commit 19bbf94dcc
+4
View File
@@ -691,6 +691,10 @@ std::vector<int32_t> pipeline_codec_encode(PipelineCodec * pc,
ggml_build_forward_expand(graph, sn_stage3_dump);
}
// Reset before alloc: a prior decode/synthesis may have left the shared
// codec sched allocated, which trips GGML_ASSERT(!sched->is_alloc). Mirrors
// the decode path (top of this file) and speaker_encoder_extract.
ggml_backend_sched_reset(pc->sched);
if (!ggml_backend_sched_alloc_graph(pc->sched, graph)) {
qt_log(QT_LOG_ERROR, "[Pipeline] encode sched_alloc_graph failed");
ggml_backend_sched_reset(pc->sched);