Repository navigation
Moonshine streaming: incremental frontend (optional frontend_step.vmfb) - #516
Merged
Merged
Conversation
When frontend_step.vmfb (the same frontend exported for 16 + 4 frames) sits next to frontend.vmfb, the frontend runs in 0.32 s chunks as the audio arrives and windows only run the encoder and adapter on cached features. Frames that can only see zero padding take the frontend's constant silence feature instead of another graph call. Without the file nothing changes. Measured with moonshine_stream_check on an arm32 Mali device, 40 German commands paced like a microphone, against the released 0.62.2 library: features bit-identical (MOONSHINE_FE_VERIFY, 141/141 windows maxdiff 0), transcripts identical 40/40, flush p50 319 -> 172 ms, end of audio -> final text p50 -275 ms, faster in 40/40. moonshine_stream_check.c drives the library without an app (fake JNIEnv, like whisper_session_check.c).
…docs; build script resets CFLAGS Both ABIs rebuilt from this source (no verify code in them). stats() gains feStepCalls/feStepMs, IreeMoonshineStream.OPTIONAL_FILE_NAMES names frontend_step.vmfb, and build-moonshine-stream.sh always passes CMAKE_C_FLAGS so a cached GEOMETRY does not leak into the next build. The armeabi-v7a library re-checked on the device: 40/40 transcripts identical to 0.62.2, flush p50 172 ms.
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.
What
The streaming Moonshine runtime reran the audio frontend over the whole 68-frame window at every hop, and once more over the tail at
finish(). That tail is most of the end-of-utterance flush.With an optional ninth model file,
frontend_step.vmfb, next tofrontend.vmfb, three things change:frontend_step.vmfbis the same frontend exported withMOONSHINE_FE_SAMPLES=6400. Without the file, behaviour is unchanged.Also in this PR
moonshine_stream_check.c: drives the library on a device without an app (fake JNIEnv, likewhisper_session_check.c).stats(): gainsfeStepCalls/feStepMs.IreeMoonshineStream.OPTIONAL_FILE_NAMES: names the optional file.build-moonshine-stream.sh: always passesCMAKE_C_FLAGS. Before, a cachedGEOMETRYfrom the previous build leaked into the next one.Evidence
Measured on an arm32 Mali device (Vulkan, IREE 3.11) with 40 German commands fed like a microphone (40 ms chunks, real-time pace). The 0.62.2 library ran 3 times and this branch ran 2 times:
-DMOONSHINE_FE_VERIFYalso runs the whole-window frontend and compares its output. It found maxdiff 0 in 141/141 windows, so the features are bit-identical, including the silence-feature shortcut.Follow-ups (not in this PR)
asr-moonshine-v2-streaming-ireeshould export and compilefrontend_step.vmfb.OPTIONAL_FILE_NAMESwhen present.🤖 Generated with Claude Code