Repository navigation
omnivoice: review-round fixes for the rknn_zeroop weight cache - #1303
Merged
Merged
Conversation
Follow-up to 0xShug0#1302 (merged as the pre-review commit; these fixes were validated on the board in the same session, p18-p23): - sweep *.tmp.* temps at the start of pack_weights: a process killed mid-cold-pack leaked up to 112 ~7 MB temps into the cache dir forever (only exact final names are ever read back) - publish temps via mkstemp instead of a per-pid name: pid namespaces sharing a bind-mounted model dir collide on ...bin.<pid>.tmp - the warm->cold fallback (the main new path) now names the file in last_warning(): cache: warm miss at <file> (read/checksum) | (device sync), repacking - a silent repack was visible only as a pack_ms jump, and a failed device sync masqueraded as a cache miss - zero each device buffer before pack_b so file + trailer never carry uninitialized device-pool bytes if a future librknnrt rounds B.size above the packed grid - docs: warm load is ~2.8 s (the FNV verification pass), not ~1.1 s; document the sweep, mkstemp, the warm-miss warning, and cache growth (~812 MB per fingerprint, never pruned) Board gates (RK3588 twin, seed 42, g=2.0, all audio md5 31eaa272118dd19fad97ac326a72f91d): fresh install cold pack 8797.9 ms, 112 files; warm 2868.9 ms, zero warnings; chattr +i dir -> rc=0, dir empty, write-failed warning; mid-file corruption -> warm-miss warning names the file, repack 9831.6; kill -9 at 9 final + 1 tmp -> rerun leaves 112 final / 0 tmp, 8880.3. x86 stub tier g++ -fsyntax-only with ENGINE_HAVE_RKNN=1 and check_loader_catalog_sync.py pass. Co-Authored-By: Claude <[email protected]> Performed-by: Claude-Fable-5
Owner
|
@wOvAN Thanks! Merged. |
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.
Follow-up to #1302 (which merged the pre-review commit): the five review-round fixes to the same
disk cache, validated on the RK3588 board in the same session as the parent PR.
What is fixed
(
<file>.tmp.XXXXXX, up to 112 x ~7 MB) in the cache dir forever - only exact final names areever read back, so nothing cleaned them.
pack_weights()now sweeps them at entry.containerized runs sharing a bind-mounted model dir wrote the same
<file>.<pid>.tmpand raced a rename out from under each other. Publish temps come frommkstempin the cache dir.missing/truncated/checksum-mismatched pack file was visible only as a
pack_msjump, and afailed
rknn_mem_syncon the warm path (a driver-side problem) masqueraded as a plain cachemiss. The warning now carries the file and the reason:
cache: warm miss at <file> (read/checksum) | (device sync), repacking.B.sizebytes while the packer writesthe
N1*K1*subN*subKgrid; equal for the current geometries, so a futurelibrknnrtthatrounds
B.sizeabove the grid would put fresh device-pool bytes into the file and the trailer.Each buffer is now zeroed before packing.
verification pass; corrected, plus the sweep,
mkstemp, the warm-miss warning, and cachegrowth (~812 MB per fingerprint in the model dir, never pruned) are documented.
Validation (RK3588 board, twin geometry, seed 42, g=2.0)
Same twin gate as #1302 (the run is byte-deterministic when the cache path is correct), all five
gates below on this branch's binary; audio md5
31eaa272118dd19fad97ac326a72f91deverywhere.pack_ms 8797.9cold.pack_ms 2868.9, zero cache warnings in the log.chattr +ion the cache dir): rc=0, dir left empty,cache: write failed for .../ovz_omnivoice-zeroop-v1-<fp>.0.0.binlogged.cache: warm miss at .../ovz_...0.0.bin (read/checksum), repacking, cold repack9831.6.pkill -9 -x audiocpp_climid cold pack, 9 final + 1 temp on disk at the kill):rerun leaves 112 final, 0 temps (the sweep), full cold pack
8880.3.x86:
ovz_engine.cpp(stub tier) passesg++ -fsyntax-only -std=c++17 -DENGINE_HAVE_RKNN=1;tools/check_loader_catalog_sync.pypasses.Known limitations (unchanged from #1302)
detection, global fallback, ~8 s); no unit tests (the path needs a board).