From 93988dbc54afa90d3e8480481c17d4008887e4bb Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Thu, 16 Jul 2026 19:00:14 +0800 Subject: [PATCH] use same rpc tensor name size limit as llama.cpp, from 128 to 64 (breaking change for RPC) (+1 squashed commits) Squashed commits: [aba1dd4f6] use same rpc tensor name size limit as llama.cpp, from 128 to 64 (breaking change for RPC) --- ggml/src/ggml-rpc/ggml-rpc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml-rpc/ggml-rpc.cpp b/ggml/src/ggml-rpc/ggml-rpc.cpp index d38057721..bd99f3d20 100644 --- a/ggml/src/ggml-rpc/ggml-rpc.cpp +++ b/ggml/src/ggml-rpc/ggml-rpc.cpp @@ -31,6 +31,8 @@ namespace fs = std::filesystem; // all RPC structures must be packed #pragma pack(push, 1) +static constexpr size_t RPC_TENSOR_NAME_SIZE = 64; + // ggml_tensor is serialized into rpc_tensor struct rpc_tensor { uint64_t id; @@ -45,11 +47,12 @@ struct rpc_tensor { uint64_t view_src; uint64_t view_offs; uint64_t data; - char name[GGML_MAX_NAME]; + char name[RPC_TENSOR_NAME_SIZE]; char padding[4]; }; +static_assert(RPC_TENSOR_NAME_SIZE == 64, "rpc_tensor name size must match the upstream RPC wire ABI"); static_assert(sizeof(rpc_tensor) % 8 == 0, "rpc_tensor size must be multiple of 8"); // RPC commands @@ -441,7 +444,7 @@ static rpc_tensor serialize_tensor(const ggml_tensor * tensor) { memset(result.name, 0, sizeof(result.name)); memset(result.padding, 0, sizeof(result.padding)); - snprintf(result.name, GGML_MAX_NAME, "%s", tensor->name); + snprintf(result.name, sizeof(result.name), "%s", tensor->name); return result; }