Skip to content

Commit 0ed52dd

Browse files
authored
[Docs] Add MLX backend (#251)
* [Docs] Add MLX backend Signed-off-by: grorge <g97116@yahoo.com> * [Docs] fix mac dynamic library name Signed-off-by: grorge <g97116@yahoo.com> --------- Signed-off-by: grorge <g97116@yahoo.com>
1 parent 9e209a7 commit 0ed52dd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/contribute/source/plugin/wasi_nn.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,26 @@ If the built `wasmedge` CLI tool cannot find the WASI-NN plug-in, you can set th
452452
:::
453453

454454
Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-NN with ChatTTS backend plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiNN.so` after installation.
455+
456+
457+
## Build WasmEdge with WASI-NN MLX Backend
458+
459+
You can directly build and install WasmEdge from source or custom install mlx and set `CMAKE_INSTALL_PREFIX` variable.
460+
461+
Build and install WasmEdge from source:
462+
``` bash
463+
cd <path/to/your/wasmedge/source/folder>
464+
465+
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_WASI_NN_BACKEND="mlx"
466+
cmake --build build
467+
468+
# For the WASI-NN plugin, you should install this project.
469+
cmake --install build
470+
```
471+
472+
<!-- prettier-ignore -->
473+
:::note
474+
If the built `wasmedge` CLI tool cannot find the WASI-NN plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasi_nn/`) to try to fix this issue.
475+
:::
476+
477+
Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-NN with MLX backend plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiNN.dylib` after installation.

0 commit comments

Comments
 (0)