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-virtgpu/backend/shared/apir_cs_rpc.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-virtgpu / backend / shared / apir_cs_rpc.h` 58 lines ยท 2087 bytes Raw Blame History 1 #pragma once 2 3 // clang-format off 4 #include "ggml.h" 5 #include "ggml-backend-impl.h" 6 7 #include 8 #include 9 #include 10 #include 11 // clang-format on 12 13 // ggml_tensor is serialized into apir_rpc_tensor 14 struct apir_rpc_tensor { 15 uint64_t id; 16 uint32_t type; 17 uint64_t buffer; 18 uint32_t ne[GGML_MAX_DIMS]; 19 uint32_t nb[GGML_MAX_DIMS]; 20 uint32_t op; 21 int32_t op_params[GGML_MAX_OP_PARAMS / sizeof(int32_t)]; 22 int32_t flags; 23 uint64_t src[GGML_MAX_SRC]; 24 uint64_t view_src; 25 uint64_t view_offs; 26 uint64_t data; 27 char name[GGML_MAX_NAME]; 28 29 char padding[4]; 30 }; 31 32 /* frontend */ 33 34 apir_rpc_tensor apir_serialize_tensor(const ggml_tensor * tensor); 35 36 void apir_serialize_graph(const ggml_cgraph * cgraph, std::vector & output); 37 38 /* backend */ 39 40 void apir_track_backend_buffer(ggml_backend_buffer_t buffer); 41 bool apir_untrack_backend_buffer(ggml_backend_buffer_t buffer); 42 std::unordered_set apir_get_track_backend_buffers(); 43 44 void apir_add_tensor(ggml_tensor * tensor, 45 std::vector & tensors, 46 std::unordered_set & visited); 47 48 ggml_tensor * apir_deserialize_tensor(ggml_context * ctx, const apir_rpc_tensor * tensor); 49 50 ggml_tensor * apir_create_node(uint64_t id, 51 ggml_context * ctx, 52 const std::unordered_map & tensor_ptrs, 53 std::unordered_map & tensor_map); 54 55 ggml_cgraph * apir_deserialize_graph(uint32_t n_nodes, 56 uint32_t n_tensors, 57 const apir_rpc_tensor * tensors, 58 const uint64_t * nodes);