Skip to content

iree-android: IreeMoonshineStream — the streaming Moonshine v2 speech-to-text runtime - #450

Merged
michalharakal merged 1 commit into
developfrom
feature/iree-android-moonshine-stream
Sep 22, 2026
Merged

michalharakal merged 1 commit into
developfrom
feature/iree-android-moonshine-stream

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Summary

libskainet_moonshine_stream.so + IreeMoonshineStream: the streaming Moonshine v2 speech-to-text runtime, next to IreeKvSession and IreeRedecodeSession in llm-runtime:iree-android.

It drives the five graphs of MoonshineV2ExportCli (0.56.1) — frontend, encoder, adapter, masked prefill, dynamic with-past step — plus the shared decoder parameter archive as a real streaming loop on the device: feedPcm(FloatArray) with mono 16 kHz PCM returns the updated cumulative partial transcript, finish() runs one exact full re-decode and returns the final transcript, reset() aborts. Files by absolute path (IreeMoonshineStream.Files / filesIn(dir)), no Context, native failures as IllegalStateException.

Build

native/build-moonshine-stream.sh <abi> --vulkan — same skainet/iree-android:3.11.0 image, cache and --link set as the other two libraries. Both ABIs' .sos are committed under jniLibs like the existing ones. Geometry is compiled in (tiny 320/6/8, which the English and German tiny streaming checkpoints share); GEOMETRY="-DL=10 -DHD=64 -DDIM=512 -DENC_DIM=620" builds the split-width small variant.

Verification

  • :llm-runtime:iree-android:assembleRelease packages all three libraries for both ABIs; nm shows the five Java_sk_ainet_transformers_iree_android_IreeMoonshineStream_* symbols.
  • The C source is the runtime that has been running streaming German and English on an arm32 Mali device (Vulkan) for weeks; only the JNI class name changed. A device run through the new binding follows with the Moonshine cartridge blueprint that consumes this artifact.

Why

With the exporter released in 0.56.1, the runtime was the last piece a Moonshine cartridge needed from a released artifact rather than from C source in the cartridge repo.

…h-to-text runtime

libskainet_moonshine_stream.so (arm64-v8a + armeabi-v7a, Vulkan + local-task) drives the five graphs of
MoonshineV2ExportCli -- frontend, encoder, adapter, masked prefill, dynamic with-past step -- plus the shared
decoder parameter archive as a real streaming loop on the device: PCM in (64-frame windows, hop 0.88 s,
encode stages on the device, incremental greedy decode), cumulative partial transcripts out, one exact full
re-decode on finish(). IreeMoonshineStream is the Kotlin binding, shaped like IreeKvSession: files by
absolute path, no Context, every native failure an IllegalStateException.

Built by native/build-moonshine-stream.sh with the same image and cache as the other two libraries; the
tiny geometry (320 / 6 / 8) is compiled in, GEOMETRY="-D…" selects the split-width small variant.

This is the last piece a Moonshine cartridge needed from a released artifact: the exporter (0.56.1) and now
the runtime.
@michalharakal
michalharakal merged commit 4430587 into develop Sep 22, 2026
4 checks passed
@michalharakal
michalharakal deleted the feature/iree-android-moonshine-stream branch September 22, 2026 10:31
@michalharakal michalharakal mentioned this pull request Sep 22, 2026
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