sandyz1000 commited on
Commit
34c877a
Β·
verified Β·
1 Parent(s): 233e4b6

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +28 -20
README.md CHANGED
@@ -12,25 +12,33 @@ tags:
12
  An [ExecuTorch](https://pytorch.org/executorch/) (`.pte`) export of
13
  [kyutai-labs/pocket-tts](https://github.com/kyutai-labs/pocket-tts) for
14
  [react-native-executorch](https://github.com/software-mansion/react-native-executorch)
15
- (RNE). Independent export, not affiliated with Kyutai or Software Mansion β€” full pipeline
16
- and verification writeup in the `pocket-tts-export` project this was built from
17
- (see its `notes/plan.md` and `notes/phase0-2-findings.md`), not yet published
18
- publicly.
19
 
20
  pocket-tts is licensed MIT by Kyutai; this repo redistributes derived model weights
21
  under the same terms. Voice files are pocket-tts's own predefined voices
22
  (`kyutai/tts-voices`) β€” check that repo for per-voice licensing before redistributing
23
  further.
24
 
25
- ## ⚠️ Backend status
26
 
27
- These are the **portable/interpreter** ExecuTorch build (no XNNPACK delegation).
28
- The XNNPACK-delegated variant crashes on real on-device hardware (`SIGSEGV` inside
29
- `xnn_f32_vsubc_ukernel__neon_u8`, confirmed via a device crash report) β€” root cause
30
- not yet found, suspected ExecuTorch/XNNPACK version mismatch between the export
31
- environment and RNE's bundled native runtime. Portable mode is slower (no SIMD) but
32
- has no known crash. Do not substitute an XNNPACK re-export without re-verifying
33
- on-device first.
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  ## Layout
36
 
@@ -39,8 +47,10 @@ v1/
39
  text_conditioner.pte 16MB β€” text tokens -> embeddings (dynamic seq len)
40
  flow_lm_prompt_step.pte 264MB β€” text embeddings -> primed KV cache (dynamic prompt len)
41
  flow_lm_decode_step.pte 341MB β€” one autoregressive decode step (6-layer transformer)
42
- mimi_decode_step.pte 41MB β€” one Mimi decode step (latent frame -> 1920 PCM samples)
 
43
  state_manifest.json β€” exact state tensor shapes + emb_mean/emb_std, for the JS driver
 
44
  voices/
45
  alba.safetensors 12MB
46
  george.safetensors 12MB
@@ -48,16 +58,14 @@ v1/
48
  ```
49
 
50
  Voice files are the flow_lm KV cache pre-primed with `get_state_for_audio_prompt`,
51
- padded to a fixed 256-position capacity (unoptimized β€” roughly half of each file is
52
- NaN filler for unwritten future slots; trimming this is a known follow-up, not yet
53
- done). Load, pad to the same capacity used at export time, and feed directly as the
54
- `flow_lm_decode_step`/`flow_lm_prompt_step` graphs' initial cache state.
55
 
56
  ## Consuming these
57
 
58
  `.pte` files here are **not** loadable through RNE's `TextToSpeechModule` β€” that's
59
  hardcoded to Kokoro's graph shape. Load each file through RNE's generic
60
  `ExecutorchModule` binding instead and drive the prompt β†’ decode β†’ Mimi loop
61
- yourself; see the export project's `mobile-demo/App.tsx` for a complete reference
62
- implementation, or `notes/plan.md`'s "How RNE actually consumes an exported model"
63
- section for why.
 
12
  An [ExecuTorch](https://pytorch.org/executorch/) (`.pte`) export of
13
  [kyutai-labs/pocket-tts](https://github.com/kyutai-labs/pocket-tts) for
14
  [react-native-executorch](https://github.com/software-mansion/react-native-executorch)
15
+ (RNE). Independent export, not affiliated with Kyutai or Software Mansion.
 
 
 
16
 
17
  pocket-tts is licensed MIT by Kyutai; this repo redistributes derived model weights
18
  under the same terms. Voice files are pocket-tts's own predefined voices
19
  (`kyutai/tts-voices`) β€” check that repo for per-voice licensing before redistributing
20
  further.
21
 
22
+ ## Status: XNNPACK-delegated, verified on-device
23
 
24
+ These `.pte` files are **XNNPACK-delegated** and verified end-to-end on an iPhone 17
25
+ simulator through RNE's generic `ExecutorchModule` binding (react-native-executorch
26
+ 0.9.2, completely stock β€” no patches, no custom native modules): all three voices
27
+ generate real speech, with the model signaling its own EOS, ~0.33x realtime on the
28
+ simulator. Full pipeline, export scripts and the debugging writeup live in the
29
+ `pocket-tts-export` project this was built from
30
+ (`notes/plan.md`, `notes/phase0-2-findings.md`).
31
+
32
+ Export-side fixes that make the XNNPACK artifacts on-device-safe (see the export
33
+ project's notes for the whole story β€” the original failure was a broken `.pte`
34
+ serialization plus on-device-only XNNPACK kernel crashes, both fixed in the export):
35
+ - Mimi decode is **two graphs** (`mimi_latent_step` + `mimi_pcm_step`), split at the
36
+ sub-frame/PCM boundary β€” a single merged graph at this context does not survive a
37
+ fresh-process load.
38
+ - Every `.pte` is smoke-tested in a fresh process before shipping.
39
+ - Small streaming-tail op families (and the SEANet conv stack in `mimi_pcm_step`) are
40
+ kept off the XNNPACK delegate, where RNE's bundled XNNPACK build crashes; the bulk
41
+ linear/matmul work stays delegated.
42
 
43
  ## Layout
44
 
 
47
  text_conditioner.pte 16MB β€” text tokens -> embeddings (dynamic seq len)
48
  flow_lm_prompt_step.pte 264MB β€” text embeddings -> primed KV cache (dynamic prompt len)
49
  flow_lm_decode_step.pte 341MB β€” one autoregressive decode step (6-layer transformer)
50
+ mimi_latent_step.pte 24MB β€” latent frame -> 16 decoder sub-frames + state
51
+ mimi_pcm_step.pte 16MB β€” sub-frames + conv state -> 1920 PCM samples
52
  state_manifest.json β€” exact state tensor shapes + emb_mean/emb_std, for the JS driver
53
+ tokenizer.json β€” SentencePiece tokenizer (HF format)
54
  voices/
55
  alba.safetensors 12MB
56
  george.safetensors 12MB
 
58
  ```
59
 
60
  Voice files are the flow_lm KV cache pre-primed with `get_state_for_audio_prompt`,
61
+ padded to a fixed capacity (unoptimized β€” much of each file is NaN filler for
62
+ unwritten future slots). Feed them directly as the graphs' initial cache state.
 
 
63
 
64
  ## Consuming these
65
 
66
  `.pte` files here are **not** loadable through RNE's `TextToSpeechModule` β€” that's
67
  hardcoded to Kokoro's graph shape. Load each file through RNE's generic
68
  `ExecutorchModule` binding instead and drive the prompt β†’ decode β†’ Mimi loop
69
+ yourself: text_conditioner β†’ flow_lm_prompt_step (on the voice-primed caches) β†’
70
+ [flow_lm_decode_step + mimi_latent_step + mimi_pcm_step] per autoregressive step.
71
+ `pocket-tts-export`'s `mobile-demo/App.tsx` is a complete reference implementation.