Repository navigation
feat(libopenbuenos,ggml-edgetpu): zero-repack weight cache, FD bloat fix, and ob_dmabuf_map - #42
Merged
Merged
Conversation
… budget Add ob_gemm_prepack_quant_batch() and ob_prepack_stats_t to prepack all scheduled horizontally-fused quantized weight tiles once at graph load using a 4-thread WorkerPool without evicting already-resident entries. Honor explicit OPENBUENOS_WEIGHT_CACHE_MB up to (MemAvailable - 384 MiB) headroom while keeping the default auto MemAvailable/3 ceiling. Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
…and MoE/N gates Automatically register USAGE_WEIGHTS EDGETPU and CPU_Mapped buffers via ob_gemm_register_immutable_weights() with monotonic mutation versioning, prepack cgraph sibling/SwiGLU/singleton GEMM groups once per (group, M) on graph entry, keep oversized MoE MUL_MAT_ID (>64 MiB auto) and high-N heads (N>65536) on CPU so dense attention + draft weights stay 100% ext[2] resident. Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
…12 MiB headroom Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
…MAX_M Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
Expose external Linux DMA-BUF IOMMU map/unmap through ob_context's already-grouped tpu_fd (owning etdom & shared PASID) for downstream runtimes like freesched, with argument validation, deterministic 36-bit mock IOVA allocation, teardown cleanup, and unit test coverage. Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
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.
Summary
libopenbuenos,ggml-edgetpu): Register static weights immutably and prepack quantizedext[2]tiles once at load time (OPENBUENOS_PREPACK_AT_LOAD=1), eliminating runtime repack stalls.OPENBUENOS_MIN_TILE_DIM=128default) cleanly to CPU NEON, eliminating ~7,776 tiny(64,64)/dmabufFDs underRLIMIT_NOFILE=4096.OPENBUENOS_EDGETPU_MAX_M(supporting CPU prefill + EdgeTPU decode split) and bump default weight cache entry capacity (4096 -> 16384, clamp32768) with a512 MiBMemAvailableheadroom guard (kReserveBytes).ob_dmabuf_map/ob_dmabuf_unmap): Expose clean C11 APIs inopenbuenos.hmapping/unmapping external DMA-BUFs directly ontoctx->tpu_fd(etdom/ shared PASID) with argument validation, mock support, and teardown cleanup.Verification
GCC 13.3&Clang 18.1.3 -static):make -C libopenbuenos verify-header-host host test: 27/27 suites PASS (includingtest_zero_repack_weight_cache_and_prepackandtest_external_dmabuf_map_unmap).libopenbuenosCTest 3/3 PASS andfreetileCTest 4/4 PASS across all 3 toolchains.test_edgetpu_llm_shapesPASS andtest-backend-ops -b EDGETPU951/951 PASS (OPENBUENOS_MOCK=1).laguna/ Buenos A0) silicon benchmarks (16 GiB RAM,DESKTOPthermal guard):PocketCoder-13B-A3B-Q4_0standalone (-c 16384,WEIGHT_CACHE_MB=1536):9.45 pp / 3.89 tg t/s(w_misses=0, w_evict=0, pack_us=0,984entries,6.5xdecode /4.5xprefill vs prior thrashing baseline,IRQ 130/131active,0TPU errors).Q4_0 + DSpark-Q8_0(OPENBUENOS_EDGETPU_MAX_M=1,-c 16384):13.02 pp / 6.50 tg t/s(w_misses=0, w_evict=0, pack_us=0).