Repository navigation
feat(model_spec): ship prebuilt RK3588 engines as rknn packages - #991
Merged
Merged
Conversation
A .rknn sidecar engine today has to be built on a PC with the pinned rknn-toolkit2 venv and carried to the board by hand; the manager knows every other weight format and refuses this one at the schema gate. Add `rknn` to the spec format enum and publish the engines validated on the RK3588 board as three packages — the Piper w93 decoder, the Kokoro w512 generator, and the Qwen3-TTS 0.6B stateful vocoder pair — downloading into the family's GGUF weight directory, where the exec-plan resolver already finds them by bare file name (engine_resources() falls back to the model path's parent). The engines are compiled per SoC, so the package ids say RK3588; other targets keep the converter path.
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 RKNN sidecar path has always ended at "build the engine yourself on a PC with the pinned toolkit venv, then carry the file to the board by hand". The manager transports arbitrary files and never inspects them, so the only thing keeping
.rknnout of the catalogue is the closedformatenum:schema.cpp: addrknntosource_formats(). One enum entry; the package validators (layout,package) and both managers are format-agnostic.model_specs/, alldefault: false, all downloading fromwOvANAI/rknn-tts-engines(public, LFS, README pins provenance and per-fileSHA256SUMS):piper_lessac_medium_decoder_rk3588→piper-lessac-w93.rknnintoPiper-TTS-GGUF/(19.6 MB)kokoro_82m_generator_rk3588→generator_w512.rknnintoKokoro-82M-GGUF/(93.5 MB)qwen3_tts_0_6b_base_speech_decoder_rk3588→ the stateful pair (chunk 64 + chunk 16, 245 + 260 MB) intoQwen3-TTS-12Hz-0.6B-Base-GGUF/docs/build/rockchip-npu.md: the packages lead the model-preparation section; the converter instructions stay as the path for every other SoC and for rebuilding from checkpoints.Each package installs into the family's GGUF weight directory, so the existing bare-name resolution in
engine_resources()/resolve_engine_path(a name that exists next to the model resolves to it;#975documented it) lets a plan name the engine by file alone — no absolute board paths:The engines are compiled per SoC, so the ids say RK3588. The CosyVoice3 flow ladder is deliberately not published (700–860 MB per rung × eight rungs); the repo and the doc say to build it per aperture.
Validation
PC (x86_64), worktree at
4faef969:tools/check_loader_catalog_sync.py --self-test+ full run:ok: ... in sync(394 manager packages, the three new ids included).model_manager_v2.py sizesresolves all three ids against the live repo (19602065 / 93510403 / 504587157 bytes).model_manager_v2.py installfor all three: placed as designed (Piper-TTS-GGUF/piper-lessac-w93.rknnetc. —strip_prefixlands them beside the GGUFs) and all four filessha256sum -cOK against the repo'sSHA256SUMS.model_spec_system_test(the suite that validates every shipped spec) passes;schema.cppcompiles clean.RK3588 board (Orange Pi 5 Plus, native aarch64 build with
ENGINE_ENABLE_RKNN=ON, rebuilt after the change, 0 errors):installruns succeed from the board (direct HF access,librknnrt0.9.8 / api 2.3.2).piper_ttsoffline,decoder.main=piper-lessac-w93.rknn→ 145 KB wav, rms 3004, peak 18719kokoro_ttsoffline,generator.main=generator_w512.rknn→ 409 KB wavqwen3_ttsstreaming (conv_weight_type=f16,--threads 4,--voice-ref assets/resources/b.wav --reference-text ...),speech_decoder.main/first= the installed pair → 365 KB wav, rms 3570, peak 25727sha256 20e09b6e…both), and the bare-name session vs the absolute-path session against it differ only by CPU float accumulation (95.9 dB SNR, max sample delta 79/32767).--min-free-memory-mb 27300(window between the two estimates on 30.6 GiB free): the RKNN plan is refused withestimated 3.49 GiB + 27300 MiB headroom exceeds available host memory (29.89 GiB)— 3.49 GiB is weights×1.5 + overhead + the pair's driver residency (594 MiB) — while the identical config withimpl: ggml(2.91 GiB estimate) starts and answers/health. Engines installed by the manager are priced by the residency guard.rknn_engine_test,server_config_test,rknn_sidecar_test) pass on the board with the change.