Repository navigation
fix(kokoro): poll synthesis cancel between stages - #45
Merged
lalalune merged 1 commit intoOct 14, 2026
Merged
Conversation
ABI v17 checks the Kokoro cancel flag only before and after the whole forward pass, so a cancelled call still runs the predictor, decoder front and iSTFTNet generator to completion. kokoro_synthesize and kokoro_synthesize_ipa now take an optional cancel callback that is polled before the predictor, between the predictor and the decoder, between the decoder front and the generator, and after the generator. A cancelled call returns KOKORO_E_CANCELLED with no samples. libelizainference passes a callback that reads the per-engine kokoro_cancel flag, so OmniVoice and Paradee calls still cannot clear it. The existing entry reset and exit exchange in eliza_kokoro_synthesize_audio stay as the flag's lifecycle. No hook runs inside a GGML graph: a failed conv graph falls back to the CPU loops in kokoro-layers.h, so a backend abort callback would not stop the work. Adds test-kokoro-cancel. Its weight-free checks always run; with KOKORO_TEST_MODEL and KOKORO_TEST_VOICE set it cancels a real synthesis at every stage boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lalalune
force-pushed
the
fix/android-elizainference-libm
branch
from
October 14, 2026 03:03
9abc710 to
b843732
Compare
lalalune
changed the base branch from
eliza/kokoro-g2p-plus-gemma4
to
eliza/develop-pin-ea8b3f2
October 14, 2026 03:04
lalalune
pushed a commit
that referenced
this pull request
Oct 14, 2026
Resolve kokoro-decoder against the stage-boundary cancel from #45: keep the shared decoder_forward and pass the caller's cancel callback through DecoderConfig. Keep both new kokoro tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
This PR is rebased onto
eliza/develop-pin-ea8b3f2(after #59 ABI v17 and #60).Dropped
eliza_voice_classifiersalready linksmPUBLIC, andelizainferencelinkseliza_voice_classifiers.Ported: Kokoro cancels between stages
In #59, Kokoro checks
kokoro_cancelonly before and after the whole forward pass. A cancelled call still runs the predictor, the decoder front and the iSTFTNet generator to the end, then throws the audio away. This PR stops the call at the next stage boundary.kokoro_synthesizeandkokoro_synthesize_ipatake an optionalkokoro_cancel_callback. It defaults to null, so existing callers do not change.kokoro_decoder_forward)KOKORO_E_CANCELLEDwith no samples.eliza_kokoro_synthesize_audiopasses a callback that reads the per-enginekokoro_cancelflag. It does not use the sharedtts_cancel/ElizaScopedTtsForward, so an OmniVoice or Paradee call still cannot clear a Kokoro cancel. The flag is reset at the start of each call and cleared again when the call ends, as libelizainference ABI v17: Paradee + misaki TTS entries, ASR cancel/supported, TTS cancel and evict for Kokoro/Paradee #59 already does.kokoro-layers.h, the code falls back to the CPU loops, so a backend abort callback would not stop the work. Apple builds use Accelerate, not GGML, by default.Tests
New test:
test-kokoro-cancel.KOKORO_TEST_MODELandKOKORO_TEST_VOICEare set: a real synthesis is cancelled at each stage boundary in turn. No weights were available locally, so this part has not been run yet.Local run on macOS arm64 (Ninja, Release,
LLAMA_BUILD_TESTS=ON,LLAMA_FATAL_WARNINGS=ON):tools/.ctest -R "kokoro|eliza-inference|omnivoice": 11/11 passed.🤖 Generated with Claude Code