]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
metal: template GLU kernels to support f16/f32 (#23882)
authorShrivas Shankar <redacted>
Mon, 1 Jun 2026 12:40:28 +0000 (07:40 -0500)
committerGitHub <redacted>
Mon, 1 Jun 2026 12:40:28 +0000 (15:40 +0300)
commit95b8b8ec1a9e77bcc7b3fb04da82c9f35cb12a79
tree3a0f2cbf6318f90bb173ccf5f3160fdac4d4b91e
parent55ac0909e5526efa950ce69d06ad0e8e7ebc7e0a
metal: template GLU kernels to support f16/f32 (#23882)

Drops the hardcoded f32 GLU kernels in favor of a single template. We now load/store in the native tensor type (half or float) to save memory bandwidth, but keep the actual ALU compute in float to avoid exploding math in geglu/swiglu. Also opened up the dispatch gate to allow f16 inputs.
ggml/src/ggml-metal/ggml-metal-device.m
ggml/src/ggml-metal/ggml-metal.metal