LLM inference in C/C++
C++ ggml
ggml-webgpu: Fix WASM compilation with OpenMP (#25943)
Reese Levine7cdd557f7680
diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.ymlnew file mode 100644index 0000000000..aa7ae887dc--- /dev/null+++ b/.github/workflows/build-wasm.yml@@ -0,0 +1,90 @@+name: CI (wasm)++on:+ workflow_dispatch: # allows manual triggering+ push:+ branches:+ - master+ paths: [+ '.github/workflows/build-wasm.yml',+ '**/CMakeLists.txt',+ '**/.cmake',+ '**/*.h',+ '**/*.hpp',+ '**/*.c',+ '**/*.cpp',+ '**/*.wgsl',+ '**/*.tmpl',+ 'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py'+ ]++ pull_request:+ types: [opened, synchronize, reopened]+ paths: [+ '.github/workflows/build-wasm.yml',+ '**/CMakeLists.txt',+ '**/.cmake',+ '**/*.h',+ '**/*.hpp',+ '**/*.c',+ '**/*.cpp',+ '**/*.wgsl',+ '**/*.tmpl',+ 'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py'+ ]++concurrency:+ group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}+ cancel-in-progress: true++env:+ GGML_NLOOP: 3+ GGML_N_THREADS: 1+ LLAMA_ARG_LOG_COLORS: 1+ LLAMA_ARG_LOG_PREFIX: 1+ LLAMA_ARG_LOG_TIMESTAMPS: 1++jobs:+ ubuntu-webgpu:+ runs-on: ubuntu-24.04-arm++ steps:+ - name: Clone+ id: checkout+ uses: actions/checkout@v6++ - name: ccache+ uses: ggml-org/[email protected]+ with:+ key: webgpu-ubuntu-24.04-arm-wasm+ evict-old-files: 1d+ save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}++ - name: Install Emscripten+ run: |+ git clone https://github.com/emscripten-core/emsdk.git+ cd emsdk+ ./emsdk install latest+ ./emsdk activate latest++ - name: Fetch emdawnwebgpu+ run: |+ DAWN_TAG="v20260317.182325"+ EMDAWN_PKG="emdawnwebgpu_pkg-${DAWN_TAG}.zip"+ echo "Downloading ${EMDAWN_PKG}"+ curl -L -o emdawn.zip \+ "https://github.com/google/dawn/releases/download/${DAWN_TAG}/${EMDAWN_PKG}"+ unzip emdawn.zip++ - name: Build WASM WebGPU+ run: |+ source emsdk/emsdk_env.sh+ emcmake cmake -B build-wasm \+ -G "Ninja" \+ -DCMAKE_BUILD_TYPE=Release \+ -DGGML_WEBGPU=ON \+ -DGGML_OPENMP=OFF \+ -DLLAMA_OPENSSL=OFF \+ -DEMDAWNWEBGPU_DIR=emdawnwebgpu_pkg++ time cmake --build build-wasm --config Release --target test-backend-ops -j $(nproc)diff --git a/.github/workflows/build-webgpu.yml b/.github/workflows/build-webgpu.ymlindex 0f5ade7af6..ed73c185aa 100644--- a/.github/workflows/build-webgpu.yml+++ b/.github/workflows/build-webgpu.yml@@ -13,7 +13,9 @@ on:'**/*.hpp','**/*.c','**/*.cpp',- '**/*.wgsl'+ '**/*.wgsl',+ '**/*.tmpl',+ 'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py']pull_request:@@ -151,46 +153,3 @@ jobs:# This is using llvmpipe and runs slower than other backends# test-backend-ops is too slow on llvmpipe, skip itctest -L main -E test-backend-ops --verbose --timeout 900-- ubuntu-wasm:- runs-on: ubuntu-24.04-arm-- steps:- - name: Clone- id: checkout- uses: actions/checkout@v6-- - name: ccache- uses: ggml-org/[email protected]- with:- key: webgpu-ubuntu-24.04-arm-wasm- evict-old-files: 1d- save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}-- - name: Install Emscripten- run: |- git clone https://github.com/emscripten-core/emsdk.git- cd emsdk- ./emsdk install latest- ./emsdk activate latest-- - name: Fetch emdawnwebgpu- run: |- DAWN_TAG="v20260317.182325"- EMDAWN_PKG="emdawnwebgpu_pkg-${DAWN_TAG}.zip"- echo "Downloading ${EMDAWN_PKG}"- curl -L -o emdawn.zip \- "https://github.com/google/dawn/releases/download/${DAWN_TAG}/${EMDAWN_PKG}"- unzip emdawn.zip-- - name: Build WASM WebGPU- run: |- source emsdk/emsdk_env.sh- emcmake cmake -B build-wasm \- -G "Ninja" \- -DCMAKE_BUILD_TYPE=Release \- -DGGML_WEBGPU=ON \- -DLLAMA_OPENSSL=OFF \- -DEMDAWNWEBGPU_DIR=emdawnwebgpu_pkg-- time cmake --build build-wasm --config Release --target test-backend-ops -j $(nproc)