]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
ggml-webgpu: JIT compile binary operators and handle binding overlaps (llama/19310)
authorAbhijit Ramesh <redacted>
Fri, 6 Feb 2026 18:33:30 +0000 (10:33 -0800)
committerGeorgi Gerganov <redacted>
Sat, 7 Feb 2026 08:37:38 +0000 (10:37 +0200)
commitd5e11af27f7fb828b36d50bf7c79c7d6f0aada33
tree8700f45d419c40623facb177f17294ba2c684e36
parent43435120c9fd4345505459b8b523bb80ad0984c1
ggml-webgpu: JIT compile binary operators and handle binding overlaps (llama/19310)

* ggml webgpu: port binary operators to use pre-wgsl

* Add binary.wgsl: unified shader with conditionals for all 4 ops

* Add gen_binary_shaders.cpp: build tool for using pre_wgsl preprocessor

* Remove bin_op.tmpl.wgsl and binary.wgsl (Python template)

* Update CMake to generate binary operator shaders at build time

* ggml-webgpu: migrate binary ops to JIT compilation with overlap handling

* port binary operators from AOT to pre-wgsl JIT compilation

* add src1=dst overlap handling for binary ops

* use compile-time workgroup size defines instead of runtime overrides

* ggml-webgpu: complete overlap handling for binary ops

* add support for inplace & overlap case in binding setup

* restructure conditional logic to handle all overlap cases

* ensure all buffer bindings are correctly assigned for edge cases

* ggml-webgpu: remove unused binary overlap cases

Remove src0==src1 binary overlap case that never occurs in practice.

* keep INPLACE (src0==dst), OVERLAP (src1==dst), DEFAULT

* remove unused src0==src1 and all-same variant

* refactor wgsl to eliminate duplication
src/ggml-webgpu/ggml-webgpu-shader-lib.hpp
src/ggml-webgpu/ggml-webgpu.cpp
src/ggml-webgpu/wgsl-shaders/bin_op.tmpl.wgsl [deleted file]
src/ggml-webgpu/wgsl-shaders/binary.wgsl [new file with mode: 0644]
src/ggml-webgpu/wgsl-shaders/binary_head.tmpl [deleted file]