wasi-nn: Add external delegation to support several NPU/GPU (#2162)

Add VX delegation as an external delegation of TFLite, so that several NPU/GPU
(from VeriSilicon, NXP, Amlogic) can be controlled via WASI-NN.

Test Code can work with the X86 simulator.
This commit is contained in:
ayakoakasaka
2023-05-05 10:29:36 +02:00
committed by GitHub
parent 5a23ae465c
commit 89be5622a5
4 changed files with 159 additions and 3 deletions

View File

@ -24,6 +24,7 @@ Build the runtime image for your execution target type.
`EXECUTION_TYPE` can be:
* `cpu`
* `nvidia-gpu`
* `vx-delegate`
```
EXECUTION_TYPE=cpu
@ -71,6 +72,18 @@ docker run \
/assets/test_tensorflow.wasm
```
* vx-delegate for NPU (x86 simulater)
```
docker run \
-v $PWD/core/iwasm/libraries/wasi-nn/test:/assets wasi-nn-vx-delegate \
--dir=/assets \
--env="TARGET=gpu" \
/assets/test_tensorflow.wasm
```
Requirements:
* [NVIDIA docker](https://github.com/NVIDIA/nvidia-docker).