You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contribute/source/plugin/wasi_nn.md
+188-2Lines changed: 188 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The WASI-NN plug-in is a proposed WebAssembly System Interface (WASI) API for ma
8
8
9
9
## Prerequisites
10
10
11
-
Currently, WasmEdge used OpenVINO™or PyTorch as the WASI-NN backend implementation. For using WASI-NN on WasmEdge, you need to install [OpenVINO™](https://docs.openvino.ai/2023.0/openvino_docs_install_guides_installing_openvino_apt.html)(2023) or [PyTorch 1.8.2 LTS](https://pytorch.org/get-started/locally/) for the backend.
11
+
Currently, WasmEdge used OpenVINO™, PyTorch, TensorFlow Lite, or llama.cpp as the WASI-NN backend implementation. For using WASI-NN on WasmEdge, you need to install [OpenVINO™](https://docs.openvino.ai/2023.0/openvino_docs_install_guides_installing_openvino_apt.html)(2023), [TensorFlow Lite](https://www.tensorflow.org/install/lang_c), or [PyTorch 1.8.2 LTS](https://pytorch.org/get-started/locally/) for the backend.
12
12
13
13
By default, we don't enable any WASI-NN backend in WasmEdge. Therefore developers should [build the WasmEdge from source](../os/linux.md) with the cmake option `WASMEDGE_PLUGIN_WASI_NN_BACKEND` to enable the backends.
14
14
@@ -128,4 +128,190 @@ Or set the environment variable `export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH
128
128
We also provided the `darwin_x86_64`, `darwin_arm64`, and `manylinux_aarch64` versions of the TensorFlow-Lite pre-built shared libraries.
129
129
:::
130
130
131
-
For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_nn).
131
+
For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_nn).
132
+
133
+
## Build WasmEdge with WASI-NN llama.cpp Backend
134
+
135
+
You don't need to install any llama.cpp libraries. WasmEdge will download it during the building period.
136
+
137
+
Due to the acceleration frameworks being various, you will need to use different compilation options to build this plugin. Please make sure you are following the same OS section to do this.
138
+
139
+
### macOS
140
+
141
+
#### Intel Model
142
+
143
+
If you are using the Intel Model macOS, we won't enable any acceleration framework. It is a pure CPU mode plugin.
# For the WASI-NN plugin, you should install this project.
294
+
cmake --install build
295
+
```
296
+
297
+
### Appendix
298
+
299
+
<!-- prettier-ignore -->
300
+
:::note
301
+
If the built `wasmedge` CLI tool cannot find the WASI-NN plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/` or the built plugin path `build/plugins/wasi_nn/`) to try to fix this issue.
302
+
:::
303
+
304
+
<!-- prettier-ignore -->
305
+
:::note
306
+
We also provided the pre-built ggml plugins on the following platforms:
307
+
- darwin\_x86\_64: Intel Model macOS
308
+
- darwin\_arm64: Apple Silicon Model macOS
309
+
- ubuntu20.04\_x86\_64: x86\_64 Linux (the glibc is using Ubuntu20.04 one)
310
+
- ubuntu20.04\_aarch64: aarch64 Linux (the glibc is using Ubuntu20.04 one)
311
+
- ubuntu20.04\_blas\_x86\_64: x86\_64 Linux with OpenBLAS support (the glibc is using Ubuntu20.04 one)
312
+
- ubuntu20.04\_blas\_aarch64: aarch64 Linux with OpenBLAS support (the glibc is using Ubuntu20.04 one)
313
+
- ubuntu20.04\_cuda\_x86\_64: x86\_64 Linux with CUDA 12 support (the glibc is using Ubuntu20.04 one)
314
+
- ubuntu20.04\_cuda\_aarch64: aarch64 Linux with CUDA 11 support (the glibc is using Ubuntu20.04 one), for NVIDIA Jetson AGX Orin
315
+
- manylinux2014\_x86\_64: x86\_64 Linux (the glibc is using CentOS 7 one)
316
+
- manylinux2014\_aarch64: aarch64 Linux (the glibc is using CentOS 7 one)
0 commit comments