Skip to content

ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support. - #19700

Merged
reeselevine merged 2 commits into
ggml-org:masterfrom
yomaytk:add-webgpu-unary-op
Feb 19, 2026
Merged

ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.#19700
reeselevine merged 2 commits into
ggml-org:masterfrom
yomaytk:add-webgpu-unary-op

Conversation

@yomaytk

@yomaytk yomaytk commented Feb 18, 2026

Copy link
Copy Markdown
Member

Hello. I have added support for some unary operations (SQR, SQRT, SIN, COS) to the WebGPU backend.

@yomaytk
yomaytk requested a review from reeselevine as a code owner February 18, 2026 01:35
@github-actions github-actions Bot added documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning labels Feb 18, 2026
@reeselevine

Copy link
Copy Markdown
Contributor

Hi @yomaytk thanks for the contribution! It looks like some of the tests are failing on one of the Metal CI runs:

2026-02-18T16:15:43.2404670Z 36: Failing tests:
2026-02-18T16:15:43.2404850Z 36:   SIN(type=f16,ne=[10,2,2,2])
2026-02-18T16:15:43.2405090Z 36:   COS(type=f16,ne=[10,2,2,2])
2026-02-18T16:15:43.2405300Z 36:   SIN(type=f16,ne=[7,1,5,3])
2026-02-18T16:15:43.2405500Z 36:   SIN(type=f16,ne=[1024,1024,1,1])
2026-02-18T16:15:43.2405720Z 36:   COS(type=f16,ne=[7,1,5,3])
2026-02-18T16:15:43.2405930Z 36:   COS(type=f16,ne=[1024,1024,1,1])
2026-02-18T16:15:43.2406240Z 36:   Backend WebGPU: WebGPU: �[1;31mFAIL�[0m

This might be related to precision, you might try casting to f32 before computing the sin/cos then casting back to f16.

@yomaytk
yomaytk force-pushed the add-webgpu-unary-op branch from b75e363 to bec6e88 Compare February 19, 2026 07:59
@reeselevine
reeselevine merged commit 11c325c into ggml-org:master Feb 19, 2026
78 of 79 checks passed
@yomaytk
yomaytk deleted the add-webgpu-unary-op branch February 19, 2026 16:33
liparetejas pushed a commit to liparetejas/llama.cpp that referenced this pull request Feb 23, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
bartowski1182 pushed a commit to bartowski1182/llama.cpp that referenced this pull request Mar 2, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
ArberSephirotheca pushed a commit to ArberSephirotheca/llama.cpp that referenced this pull request Mar 3, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
MrLordCat referenced this pull request in MrLordCat/llama.cpp-rdna-lab Jul 16, 2026
* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
)

* ggml-webgpu: Add unary op (SQR, SQRT, SIN, COS) support.

* Fix to cast the src value to f32 before sin/cos computing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants