diff --git a/.github/workflows/build_openvino_mobilenet.yml b/.github/workflows/build_openvino_mobilenet.yml index 6fc0397..f0769fe 100644 --- a/.github/workflows/build_openvino_mobilenet.yml +++ b/.github/workflows/build_openvino_mobilenet.yml @@ -1,7 +1,10 @@ name: OpenVINO Mobilenet Example on: + schedule: + - cron: "0 0 * * *" push: + branches: [master] paths: - ".github/workflows/build_openvino_mobilenet.yml" - "openvino-mobilenet-raw/**" @@ -9,8 +12,11 @@ on: - "scripts/install_openvino.sh" pull_request: branches: [master] - paths-ignore: - - "**/*.md" + paths: + - ".github/workflows/build_openvino_mobilenet.yml" + - "openvino-mobilenet-raw/**" + - "openvino-mobilenet-image/**" + - "scripts/install_openvino.sh" env: CARGO_TERM_COLOR: always @@ -50,14 +56,11 @@ jobs: CMAKE_BUILD_TYPE: "Release" VERSION: "0.13.4" run: | - ldconfig curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $VERSION -p /usr/local --plugins wasi_nn-openvino - ldconfig - name: Build and run openvino-mobilenet-raw working-directory: openvino-mobilenet-raw run: | - ldconfig bash download_mobilenet.sh cd rust cargo build --target wasm32-wasi --release @@ -67,7 +70,6 @@ jobs: - name: Build and run openvino-mobilenet-image working-directory: openvino-mobilenet-image run: | - ldconfig bash download_mobilenet.sh cd rust cargo build --target wasm32-wasi --release diff --git a/.github/workflows/build_openvino_road_seg_adas.yml b/.github/workflows/build_openvino_road_seg_adas.yml index cb9131c..7bd2eed 100644 --- a/.github/workflows/build_openvino_road_seg_adas.yml +++ b/.github/workflows/build_openvino_road_seg_adas.yml @@ -1,15 +1,20 @@ name: OpenVINO Road Segmentation ADAS Example on: + schedule: + - cron: "0 0 * * *" push: + branches: [master] paths: - ".github/workflows/build_openvino_road_seg_adas.yml" - "openvino-road-segmentation-adas/**" - "scripts/install_openvino.sh" pull_request: branches: [master] - paths-ignore: - - "**/*.md" + paths: + - ".github/workflows/build_openvino_road_seg_adas.yml" + - "openvino-road-segmentation-adas/**" + - "scripts/install_openvino.sh" env: CARGO_TERM_COLOR: always @@ -49,14 +54,11 @@ jobs: CMAKE_BUILD_TYPE: "Release" VERSION: "0.13.4" run: | - ldconfig curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $VERSION -p /usr/local --plugins wasi_nn-openvino - ldconfig - name: Build and run openvino-road-segmentation-adas working-directory: openvino-road-segmentation-adas run: | - ldconfig cd openvino-road-seg-adas cargo build --target=wasm32-wasi --release cp target/wasm32-wasi/release/openvino-road-seg-adas.wasm .. diff --git a/.github/workflows/llama.yml b/.github/workflows/llama.yml index 8fccc42..769b428 100644 --- a/.github/workflows/llama.yml +++ b/.github/workflows/llama.yml @@ -1,6 +1,8 @@ -name: Build and Test llama2 examples +name: ggml llama2 examples on: + schedule: + - cron: "0 0 * * *" workflow_dispatch: inputs: logLevel: @@ -9,8 +11,14 @@ on: default: 'info' push: branches: [ '*' ] + paths: + - ".github/workflows/llama.yml" + - "wasmedge-ggml-llama/**" pull_request: branches: [ '*' ] + paths: + - ".github/workflows/llama.yml" + - "wasmedge-ggml-llama/**" jobs: build: @@ -18,23 +26,23 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - + - uses: actions/checkout@v3 + - name: Install apt-get packages run: | sudo ACCEPT_EULA=Y apt-get update sudo ACCEPT_EULA=Y apt-get upgrade sudo apt-get install wget git curl software-properties-common build-essential - + - name: Install Rust target for wasm run: | rustup target add wasm32-wasi - + - name: Install WasmEdge + WASI-NN + GGML run: | VERSION=0.13.4 curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -v $VERSION --plugins wasi_nn-ggml -p /usr/local - + - name: Example run: | cd wasmedge-ggml-llama diff --git a/.github/workflows/pytorch.yml b/.github/workflows/pytorch.yml new file mode 100644 index 0000000..4150b1f --- /dev/null +++ b/.github/workflows/pytorch.yml @@ -0,0 +1,64 @@ +name: PyTorch examples + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'info' + push: + branches: [ '*' ] + paths: + - ".github/workflows/pytorch.yml" + - "pytorch-mobilenet-image/**" + pull_request: + branches: [ '*' ] + paths: + - ".github/workflows/pytorch.yml" + - "pytorch-mobilenet-image/**" + +jobs: + build: + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + + - name: Install apt-get packages + run: | + sudo ACCEPT_EULA=Y apt-get update + sudo ACCEPT_EULA=Y apt-get upgrade + sudo apt-get install wget git curl software-properties-common build-essential + + - name: Install Rust target for wasm + run: | + rustup target add wasm32-wasi + + - name: Install WasmEdge + WASI-NN + PyTorch + run: | + VERSION=0.13.4 + curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -v $VERSION --plugins wasi_nn-pytorch -p /usr/local + export PYTORCH_VERSION="1.8.2" + # For the Ubuntu 20.04 or above, use the libtorch with cxx11 abi. + export PYTORCH_ABI="libtorch-cxx11-abi" + curl -s -L -O --remote-name-all https://download.pytorch.org/libtorch/lts/1.8/cpu/${PYTORCH_ABI}-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip + unzip -q "${PYTORCH_ABI}-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip" + rm -f "${PYTORCH_ABI}-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip" + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/libtorch/lib + + - name: Example + run: | + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/libtorch/lib + cd pytorch-mobilenet-image/rust + cargo build --target wasm32-wasi --release + cd .. + wasmedge compile rust/target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet-image.wasm wasmedge-wasinn-example-mobilenet-image-aot.wasm + wasmedge compile rust/target/wasm32-wasi/release/wasmedge-wasinn-example-mobilenet-image-named-model.wasm wasmedge-wasinn-example-mobilenet-image-named-model-aot.wasm + echo "Run without named model" + wasmedge --dir .:. wasmedge-wasinn-example-mobilenet-image-aot.wasm mobilenet.pt input.jpg + echo "Run with named model" + wasmedge --dir .:. --nn-preload demo:PyTorch:CPU:mobilenet.pt wasmedge-wasinn-example-mobilenet-image-named-model-aot.wasm demo input.jpg diff --git a/.github/workflows/tflite.yml b/.github/workflows/tflite.yml index 356cd0a..ce9bed2 100644 --- a/.github/workflows/tflite.yml +++ b/.github/workflows/tflite.yml @@ -1,6 +1,8 @@ -name: Build and Test TFlite examples +name: TFlite examples on: + schedule: + - cron: "0 0 * * *" workflow_dispatch: inputs: logLevel: @@ -9,8 +11,14 @@ on: default: 'info' push: branches: [ '*' ] + paths: + - ".github/workflows/tflite.yml" + - "tflite-birds_v1-image/**" pull_request: branches: [ '*' ] + paths: + - ".github/workflows/tflite.yml" + - "tflite-birds_v1-image/**" jobs: build: @@ -18,7 +26,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install apt-get packages run: | diff --git a/scripts/install_openvino.sh b/scripts/install_openvino.sh index ebf6dda..9634684 100755 --- a/scripts/install_openvino.sh +++ b/scripts/install_openvino.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash set -e -echo "Installing OpenVINO with version 2023.0.2" +echo "Installing OpenVINO with version 2023.0.0" wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB echo "deb https://apt.repos.intel.com/openvino/2023 ubuntu20 main" | tee /etc/apt/sources.list.d/intel-openvino-2023.list apt update -apt-get -y install openvino -ldconfig -export PATH=/usr/lib/x86_64-linux-gnu:$PATH \ No newline at end of file +apt upgrade -y +apt search openvino +apt-get -y install openvino-2023.0.2 +export PATH=/usr/lib/x86_64-linux-gnu:$PATH