ggml: add SWIGLU_CLAMP - #27930
ggml: add SWIGLU_CLAMP#27930
Conversation
|
Can't we just add this as a universal glu op param instead of making a new op? |
|
It's not an op, it's added to glu enum right? |
Sure, still. :) |
|
I'm okay either way, it would not lead to less changes and it would complicate at least the fusion in the CUDA backend. We already have a multiple glu variants and this is quite a valid one which is used is more than 1 arch. |
Could you clarify? The swiglu+clamp also needs a limit parameter. |
I meant that all glu ops could check op param 3 for limit. |
jeffbolznv
left a comment
There was a problem hiding this comment.
ggml-vulkan changes look good.
There was a problem hiding this comment.
hexagon changes look good.
opencl looks good too, @lhez please double-check
marty1885
left a comment
There was a problem hiding this comment.
Approval for the ET portion
|
Vulkan code is fine. |
|
@CISC can I merge? |
Sure, it was merely a suggestion to avoid an extra enum and possibly support future variations. |
|
Failed to build llama.cpp after this PR was merged Arch build script |
|
Thank you for help, I didn't know about ggml separation before. Then I will wait for next release to test Qwen-3.8-Flash, as I was trying to update systemwide llama.cpp package. |
|
I noticed that OpenVINO backend CI fails some new tests https://github.com/ggml-org/llama.cpp/actions/runs/33609523462/job/100181219768 err looks low, perhaps this test needs increased max_nmse_err()? |
|
AFAIK, the OpenVINO team will be addressing these soon. |
* ggml: add SWIGLU_CLAMP * add vulkan shader
* ggml: add SWIGLU_CLAMP * add vulkan shader
* ggml: add SWIGLU_CLAMP * add vulkan shader
* ggml: add SWIGLU_CLAMP * add vulkan shader
Overview
DSV4, GLM use a new variant of GLU which clamps the SWIGLU. Currently in the graph it is not represented well for downstream fusion and creates 3 separate OPs. Helps 2% in TG and 1-2% on PP, tested on 4x4090s. It should help in spec-dec as well after we merge #27621
Additional information
Requirements
test-backend-opswherever possible