Skip to content

Commit c299a92

Browse files
authored
binaries : Improve rpc-server and export-graph-ops names. (ggml-org#25045)
Tests are generally prefixed with -test, so rename export-graph-ops accordingly. rpc-server is probably too generic a name for /usr/bin. Because it should work with any ggml application, it is renamed to ggml-rpc-server.
1 parent 0275c0f commit c299a92

6 files changed

Lines changed: 25 additions & 25 deletions

File tree

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ To protect sensitive data from potential leaks or unauthorized access, it is cru
8080
### Untrusted environments or networks
8181

8282
If you can't run your models in a secure and isolated environment or if it must be exposed to an untrusted network, make sure to take the following security precautions:
83-
* Do not use the RPC backend, [rpc-server](https://github.com/ggml-org/llama.cpp/tree/master/tools/rpc) and [llama-server](https://github.com/ggml-org/llama.cpp/tree/master/tools/server) functionality (see https://github.com/ggml-org/llama.cpp/pull/13061).
83+
* Do not use the RPC backend, [ggml-rpc-server](https://github.com/ggml-org/llama.cpp/tree/master/tools/rpc) and [llama-server](https://github.com/ggml-org/llama.cpp/tree/master/tools/server) functionality (see https://github.com/ggml-org/llama.cpp/pull/13061).
8484
* Confirm the hash of any downloaded artifact (e.g. pre-trained model weights) matches a known-good value.
8585
* Encrypt your data if sending it over the network.
8686

tests/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ target_link_libraries(${TEST_TARGET} PRIVATE llama)
302302
llama_build_and_test(test-alloc.cpp)
303303
target_include_directories(test-alloc PRIVATE ${PROJECT_SOURCE_DIR}/ggml/src)
304304

305-
llama_build(export-graph-ops.cpp)
306-
target_include_directories(export-graph-ops PRIVATE ${PROJECT_SOURCE_DIR}/ggml/src)
305+
llama_build(test-export-graph-ops.cpp)
306+
target_include_directories(test-export-graph-ops PRIVATE ${PROJECT_SOURCE_DIR}/ggml/src)
307307
if (TARGET gguf-model-data)
308-
target_link_libraries(export-graph-ops PRIVATE gguf-model-data)
309-
target_compile_definitions(export-graph-ops PRIVATE LLAMA_HF_FETCH)
308+
target_link_libraries(test-export-graph-ops PRIVATE gguf-model-data)
309+
target_compile_definitions(test-export-graph-ops PRIVATE LLAMA_HF_FETCH)
310310
endif()

tests/test-backend-ops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9943,7 +9943,7 @@ static void usage(char ** argv) {
99439943
printf(" --output specifies output format (default: console, options: console, sql, csv)\n");
99449944
printf(" --list-ops lists all available GGML operations\n");
99459945
printf(" --show-coverage shows test coverage\n");
9946-
printf(" --test-file reads test operators from a test file generated by llama-export-graph-ops\n");
9946+
printf(" --test-file reads test operators from a test file generated by test-export-graph-ops\n");
99479947
printf(" -j <n> runs tests using <n> parallel worker threads (default: 1, test mode only)\n");
99489948
}
99499949

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int main(int argc, char ** argv) {
185185
return 1;
186186
}
187187
#else
188-
LOG_ERR("export-graph-ops compiled without HF fetch support\n");
188+
LOG_ERR("test-export-graph-ops compiled without HF fetch support\n");
189189
return 1;
190190
#endif
191191
}

tools/rpc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(TARGET rpc-server)
1+
set(TARGET ggml-rpc-server)
22
add_executable(${TARGET} rpc-server.cpp)
33
target_link_libraries(${TARGET} PRIVATE ggml)
44
target_compile_features(${TARGET} PRIVATE cxx_std_17)

tools/rpc/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
> This example and the RPC backend are currently in a proof-of-concept development stage. As such, the functionality is fragile and
55
> insecure. **Never run the RPC server on an open network or in a sensitive environment!**
66
7-
The `rpc-server` allows exposing `ggml` devices on a remote host.
8-
The RPC backend communicates with one or several instances of `rpc-server` and offloads computations to them.
7+
The `ggml-rpc-server` allows exposing `ggml` devices on a remote host.
8+
The RPC backend communicates with one or several instances of `ggml-rpc-server` and offloads computations to them.
99
This can be used for distributed LLM inference with `llama.cpp` in the following way:
1010

1111
```mermaid
@@ -14,15 +14,15 @@ flowchart TD
1414
rpcb<-->|TCP|srvb
1515
rpcb<-.->|TCP|srvn
1616
subgraph hostn[Host N]
17-
srvn[rpc-server]<-.->dev4["CUDA0"]
18-
srvn[rpc-server]<-.->dev5["CPU"]
17+
srvn[ggml-rpc-server]<-.->dev4["CUDA0"]
18+
srvn[ggml-rpc-server]<-.->dev5["CPU"]
1919
end
2020
subgraph hostb[Host B]
21-
srvb[rpc-server]<-->dev3["Metal"]
21+
srvb[ggml-rpc-server]<-->dev3["Metal"]
2222
end
2323
subgraph hosta[Host A]
24-
srva[rpc-server]<-->dev["CUDA0"]
25-
srva[rpc-server]<-->dev2["CUDA1"]
24+
srva[ggml-rpc-server]<-->dev["CUDA0"]
25+
srva[ggml-rpc-server]<-->dev2["CUDA1"]
2626
end
2727
subgraph host[Main Host]
2828
local["Local devices"]<-->ggml[llama-cli]
@@ -33,15 +33,15 @@ flowchart TD
3333
class local,dev,dev2,dev3,dev4,dev5 devcls
3434
```
3535

36-
By default, `rpc-server` exposes all available accelerator devices on the host.
36+
By default, `ggml-rpc-server` exposes all available accelerator devices on the host.
3737
If there are no accelerators, it exposes a single `CPU` device.
3838

3939
## Usage
4040

4141
### Remote hosts
4242

4343
On each remote host, build the backends for each accelerator by adding `-DGGML_RPC=ON` to the build options.
44-
For example, to build the `rpc-server` with support for CUDA accelerators:
44+
For example, to build the `ggml-rpc-server` with support for CUDA accelerators:
4545

4646
```bash
4747
mkdir build-rpc-cuda
@@ -50,10 +50,10 @@ cmake .. -DGGML_CUDA=ON -DGGML_RPC=ON
5050
cmake --build . --config Release
5151
```
5252

53-
When started, the `rpc-server` will detect and expose all available `CUDA` devices:
53+
When started, the `ggml-rpc-server` will detect and expose all available `CUDA` devices:
5454

5555
```bash
56-
$ bin/rpc-server
56+
$ bin/ggml-rpc-server
5757
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
5858
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
5959
ggml_cuda_init: found 1 CUDA devices:
@@ -67,14 +67,14 @@ Devices:
6767

6868
You can control the set of exposed CUDA devices with the `CUDA_VISIBLE_DEVICES` environment variable or the `--device` command line option. The following two commands have the same effect:
6969
```bash
70-
$ CUDA_VISIBLE_DEVICES=0 bin/rpc-server -p 50052
71-
$ bin/rpc-server --device CUDA0 -p 50052
70+
$ CUDA_VISIBLE_DEVICES=0 bin/ggml-rpc-server -p 50052
71+
$ bin/ggml-rpc-server --device CUDA0 -p 50052
7272
```
7373

7474
### Main host
7575

7676
On the main host build `llama.cpp` with the backends for the local devices and add `-DGGML_RPC=ON` to the build options.
77-
Finally, when running `llama-cli` or `llama-server`, use the `--rpc` option to specify the host and port of each `rpc-server`:
77+
Finally, when running `llama-cli` or `llama-server`, use the `--rpc` option to specify the host and port of each `ggml-rpc-server`:
7878

7979
```bash
8080
$ llama-cli -hf ggml-org/gemma-3-1b-it-GGUF -ngl 99 --rpc 192.168.88.10:50052,192.168.88.11:50052
@@ -90,7 +90,7 @@ This can speed up model loading significantly, especially when using large model
9090
To enable the cache, use the `-c` option:
9191

9292
```bash
93-
$ bin/rpc-server -c
93+
$ bin/ggml-rpc-server -c
9494
```
9595

9696
By default, the cache is stored in the `$HOME/.cache/llama.cpp/rpc` directory and can be controlled via the `LLAMA_CACHE` environment variable.
@@ -103,8 +103,8 @@ RDMA is enabled by default when `libibverbs` is found at build time.
103103

104104
### Troubleshooting
105105

106-
Use the `GGML_RPC_DEBUG` environment variable to enable debug messages from `rpc-server`:
106+
Use the `GGML_RPC_DEBUG` environment variable to enable debug messages from `ggml-rpc-server`:
107107
```bash
108-
$ GGML_RPC_DEBUG=1 bin/rpc-server
108+
$ GGML_RPC_DEBUG=1 bin/ggml-rpc-server
109109
```
110110

0 commit comments

Comments
 (0)