Repository navigation
feat(libopenbuenos): raise & auto-size weight cache cap (>916 MB) with telemetry (#40) - #45
Open
saariuslystoned wants to merge 2 commits into
Open
saariuslystoned wants to merge 2 commits into
saariuslystoned wants to merge 2 commits into
Conversation
- Reject negative/malformed env values instead of letting strtoul wrap to ULONG_MAX and clamp to 8 GiB (OPENBUENOS_WEIGHT_CACHE_MB=-16 was accepted as a massive explicit cap). - Saturating size_t arithmetic for cache accounting adds, meminfo add-back, and platform MemAvailable conversion (SIZE_MAX guards). - Reclaim orphaned tiles in weight_cache_sim_access when find_locked self-evicts an oversized entry (object leak). - Fix byte accounting: evict/detach/find now credit weight_cache_bytes for ext2 bytes only and decrement outlier_cache_bytes separately. - Deallocate macOS mach host port in the MemAvailable probe. - Guard ob_gemm_emitter op640 mask shift for n_c32 >= 64 (UBSan hit). - Add openbuenos_adversarial_test (env extremes, churn/shrink, SIZE_MAX, oversize, concurrent stats/cap churn); wire into CMake.
Collaborator
Author
Adversarial Hardening & Public-Roads Audit Receipt (
|
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.
Closes #40 (host implementation,
MemAvailable-guarded dynamic auto-sizing, explicitOPENBUENOS_CACHE_CAP>= 1.5 GB support, cache telemetry, and zero-thrash host unit tests; live Pixel 10 silicon re-benchmark tracked on the dedicated device lane).Summary
MemAvailable-guarded auto-sizing & raised ceiling (libopenbuenos/include/openbuenos.h,libopenbuenos/src/ob_internal.h,libopenbuenos/src/ob_gemm.cpp,libopenbuenos/src/ob_device.cpp,llama-cpp-edgetpu/openbuenos_shim.c): sizes weight cache budget cleanly fromMemAvailable(1,536 MiB default on 16 GiB systems with safe OOM headroom on smaller devices; injectableob::MemAvailableProbefor deterministic host testing) and supports explicitOPENBUENOS_CACHE_CAPoverrides >= 1.5 GB.ob_context_get_weight_cache_stats(hits, misses, evictions, resident/peak/budget bytes,pack_count,pack_us, entry count) plusweight_pack_countinob_profile_stats_t.libopenbuenos/tests/openbuenos_host_test.cpp,libopenbuenos/tests/openbuenos_selftest.cpp): verifies auto-sizing across RAM tiers, explicit >= 1.5 GB overrides, telemetry accuracy, and proves 0 steady-state evictions atw_peak = 916 MiBunder the 16 GiB default cap vs. thrashing at896 MiB.Verification
make -C libopenbuenos verify-header-host host test(-Wall -Wextra -Wpedantic -Werror): 28/28 PASS + quant unpack PASS.libopenbuenoshost tests: 28/28 PASS (0 ASan errors).ctest(libopenbuenos3/3,freetile4/4,llama-cpp-cloudtpu1/1),libopentpuhost tests, Python ISA/router self-tests, and clean-room audit across 192 files: PASS.