Repository navigation
asr: memory-map the Parakeet GGUF by default, Android included - #83
Merged
Merged
Conversation
The Parakeet-TDT (Phonon-2) backend reads its fv5 codes in place from the GGUF, but on Android it inherited the Qwen3-ASR CPU profile, which reads the whole file into private memory. On a 4 GB tablet that is a ~320 MB anonymous allocation that goes to swap. Map it on every platform instead; ELIZA_ASR_USE_MMAP=0 still selects the private copy. The Qwen3-ASR policy is unchanged. 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.
What
eliza_inference_asr_*on the Parakeet-TDT backend (Phonon-2) now memory-maps the GGUF on every platform. Until now it usedeliza_asr_use_mmap(), the Qwen3-ASR policy, which reads the file into private memory on Android (!eliza_asr_android_cpu_profile()).eliza_parakeet_use_mmap(): defaulttrue, andELIZA_ASR_USE_MMAP=0still selects the private copy.Why
The kernels decode the fv5 codes straight from the GGUF (
tools/parakeet/README.md: "The model is mmapped and used in place"), so a mapping costs only clean page cache that the kernel can reclaim. A private copy is ~320 MB of anonymous memory. On a 4 GB Lenovo TB336FU that allocation went to swap and starved the device (Grace crash, gracefultechnology/grace#152, which works around it withELIZA_ASR_USE_MMAP=1).Evidence
Tablet, TB336FU (Android, 4 GB, arm64), this branch.
eliza-inference-test-parakeet-asr(NDK r29, android-28, Release), pinnedphonon-2-fv5.gguf(sha256dc552eb7…), an 8.15 s TTS clip. Peak values sampled from/proc/<pid>/statusevery 50 ms:ELIZA_ASR_USE_MMAP0(old Android default)All runs give the same 26-word transcript in batch and in streaming mode.
Grace on the same tablet (measured in the app with the override, reported by the Grace session). Mapped, the private memory added by ASR was under 16 MB. The private copy was a 323 MB allocation that went to swap. WER was unchanged (0.034), and warm ASR RTF was about 0.10.
Mac (M-series, CPU build): footprint 113 MB mapped vs 442 MB private. On macOS this only confirms the override still works, because the default was already mmap there.
Evidence boundaries
/data/local/tmp, not the app.AI-assisted change.
🤖 Generated with Claude Code