]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
GGML WebGPU: Support for ADD, MUL, RMS_NORM, GET_ROWS operators (llama/16018)
authorReese Levine <redacted>
Wed, 17 Sep 2025 20:09:40 +0000 (13:09 -0700)
committerGeorgi Gerganov <redacted>
Sat, 20 Sep 2025 10:33:50 +0000 (13:33 +0300)
commit3ff13db12e8fbca6e155bd265f03f761591e43b7
treef006e20050373649c5d738903959c87cd27ee18e
parentf05196c9ea2a3ecd5d5c466edfe71d8139e63e4f
GGML WebGPU: Support for ADD, MUL, RMS_NORM, GET_ROWS operators (llama/16018)

* Add paramater buffer pool, batching of submissions, refactor command building/submission

* Add header for linux builds

* Free staged parameter buffers at once

* Format with clang-format

* Fix thread-safe implementation

* Use device implicit synchronization

* Update workflow to use custom release

* Remove testing branch workflow

* some f32 tests passing

* Disable set_rows until it's implemented

* f32 add all tests passing

* Begin work on set_rows

* Work on set rows

* Add error buffers for reporting unsupported SET_ROWS indices

* Remove extra comments

* Add templated addition, clean up code

* Get addition and multiplication working

* Implement rms_norm

* Add get_rows implementation

* Add new get_rows files

* Refactor use of wg size entry

* Fix compilation

* Try manually unrolled q4_0 quant

* Revert "Try manually unrolled q4_0 quant"

This reverts commit 77f8b96515f7e640ae4b0e44f066321fbc4a6166.

* Move to constant max wg size

* Check for tensor size in supports_op

* Vectorize f32 and change default workgroup size

* Move f32 get_rows from < 4 to % 4 != 0

* fix linter errors

* Add in-place tests

---------

Co-authored-by: Neha Abbas <redacted>
14 files changed:
src/ggml-webgpu/ggml-webgpu.cpp
src/ggml-webgpu/wgsl-shaders/add.tmpl.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/add_in_place.tmpl.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/binary_head.tmpl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/common_decls.tmpl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/embed_wgsl.py
src/ggml-webgpu/wgsl-shaders/get_rows.tmpl.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/mul.tmpl.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/mul_in_place.tmpl.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/mul_mat.tmpl.wgsl
src/ggml-webgpu/wgsl-shaders/rms_norm.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/rms_norm_in_place.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/set_rows.wgsl
tests/test-backend-ops.cpp