Skip to content

Commit 05271d8

Browse files
committed
ci(wip): build WASI-NN GGML
Signed-off-by: Yi Huang <[email protected]>
1 parent be3046b commit 05271d8

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARCH=$(uname -m)
2+
ARTIFACT="WasmEdge-plugin-wasi_nn-ggml-${WASMEDGE_GGML_BUILD}-${WASMEDGE_VERSION}-ubuntu20.04-${ARCH}.tar.gz"
3+
IS_NATIVE=OFF
4+
5+
if [[ "${ARCH}" == "x86_64" ]; then
6+
IS_NATIVE=ON
7+
fi
8+
9+
cmake -B${OUTPUT_DIR} -GNinja \
10+
-DCMAKE_BUILD_TYPE=Release \
11+
-DWASMEDGE_BUILD_AOT_RUNTIME=OFF \
12+
-DWASMEDGE_BUILD_TOOLS=OFF \
13+
-DWASMEDGE_PLUGIN_WASI_NN_BACKEND=GGML \
14+
-DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=OFF \
15+
-DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_NATIVE=${IS_NATIVE} \
16+
-DWASMEDGE_USE_LLVM=OFF
17+
cmake --build ${OUTPUT_DIR}
18+
19+
cp -f "${OUTPUT_DIR}/${OUTPUT_BIN}" "${OUTPUT_BIN}"
20+
tar zcvf "${ARTIFACT}" "${OUTPUT_BIN}"
21+
22+
echo "artifact=${ARTIFACT}" >> "${GITHUB_OUTPUT}"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: WASI-NN GGML
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
paths:
8+
- '.github/workflows/build-wasi_nn-ggml.yml'
9+
- 'plugins/wasi_nn/**'
10+
- 'test/plugins/wasi_nn/**'
11+
12+
permissions: {}
13+
14+
jobs:
15+
build:
16+
permissions:
17+
contents: write
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- platform: ubuntu20.04
24+
arch: x86_64
25+
runner: ubuntu-latest
26+
image: wasmedge/wasmedge:ubuntu-20.04-build-gcc-plugins-deps
27+
script: ubuntu2004.sh
28+
29+
runs-on: ${{ matrix.runner }}
30+
container: ${{ matrix.image }}
31+
32+
name: ${{ matrix.platform }} (${{ matrix.arch }})
33+
34+
env:
35+
OUTPUT_DIR: build
36+
OUTPUT_BIN: libwasmedgePluginWasiNN.so
37+
WASMEDGE_GGML_BUILD: b5640
38+
WASMEDGE_VERSION: 0.14.1_plugin_lts
39+
40+
steps:
41+
- name: Checkout WasmEdge
42+
uses: actions/checkout@v4
43+
with:
44+
repository: WasmEdge/WasmEdge
45+
ref: ${{ env.WASMEDGE_VERSION }}
46+
fetch-depth: 0
47+
48+
- name: Checkout this repository
49+
uses: actions/checkout@v4
50+
with:
51+
path: this
52+
53+
- name: Build
54+
run: |
55+
git config --global --add safe.directory "$(pwd)"
56+
rm -rf "${OUTPUT_DIR}"
57+
bash -e "this/.github/scripts/wasi_nn-ggml/${{ matrix.script }}"
58+
shell: bash
59+
60+
- name: Upload ${{ steps.build.outputs.artifact }}
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: ${{ steps.build.outputs.artifact }}
64+
path: ${{ steps.build.outputs.artifact }}

0 commit comments

Comments
 (0)