Repository navigation
b12658
Pre-release
Pre-release
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:
- macOS Apple Silicon (arm64)
- macOS Apple Silicon (arm64, KleidiAI enabled) DISABLED
- macOS Intel (x64)
- iOS XCFramework
Linux:
- Ubuntu x64 (CPU)
- Ubuntu arm64 (CPU)
- Ubuntu 24.04 s390x (CPU)
- Ubuntu 26.04 s390x (CPU)
- Ubuntu 26.04 s390x (zDNN)
- Ubuntu x64 (Vulkan)
- Ubuntu arm64 (Vulkan)
- Ubuntu x64 (CUDA 12) - CUDA 12.8 libraries
- Ubuntu x64 (CUDA 13) - CUDA 13.5 libraries
- Ubuntu arm64 (CUDA 13) - CUDA 13.5 libraries
- Ubuntu x64 (ROCm 10.0)
- Ubuntu x64 (OpenVINO)
- Ubuntu x64 (SYCL FP32)
- Ubuntu x64 (SYCL FP16)
- Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide
Android:
Windows:
- Windows x64 (CPU)
- Windows arm64 (CPU)
- Windows arm64 (OpenCL Adreno)
- Windows x64 (CUDA 12) - CUDA 12.4 DLLs
- Windows x64 (CUDA 13) - CUDA 13.5 DLLs
- Windows arm64 (CUDA 13) - CUDA 13.5 DLLs
- Windows x64 (Vulkan)
- Windows arm64 (Vulkan)
- Windows x64 (OpenVINO)
- Windows x64 (SYCL)
- Windows x64 (ROCm 10.0)
openEuler:
- DISABLED
- openEuler x86 (310p)
- openEuler x86 (910b, ACL Graph)
- openEuler aarch64 (310p)
- openEuler aarch64 (910b, ACL Graph)
UI: