From: Masashi Yoshimura Date: Sun, 2 Aug 2026 06:28:31 +0000 (+0900) Subject: ggml-webgpu: add support for f16 repeat (llama/26307) X-Git-Tag: upstream/1.9.2~16 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=cabd684e45540638c26ff521b1dd87c0e1360c3e;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp ggml-webgpu: add support for f16 repeat (llama/26307) --- diff --git a/ggml/src/ggml-webgpu/ggml-webgpu-shader-lib.hpp b/ggml/src/ggml-webgpu/ggml-webgpu-shader-lib.hpp index babaddb6..66c1c3c8 100644 --- a/ggml/src/ggml-webgpu/ggml-webgpu-shader-lib.hpp +++ b/ggml/src/ggml-webgpu/ggml-webgpu-shader-lib.hpp @@ -2774,6 +2774,10 @@ class ggml_webgpu_shader_lib { defines.push_back("TYPE_F32"); variant += "_f32"; break; + case GGML_TYPE_F16: + defines.push_back("TYPE_F16"); + variant += "_f16"; + break; case GGML_TYPE_I32: defines.push_back("TYPE_I32"); variant += "_i32"; diff --git a/ggml/src/ggml-webgpu/ggml-webgpu.cpp b/ggml/src/ggml-webgpu/ggml-webgpu.cpp index 370f05df..c001cda7 100644 --- a/ggml/src/ggml-webgpu/ggml-webgpu.cpp +++ b/ggml/src/ggml-webgpu/ggml-webgpu.cpp @@ -4290,7 +4290,8 @@ static bool ggml_backend_webgpu_device_supports_op(ggml_backend_dev_t dev, const supports_op = (src0->type == GGML_TYPE_F32 || src0->type == GGML_TYPE_I32); break; case GGML_OP_REPEAT: - supports_op = (src0->type == GGML_TYPE_F32 || src0->type == GGML_TYPE_I32 || src0->type == GGML_TYPE_I16); + supports_op = (src0->type == GGML_TYPE_F32 || src0->type == GGML_TYPE_F16 || src0->type == GGML_TYPE_I32 || + src0->type == GGML_TYPE_I16); break; case GGML_OP_CPY: case GGML_OP_CONT: diff --git a/ggml/src/ggml-webgpu/wgsl-shaders/repeat.wgsl b/ggml/src/ggml-webgpu/wgsl-shaders/repeat.wgsl index 6e2a1a8b..43b883e6 100644 --- a/ggml/src/ggml-webgpu/wgsl-shaders/repeat.wgsl +++ b/ggml/src/ggml-webgpu/wgsl-shaders/repeat.wgsl @@ -27,6 +27,9 @@ struct Params { #ifdef TYPE_I32 #define DataType i32 #endif +#ifdef TYPE_F16 +#define DataType f16 +#endif #ifdef TYPE_I16 // same size (16-bit) is sufficient for repeat #define DataType f16