rpc : add SUPPORTS_OP command (#32532)
* rpc : add SUPPORTS_OP command
The RPC device used to report every op as supported, so the scheduler
and llama's fused-op probes could pick ops the remote backend cannot
run. One case is flash attention over K/V rows on Vulkan.
Add RPC_CMD_SUPPORTS_OP, which takes a serialized graph in the same
format as GRAPH_COMPUTE and returns one support flag per node.
On the client, answers are cached per device under two keys:
- exact: op, op params, types and the ne/nb of the op and its srcs
- coarse: op, op params and types only, AND-ed over all nodes that
share it. It answers shapes that were not seen during reserve,
e.g. a different n_kv or n_tokens at inference.
Ops not found in either cache are queried one at a time.
Add an optional ggml_backend_dev_graph_preprocess proc address and
call it from llama_context::graph_reserve(), so the RPC backend sends
each reserve graph in a single round trip instead of one per node.
Testing done:
`test-llama-archs` passes with an RPC server running each of CUDA,
Vulkan and Metal
Co-authored-by: Kevin Hopper <no-reply@maestro.press>
Co-authored-by: ZihaoMu <zmu@amd.com>
Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com>
* address review comments
* remove coarse cache
---------
Co-authored-by: Kevin Hopper <no-reply@maestro.press>
Co-authored-by: ZihaoMu <zmu@amd.com>
Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com>