github ggml-org/llama.cpp b12658

latest release: b12659
pre-release42 minutes ago
Details

rpc : typed request helpers and a single validation step on the server (#32651)

  • rpc : typed request helpers and a single validation step on the server

Client and server share one table (rpc_msg_types) that maps each
fixed-size command to its request and response structs. The client sends
them with dispatcher->call() and call_async(), the server serves
them with rpc_serve(), so the per-command code in rpc_serve_client
and at the call sites is gone and a wrong struct for a command does not
compile. SET_TENSOR, SET_TENSOR_2D and GRAPH_COMPUTE get header structs,
written with rpc_writer and parsed with a bounds-checked rpc_reader. The
wire format is unchanged.

Validation of client data is now in one place:

  • deserialize_tensor rejects what ggml_new_tensor would assert on (op
    range, ne[0] not a multiple of the block size, element count overflow)
    and computes the tensor size without overflow before the buffer check
  • rpc_check_region replaces the per-handler bounds checks and checks the
    request against the tensor size, which ggml_backend_tensor_set/get/memset
    assert on, so an in-buffer but out-of-tensor request no longer aborts
  • graph_compute builds the graph in one pass over the tensors, which the
    client sends in topological order: no recursion, and unknown or
    duplicate ids, duplicate nodes, sources sent after their users, compute
    nodes with unallocated operands and views outside their view_src buffer
    are rejected; a tensor may be its own source (ggml_cast)
  • GET_ALLOC_SIZE fails if a source tensor is invalid
  • a client-sized allocation that fails closes the connection instead of
    terminating the server
  • rpc : trim comments

Website:

Attestations:

macOS/iOS:

Linux:

Android:

Windows:

openEuler:

  • DISABLED
  • openEuler x86 (310p)
  • openEuler x86 (910b, ACL Graph)
  • openEuler aarch64 (310p)
  • openEuler aarch64 (910b, ACL Graph)

UI:

Don't miss a new llama.cpp release

NewReleases is sending notifications on new releases.