-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Enable daily run for each workflow (#32)
* [CI] Enable PyTorch workflow Signed-off-by: hydai <[email protected]> * [CI] change to the correct rust folder Signed-off-by: hydai <[email protected]> * [CI] Use checkout@v3 Signed-off-by: hydai <[email protected]> * [CI] change back to the pwd Signed-off-by: hydai <[email protected]> * [Script] OpenVINO 2023 relies on libpython3.8 Signed-off-by: hydai <[email protected]> * [CI] Refine the naming of the workflows Signed-off-by: hydai <[email protected]> * [CI] Try to check the openvino versions Signed-off-by: hydai <[email protected]> * [CI] Use openvino-2023.0.0 Signed-off-by: hydai <[email protected]> * [CI] Make OpenVINO run daily Signed-off-by: hydai <[email protected]> * [CI] Use openvino-2023.0.2 because WASI-NN OpenVINO plugin uses that version Signed-off-by: hydai <[email protected]> --------- Signed-off-by: hydai <[email protected]>
- Loading branch information
Showing
6 changed files
with
108 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
apt upgrade -y | ||
apt search openvino | ||
apt-get -y install openvino-2023.0.2 | ||
export PATH=/usr/lib/x86_64-linux-gnu:$PATH |