Skip to content

Commit e3811ce

Browse files
authored
Update llm inference docs (WasmEdge#187)
Signed-off-by: alabulei1 <vivian.xiage@gmail.com>
1 parent 0a3accf commit e3811ce

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

docs/start/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ If CPU is the only available hardware on your machine, the installer will instal
164164
apt update && apt install -y libopenblas-dev # You may need sudo if the user is not root.
165165
```
166166

167-
Then, go to the [Llama2 inference in Rust chapter](../develop/rust/wasinn/llm-inference) to see how to run AI inference with llama2 series of models.
167+
Then, go to the [Llama2 inference in Rust chapter](../develop/rust/wasinn/llm_inference) to see how to run AI inference with llama2 series of models.
168168

169169
#### WASI-NN plug-in with PyTorch backend
170170

i18n/zh/docusaurus-plugin-content-docs/current/start/install.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,26 @@ sudo cp libwasmedge_rustls.so /usr/local/lib/wasmedge/
145145

146146
WasmEdge 支持多种 `WASI-NN` 的后端。
147147

148+
- [ggml 后端](#wasi-nn-plug-in-with-pytorch-backend):支持 `Ubuntu 20.04 以上`、macOS (M1 和 M2) 和 `GPU (NVIDIA)`
148149
- [PyTorch 后端](#wasi-nn-plug-in-with-pytorch-backend):支持 `Ubuntu 20.04 以上``manylinux2014_x86_64`
149150
- [OpenVINO™ 后端](#wasi-nn-plug-in-with-openvino-backend):支持 `Ubuntu 20.04 以上`
150151
- [TensorFlow-Lite 后端](#wasi-nn-plug-in-with-tensorflow-lite-backend):支持 `Ubuntu 20.04 以上``manylinux2014_x86_64``manylinux2014_aarch64`
151152

152153
注意这些后端是互斥的。开发者只能选择并安装一个后端用于 `WASI-NN` 插件。
153154

155+
#### 带有 ggml 后端的 WASI-NN 插件
156+
157+
`WASI-NN` 插件与 `ggml` 后端允许 WasmEdge 应用执行 Llama 2 系列大模型的推理。要在 Linux 上安装带有 `WASI-NN ggml backend` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-ggml` 参数。
158+
159+
注意,WasmEdge 0.13.5 的安装程序将自动检测 CUDA。如果检测到 CUDA,安装程序将始终尝试安装支持 CUDA 的插件版本。
160+
161+
如果您的机器上只有CPU可用,那么需要安装 OpenBLAS 版本的插件。
162+
163+
```
164+
apt update && apt install -y libopenblas-dev # You may need sudo if the user is not root.
165+
```
166+
安装完成后,请在 [Rust 中的大模型推理](../develop/rust/wasinn/llm_inference) 章节中了解如何使用 `ggml` 运行 LLM 推理程序。
167+
154168
#### 带有 PyTorch 后端的 WASI-NN 插件
155169

156170
`WASI-NN` 插件与 `PyTorch` 后端允许 WasmEdge 应用执行 `PyTorch` 模型推理。要在 Linux 上安装带有 `WASI-NN PyTorch 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-pytorch` 参数。
@@ -175,11 +189,11 @@ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/libtorch/lib
175189
对于其他系统,WasmEdge 安装程序将安装 `manylinux2014` 版本,并且你应该使用不带 `cxx11-abi``libtorch`
176190
:::
177191

178-
安装完成后,请在 [Rust 中的 WASI-NN PyTorch 后端](../develop/rust/wasinn/pytorch) 章节中了解如何使用 `PyTorch` 运行人工智能推断
192+
安装完成后,请在 [Rust 中的 WASI-NN PyTorch 后端](../develop/rust/wasinn/pytorch) 章节中了解如何使用 `PyTorch` 运行人工智能推理
179193

180194
#### 带有 OpenVINO 后端的 WASI-NN 插件
181195

182-
`WASI-NN` 插件与 `OpenVINO™` 后端允许 WasmEdge 应用执行 `OpenVINO™` 模型推断。要在 Linux 上安装带有 `WASI-NN OpenVINO™ 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-openvino` 参数。
196+
`WASI-NN` 插件与 `OpenVINO™` 后端允许 WasmEdge 应用执行 `OpenVINO™` 模型推理。要在 Linux 上安装带有 `WASI-NN OpenVINO™ 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-openvino` 参数。
183197

184198
`WASI-NN` 插件带有 `OpenVINO™` 后端依赖于 `OpenVINO™` C 库来进行人工智能/机器学习计算。[OpenVINO™](https://docs.openvino.ai/2023.0/openvino_docs_install_guides_installing_openvino_apt.html)(2023)依赖项。以下说明适用于 Ubuntu 20.04 及以上版本。
185199

@@ -192,11 +206,11 @@ sudo apt-get -y install openvino
192206
ldconfig
193207
```
194208

195-
安装完成后,请在 [Rust 中的 WASI-NN OpenVINO™ 后端](../develop/rust/wasinn/openvino) 章节查看如何使用 `OpenVINO™` 运行人工智能推断
209+
安装完成后,请在 [Rust 中的 WASI-NN OpenVINO™ 后端](../develop/rust/wasinn/openvino) 章节查看如何使用 `OpenVINO™` 运行人工智能推理
196210

197211
#### 带有 TensorFlow-Lite 后端的 WASI-NN 插件
198212

199-
`WASI-NN` 插件与 `Tensorflow-Lite` 后端允许 WasmEdge 应用执行 `Tensorflow-Lite` 模型推断。要在 Linux 上安装带有 `WASI-NN Tensorflow-Lite 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-tensorflowlite` 参数。
213+
`WASI-NN` 插件与 `Tensorflow-Lite` 后端允许 WasmEdge 应用执行 `Tensorflow-Lite` 模型推理。要在 Linux 上安装带有 `WASI-NN Tensorflow-Lite 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-tensorflowlite` 参数。
200214

201215
`WASI-NN` 插件带有 `Tensorflow-Lite` 后端依赖于 `libtensorflowlite_c` 共享库来进行人工智能/机器学习计算,并将由安装程序自动安装。
202216

@@ -205,7 +219,7 @@ ldconfig
205219
如果安装了该插件,但并非使用上面的方式,可以参考[此处](#tensorflow-lite-dependencies)安装依赖项。
206220
:::note
207221

208-
安装完成后,查看 [Rust 中的 WASI-NN TensorFlow-Lite 后端](../develop/rust/wasinn/tensorflow_lite) 章节了解如何使用 `TensorFlow-Lite` 运行人工智能推断
222+
安装完成后,查看 [Rust 中的 WASI-NN TensorFlow-Lite 后端](../develop/rust/wasinn/tensorflow_lite) 章节了解如何使用 `TensorFlow-Lite` 运行人工智能推理
209223

210224
### WASI-Crypto 插件
211225

@@ -221,7 +235,7 @@ wasmEdge-Image 插件可以帮助开发人员加载和解码 JPEG 和 PNG 图像
221235

222236
### WasmEdge TensorFlow 插件
223237

224-
WasmEdge-TensorFlow 插件可以帮助开发人员执行与 Python 中相似的 `TensorFlow` 模型推断。要安装此插件,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasmedge_tensorflow` 参数。
238+
WasmEdge-TensorFlow 插件可以帮助开发人员执行与 Python 中相似的 `TensorFlow` 模型推理。要安装此插件,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasmedge_tensorflow` 参数。
225239

226240
WasmEdge-TensorFlow 插件依赖于 `libtensorflow_cc` 共享库。
227241

@@ -234,7 +248,7 @@ WasmEdge-TensorFlow 插件依赖于 `libtensorflow_cc` 共享库。
234248

235249
### WasmEdge TensorFlow-Lite 插件
236250

237-
wasmEdge-TensorFlowLite 插件可以帮助开发人员执行与 Python 中类似的 `TensorFlow-Lite` 模型推断。要安装此插件,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasmedge_tensorflowlite` 参数。
251+
wasmEdge-TensorFlowLite 插件可以帮助开发人员执行与 Python 中类似的 `TensorFlow-Lite` 模型推理。要安装此插件,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasmedge_tensorflowlite` 参数。
238252

239253
WasmEdge-TensorflowLite 插件依赖于 `libtensorflowlite_c` 共享库来执行人工智能/机器学习计算(由安装程序自动安装)。
240254

@@ -261,7 +275,7 @@ WasmEdge 图像扩展(在 `0.13.0 `后被 [WasmEdge-Image 插件](#wasmedge-im
261275

262276
### WasmEdge Tensorflow 和 TensorFlow-Lite 带有 CLI 工具的扩展
263277

264-
WasmEdge Tensorflow 扩展和 CLI 工具(在 `0.13.0` 后被 [WasmEdge-Tensorflow 插件](#wasmedge-tensorflow-plug-in)[WasmEdge-TensorflowLite 插件](#wasmedge-tensorflow-lite-plug-in) 取代)可以帮助开发者执行类似于 Python 中的 `TensorFlow``TensorFlow-Lite` 模型推断。要安装此扩展,请在[运行安装命令](#generic-linux-and-macos)时使用 `-e tensorflow` 参数。
278+
WasmEdge Tensorflow 扩展和 CLI 工具(在 `0.13.0` 后被 [WasmEdge-Tensorflow 插件](#wasmedge-tensorflow-plug-in)[WasmEdge-TensorflowLite 插件](#wasmedge-tensorflow-lite-plug-in) 取代)可以帮助开发者执行类似于 Python 中的 `TensorFlow``TensorFlow-Lite` 模型推理。要安装此扩展,请在[运行安装命令](#generic-linux-and-macos)时使用 `-e tensorflow` 参数。
265279

266280
## 卸载
267281

0 commit comments

Comments
 (0)