Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-openvino/model-cache.h # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-openvino / model-cache.h` 57 lines ยท 2769 bytes Raw Blame History 1 #pragma once 2 3 // Compiled blobs include weights. Cache-only execution skips weight uploads and graph compilation. 4 5 #include "ggml.h" 6 7 #include 8 #include 9 #include 10 11 bool ggml_openvino_model_cache_only(); 12 void ggml_openvino_model_cache_init(); 13 14 struct ggml_openvino_source_mapping { 15 uintptr_t begin; 16 uintptr_t end; 17 uint64_t offset; 18 uint64_t identity; 19 }; 20 21 // Identify mmap weights without reading their pages. Cache mappings for one buffer lifetime. 22 uint64_t ggml_openvino_source_fingerprint(const void * data, size_t size, std::vector & mappings); 23 uint64_t ggml_backend_openvino_weight_fingerprint(const ggml_tensor * tensor); 24 25 // Returns the compiled-model cache directory, or empty if unset. 26 std::string ggml_openvino_model_cache_dir(); 27 std::string ggml_openvino_model_cache_temp_path(const std::string & path); 28 29 // Hash graph structure, source weight identities, configuration, and OpenVINO version. 30 uint64_t ggml_openvino_model_fingerprint(const ggml_cgraph * cgraph, 31 const std::string & device, 32 bool fa, 33 const int32_t * rope_params, 34 int rope_len, 35 uint64_t extra_cfg, 36 const std::string & graph_signature); 37 38 // Path to the compiled-blob file for a fingerprint (/.blob). 39 std::string ggml_openvino_model_cache_blob_path(const std::string & dir, uint64_t fingerprint); 40 41 // Path to the sidecar manifest (/.manifest) holding the per-weight 42 // fingerprints, used to re-verify a hit before trusting the blob. 43 std::string ggml_openvino_model_cache_manifest_path(const std::string & dir, uint64_t fingerprint); 44 45 // Record weight metadata and source identities. Returns false on I/O error. 46 bool ggml_openvino_model_cache_write_manifest(const std::string & path, 47 const ggml_cgraph * cgraph, 48 uint64_t fingerprint, 49 const std::vector & inputs, 50 const std::vector & outputs); 51 52 // Require all weight metadata and source identities to match the manifest. 53 bool ggml_openvino_model_cache_verify_manifest(const std::string & path, 54 const ggml_cgraph * cgraph, 55 uint64_t fingerprint, 56 std::vector & inputs, 57 std::vector & outputs);