]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : WebGPU add TRANSPOSE and RESHAPE to supported ops (llama/15695)
authorDaniel Bevenius <redacted>
Mon, 1 Sep 2025 12:28:49 +0000 (14:28 +0200)
committerGeorgi Gerganov <redacted>
Fri, 5 Sep 2025 09:54:10 +0000 (12:54 +0300)
* ggml : WebGPU add TRANSPOSE and RESHAPE to supported ops

This commit adds support for the TRANSPOSE and RESHAPE operations in the
ggml webgpu backend.

Co-authored-by: Diego Devesa <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
src/ggml-webgpu/ggml-webgpu.cpp

index 32f1e304e1e6334b1c4ffa934f8f05c3fa20a393..e5df883c1367ef93c62b41f368076112c3a1854c 100644 (file)
@@ -611,6 +611,8 @@ static bool ggml_webgpu_encode_node(webgpu_context ctx, ggml_tensor * node) {
         case GGML_OP_NONE:
         case GGML_OP_VIEW:
         case GGML_OP_PERMUTE:
+        case GGML_OP_TRANSPOSE:
+        case GGML_OP_RESHAPE:
             return false;
         case GGML_OP_CPY:
             {
@@ -1062,6 +1064,8 @@ static bool ggml_backend_webgpu_device_supports_op(ggml_backend_dev_t dev, const
         case GGML_OP_NONE:
         case GGML_OP_VIEW:
         case GGML_OP_PERMUTE:
+        case GGML_OP_TRANSPOSE:
+        case GGML_OP_RESHAPE:
             return true;
         case GGML_OP_CPY:
         case GGML_OP_SET_ROWS: