@@ -10,20 +10,21 @@ This can be used for distributed LLM inference with `llama.cpp` in the following
10
10
11
11
``` mermaid
12
12
flowchart TD
13
- rpcb--- |TCP|srva
14
- rpcb--- |TCP|srvb
15
- rpcb-.-|TCP|srvn
13
+ rpcb<--> |TCP|srva
14
+ rpcb<--> |TCP|srvb
15
+ rpcb< -.-> |TCP|srvn
16
16
subgraph hostn[Host N]
17
- srvn[rpc-server]-.-backend3["Backend (CUDA,Metal,etc.)"]
17
+ srvn[rpc-server]< -.-> backend3["Backend (CUDA,Metal,etc.)"]
18
18
end
19
19
subgraph hostb[Host B]
20
- srvb[rpc-server]--- backend2["Backend (CUDA,Metal,etc.)"]
20
+ srvb[rpc-server]<--> backend2["Backend (CUDA,Metal,etc.)"]
21
21
end
22
22
subgraph hosta[Host A]
23
- srva[rpc-server]--- backend["Backend (CUDA,Metal,etc.)"]
23
+ srva[rpc-server]<--> backend["Backend (CUDA,Metal,etc.)"]
24
24
end
25
25
subgraph host[Main Host]
26
- ggml[llama.cpp]---rpcb[RPC backend]
26
+ local["Backend (CUDA,Metal,etc.)"]<-->ggml[llama-cli]
27
+ ggml[llama-cli]<-->rpcb[RPC backend]
27
28
end
28
29
style hostn stroke:#66,stroke-width:2px,stroke-dasharray: 5 5
29
30
```
@@ -62,17 +63,11 @@ $ CUDA_VISIBLE_DEVICES=0 bin/rpc-server -p 50052
62
63
This way you can run multiple ` rpc-server ` instances on the same host, each with a different CUDA device.
63
64
64
65
65
- On the main host build ` llama.cpp ` only with ` -DGGML_RPC=ON ` :
66
-
67
- ``` bash
68
- mkdir build-rpc
69
- cd build-rpc
70
- cmake .. -DGGML_RPC=ON
71
- cmake --build . --config Release
72
- ```
73
-
74
- Finally, use the ` --rpc ` option to specify the host and port of each ` rpc-server ` :
66
+ On the main host build ` llama.cpp ` for the local backend and add ` -DGGML_RPC=ON ` to the build options.
67
+ Finally, when running ` llama-cli ` , use the ` --rpc ` option to specify the host and port of each ` rpc-server ` :
75
68
76
69
``` bash
77
70
$ bin/llama-cli -m ../models/tinyllama-1b/ggml-model-f16.gguf -p " Hello, my name is" --repeat-penalty 1.0 -n 64 --rpc 192.168.88.10:50052,192.168.88.11:50052 -ngl 99
78
71
```
72
+
73
+ This way you can offload model layers to both local and remote devices.
0 commit comments