forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RPC mode allows using another Wasi-NN instance that is running on a remote WasmEdge instance, via `ssh -R remote.sock:local.sock`. An example usecase is to allow Linux VM (e.g., Lima) guest to use the host GPU. The gRPC proto can be repurposed for non-WASM applications as well. - - - Build ===== Set `WASMEDGE_BUILD_WASI_NN_RPC` to `ON`. Enabled by default when gRPC (libgrpc++-dev) is installed. Usage ===== Host 1 (rpc server / ssh client, e.g., Lima host with physical GPU) ----- ``` wasi_nn_rpcserver \ --nn-rpc-uri unix:///$HOME/nn_server.sock \ --nn-preload default:GGML:AUTO:llama-2-7b-chat.Q5_K_M.gguf ssh \ -R /tmp/nn_client.sock:$HOME/nn_server.sock \ host2 ``` Host 2 (rpc client / ssh server, e.g., Lima guest) ----- ``` wasmedge \ --nn-rpc-uri unix:///tmp/nn_client.sock \ wasmedge-ggml-llama-interactive.wasm \ default "1 + 1 = ?" ``` See <https://github.com/second-state/WasmEdge-WASINN-examples/tree/master/wasmedge-ggml-llama-interactive> for how to obtain `llama-2-7b-chat.Q5_K_M.gguf` and `wasmedge-ggml-llama-interactive.wasm`. Signed-off-by: Akihiro Suda <[email protected]>
- Loading branch information
1 parent
e296dfc
commit e78fedf
Showing
25 changed files
with
1,135 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
namespace WasmEdge { | ||
namespace Driver { | ||
|
||
int WasiNNRPCServer(int Argc, const char *Argv[]) noexcept; | ||
|
||
} // namespace Driver | ||
} // namespace WasmEdge |
Oops, something went wrong.