Commit Graph

6 Commits

Author SHA1 Message Date
Kazeia Team d1baacd096 refonte(llm): Phase 3 — archivage code mort (Genie + EngineLlmAdapter)
Après analyse de dépendances : l'essentiel d'ExecuTorch/QNN est VIVANT via le
TTS Qwen3TtsEngine "prod" (org.pytorch.executorch.Module → libexecutorch.so,
+ libQnnGpu.so backend Adreno, + QnnHtp). NE PAS archiver (stack TTS figée).

Réellement mort (refonte LLM) → archivé dans
/opt/Kazeia/archive/2026-06-17_refonte-engine/ :
- EngineLlmAdapter.kt (ancien adaptateur GGUF, remplacé par UnifiedLlmAdapter ;
  références restantes = commentaires uniquement)
- GenieJni.kt + genie_jni.cpp + libGenie.so (backend Genie mort ; libgenie_jni.so
  n'était même plus shipé → GenieJni ne pouvait plus se charger)
- cible CMake genie_jni retirée ; manifest jniLibs re-figé (27 libs, -libGenie)

Aussi : ConfigStore.llmEngine documenté comme VESTIGIAL (le dispatch passe par
UnifiedLlmAdapter magic-byte depuis la refonte ; modèle choisi par speaker.modelId).

Build release vert ; LLM device non-régressé (GGUF 18 / qwen3-4b .pte 18.6 /
guard4b .pte 21 tok/s) ; aucune lib genie dans l'APK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 23:28:14 +02:00
Kazeia Team 6f45a75197 chore: snapshot migration moteur lib (préservation avant dégraissage)
Capture l'état courant de kazeia-android (migration vers le moteur lib unifié :
suppression des anciens AudioCaptureManager/VadEngine/SileroVad, WhisperJni/
WhisperLiteRt/WhisperNpu/AndroidStt, KazeiaLlmJni/LlamaCppLlmEngine,
AndroidTts/ChatterboxTts ; édits app/JNI/gradle associés). L'app construit et
tourne sur device dans cet état. Commit de préservation pour ne rien perdre
avant de restreindre le périmètre de suivi du dépôt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 21:19:24 +02:00
Kazeia Team 8a3151681d llm: add llama.cpp backend (LlamaCppLlmEngine) for Qwen3.5-4B
- KazeiaLlmJni.kt : JNI bindings for 9 native fns (load/generate/setSystem/
  reset/snapshot/stats/kvTokens/free).
- LlamaCppLlmEngine.kt : implements core LlmEngine interface over KazeiaLlmJni,
  persistent KV cache across turns, streaming token callback.
- jni/kazeia_llm_jni.cpp : JNI bridge to /opt/Kazeia/kazeia-llm/ C++ wrapper
  (compiled inline via CMakeLists).
- jniLibs : libllama.so + ggml-* from /opt/Kazeia/llama-upstream/build-android
  (rebuilt with GGML_OPENMP=OFF to avoid libomp.so runtime dep).
- KazeiaApplication.LLM_BACKEND config + runtime override via
  debug.kazeia.llm_backend (llamacpp|executorch). Default stays executorch
  for now; flip to llamacpp per-boot for the new path.
- KazeiaService wires the selected engine at pipeline load.

Validated on OPD2415: app loads Qwen3.5-4B-Q4_0 in ~4s via llama.cpp,
ChatActivity opens, pipeline STT→LLM→TTS ready. Phase 2 complete.
2026-04-23 08:07:07 +02:00
Kazeia Team 393ce79eb5 Native C++ pipeline: RTF 1.4 (was 3.6 in Java)
Full talker+CP autoregressive loop in C++ via JNI.
Talker 20ms/step, CP 44ms/step, total 6.6s for 4.64s audio.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 10:09:32 +02:00
Kazeia Team 8bfe6c7445 Add NEON SIMD heads argmax for CP — 2.3× speedup
CP head dot products (15 × 2048×1024) optimized with ARM NEON
vfmaq_f32 (4 accumulators, 16 floats/iteration).

CP/frame: 131ms → 58ms, total pipeline: 22.7s → 14.7s (RTF 3.2)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 08:55:20 +02:00
Kazeia Team 389ffa7c61 Initial commit: Kazeia TTS pipeline on NPU via ExecuTorch
Full Qwen3-TTS-0.6B pipeline running on Snapdragon 8 Elite NPU:
  - Talker (28L) and Code Predictor (5L) as .pte on QNN HTP fp16
  - JNI integration, no root required
  - Validated audio quality: RTF 3.9

  Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 08:42:11 +02:00