-
Notifications
You must be signed in to change notification settings - Fork 14.1k
ggml webgpu: add support for emscripten builds #17184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c6bc125
Faster tensors (#8)
reeselevine 7c2b2ef
Use map for shader replacements instead of pair of strings
reeselevine c201d0d
Wasm (#9)
reeselevine 6db7298
Merge remote-tracking branch 'upstream/master'
reeselevine 56e6959
Remove extra whitespace
reeselevine 2abcdd6
Merge remote-tracking branch 'upstream/master'
reeselevine 5bcd577
Move wasm single-thread logic out of test-backend-ops for cpu backend
reeselevine f9ba819
Disable multiple threads for emscripten single-thread builds in ggml_…
reeselevine b4ecd7f
Merge remote-tracking branch 'upstream/master'
reeselevine 4754385
Fix .gitignore
reeselevine 1be47ff
Add memory64 option and remove unneeded macros for setting threads to 1
reeselevine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -547,6 +547,46 @@ jobs: | |
| # This is using llvmpipe and runs slower than other backends | ||
| ctest -L main --verbose --timeout 3600 | ||
|
|
||
| ubuntu-24-wasm-webgpu: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - name: Clone | ||
| id: checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: ccache | ||
| uses: ggml-org/[email protected] | ||
| with: | ||
| key: ubuntu-latest-wasm-webgpu | ||
| evict-old-files: 1d | ||
|
|
||
| - 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="v20251027.212519" | ||
| 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 \ | ||
| -DGGML_WEBGPU=ON \ | ||
| -DLLAMA_CURL=OFF \ | ||
| -DEMDAWNWEBGPU_DIR=emdawnwebgpu_pkg | ||
|
|
||
| cmake --build build-wasm --target test-backend-ops -j $(nproc) | ||
|
|
||
| ubuntu-22-cmake-hip: | ||
| runs-on: ubuntu-22.04 | ||
| container: rocm/dev-ubuntu-22.04:6.1.2 | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -134,3 +134,5 @@ poetry.toml | |
| # IDE | ||
| /*.code-workspace | ||
| /.windsurf/ | ||
| # emscripten | ||
| a.out.* | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.