Repository navigation
feat(tools): ggml_freesilicon.h zero-copy tensor-view adapter example for llama.cpp (#16) - #28
Merged
Conversation
Validate every ggml tensor view before narrowing ne[] to uint32: buffer lifetime/ownership, dims in [1,UINT32_MAX], exact contiguous strides (transposed rejected), quantized block alignment, overflow- checked byte span versus backing, and base alignment. Replace std::vector with calloc in graph plan/compute (-fno-exceptions safe), harden example mock arithmetic, guard fs_buffer_alloc alignment overflow, and add adversarial hardening tests with descriptor fuzz.
Contributor
Author
Adversarial Hardening & Public-Roads Audit Receipt (
|
# Conflicts: # CMakeLists.txt # Makefile
# Conflicts: # src/fs_dmabuf.cpp
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 #16.
Summary
tools/ggml_zerocopy_example.cpp): demonstrates binding externalggml-style tensor descriptors toggml_freesilicon.hwith zero vendoredllama.cpp/ggmlheaders.fs_dmabuf_reconcile()across GPU+TPU+CPU (align=128,stride=64,LINEAR), verifies explicit tiled-vs-linear mismatch rejection (layout_mismatch), and runs prefillMUL_MATon GPU sharing onefs_dmabufbacking with decodeMUL_MATview[K,1]on TPU withfallback_copies == 0.Makefile(make verify) andCMakeLists.txt(ctest).Verification
make clean && make verify: PASS (0 warnings under-std=c11/-std=c++17 -Wall -Wextra -Werror, clean-room audit 0 errors,zero_copy_handoffs=2 fallback_copies=0).--self-test/--json): PASS.