koboldcpp/ggml/src
Sigbjørn Skjæret a0535ffa0d
ggml : implement REGLU/GEGLU/SWIGLU ops (#14158)
* implement unary REGLU/GEGLU/SWIGLU cpu ops

* relax constraints

* duplicate shape of source

* fix ggml_vec_geglu_f16

* special case gated ops

* implement unary REGLU/GEGLU/SWIGLU cuda ops

* tighten constraints again

* refactor into GGML_GLU_OP

* metal : add glu kernels

ggml-ci

* add CUDA_GLU_BLOCK_SIZE [no ci]

* more constraints and use 64bit ints

ggml-ci

* 64bit multiplication [no ci]

* implement swapped variants (cpu/cuda)

* update comment [no ci]

ggml-ci

* Vulkan: Add GLU ops and shaders

* SYCL: Implement fused kernel GEGLU, SWIGLU and REGLU for single up+gate

* ggml : implement GLU for split up/gate (#14181)

* implement GLU for split up/gate

* add tests for ggml_glu_split

* Vulkan: Implement glu_split logic and shader support

* add split to logging [no ci]

* SYCL: refactor element_size ops and add split up and gate support to gated kernels

* SYCL: switch GEGLU to use tanh approximation

---------

Co-authored-by: 0cc4m <picard12@live.de>
Co-authored-by: Akarshan <akarshan@menlo.ai>

* GGML: increase OP count in assertion

* Refactor: Optimize SYCL element-wise operations with unary function inlining

This commit refactors the SYCL element-wise operations to improve performance by:

- Inlining unary operations (sgn, abs, elu, gelu, silu, etc.) to reduce kernel launch overhead.
- Introducing helper functions `op_xxx` for each unary operation to encapsulate the logic.
- Replacing direct kernel calls with calls to these inlined functions.
- Using `__dpct_inline__` to encourage compiler inlining.
- Minor code cleanup and consistency improvements.

The changes aim to reduce kernel launch overhead and improve the overall efficiency of element-wise operations on SYCL devices.

* vulkan: Increase workgroup size for GLU, for performance (#14345)

* vulkan: Increase workgroup size for GLU, for performance

* vulkan: change GLU shaders to do one element per invocation rather than one row per workgroup

* merge fix

* metal : add support for split and swap

ggml-ci

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Co-authored-by: 0cc4m <picard12@live.de>
Co-authored-by: Akarshan <akarshan@menlo.ai>
Co-authored-by: Jeff Bolz <jbolz@nvidia.com>
2025-06-29 11:04:10 +02:00
..
ggml-blas cmake : Fix broken CMake error messages (ggml/1252) 2025-06-01 13:43:57 +03:00
ggml-cann fix async_mode bug (#14432) 2025-06-28 17:35:41 +08:00
ggml-cpu ggml : implement REGLU/GEGLU/SWIGLU ops (#14158) 2025-06-29 11:04:10 +02:00
ggml-cuda ggml : implement REGLU/GEGLU/SWIGLU ops (#14158) 2025-06-29 11:04:10 +02:00
ggml-hip HIP: disable rocwmma on gfx12 by default until rocm 7.0 (#14202) 2025-06-16 13:47:38 +02:00
ggml-kompute llama : add Qwen2VL support + multimodal RoPE (#10361) 2024-12-14 14:43:46 +02:00
ggml-metal ggml : implement REGLU/GEGLU/SWIGLU ops (#14158) 2025-06-29 11:04:10 +02:00
ggml-musa musa: enable fp16 mma (all) and cublas on qy2 (#13842) 2025-06-26 12:11:59 +08:00
ggml-opencl opencl: ref count ggml_backend_opencl_context and refactor profiling (#14254) 2025-06-24 11:46:25 -07:00
ggml-rpc rpc : nicer error messages for RPC server crash (#14076) 2025-06-10 09:41:01 +03:00
ggml-sycl ggml : implement REGLU/GEGLU/SWIGLU ops (#14158) 2025-06-29 11:04:10 +02:00
ggml-vulkan ggml : implement REGLU/GEGLU/SWIGLU ops (#14158) 2025-06-29 11:04:10 +02:00
CMakeLists.txt Implement GGML_CPU_ALL_VARIANTS for PowerPC (#14286) 2025-06-20 14:17:32 +02:00
ggml-alloc.c ggml: Don't assert fail when tensor data changes (#13222) 2025-05-01 22:46:10 +02:00
ggml-backend-impl.h ggml : upgrade init_tensor API to return a ggml_status (#11854) 2025-02-28 14:41:47 +01:00
ggml-backend-reg.cpp build : suppress gcc15 compile warnings (#14261) 2025-06-19 14:49:48 +02:00
ggml-backend.cpp vulkan: Add fusion support for RMS_NORM+MUL (#14366) 2025-06-29 09:43:36 +02:00
ggml-common.h ggml-cpu : split arch-specific implementations (#13892) 2025-06-09 16:47:13 +02:00
ggml-impl.h vulkan: Add fusion support for RMS_NORM+MUL (#14366) 2025-06-29 09:43:36 +02:00
ggml-opt.cpp mnist: fix segmentation fault (ggml/1227) 2025-05-19 13:29:56 +03:00
ggml-quants.c ggml-cpu : split arch-specific implementations (#13892) 2025-06-09 16:47:13 +02:00
ggml-quants.h ggml : build backends as libraries (#10256) 2024-11-14 18:04:35 +01:00
ggml-threading.cpp ggml : build backends as libraries (#10256) 2024-11-14 18:04:35 +01:00
ggml-threading.h remove CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS (#10797) 2024-12-12 19:02:49 +01:00
ggml.c ggml : implement REGLU/GEGLU/SWIGLU ops (#14158) 2025-06-29 11:04:10 +02:00
ggml.cpp ggml : Print backtrace on uncaught C++ exceptions (ggml/1232) 2025-06-01 13:43:57 +03:00
gguf.cpp ggml : do not output unprintable characters on GGUF load failure (#14381) 2025-06-25 23:26:51 +02:00