Skip to content

pipeline-codec: reset sched before encode alloc#12

Open
Radu0120 wants to merge 1 commit into
ServeurpersoCom:masterfrom
Radu0120:fix-codec-sched-reset
Open

pipeline-codec: reset sched before encode alloc#12
Radu0120 wants to merge 1 commit into
ServeurpersoCom:masterfrom
Radu0120:fix-codec-sched-reset

Conversation

@Radu0120

Copy link
Copy Markdown

The codec encode path (pipeline_codec_encode) calls ggml_backend_sched_alloc_graph without first calling ggml_backend_sched_reset, unlike every sibling path — the decode path at the top of the same file, prompt-builder.h, and speaker_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:

ggml/src/ggml-backend.cpp:1867: GGML_ASSERT(!sched->is_alloc) failed

in ggml_backend_sched_alloc_graph, crashing the server.

Repro (base model, POST /v1/voices)

  1. Register a cloned voice from a WAV — succeeds.
  2. Generate speech.
  3. Register another voice.

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant