]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
metal : optimize Metal Tensor API usage for GGML_OP_MUL_MAT (#20962)
authorDeveloper-Ecosystem-Engineering <redacted>
Sat, 25 Apr 2026 12:14:28 +0000 (05:14 -0700)
committerGitHub <redacted>
Sat, 25 Apr 2026 12:14:28 +0000 (15:14 +0300)
commitd1649047a33d436142c9d496e190742992c08942
treef967d24ad7fa1da4ee8e92a1f347932ada0e403d
parent9d34231bb89590ee760ae19ba665e7855cd4fd4e
metal : optimize Metal Tensor API usage for GGML_OP_MUL_MAT (#20962)

* Optimize Metal Tensor API usage for matmul2d

Separates the Metal Tensor API (matmul2d) path in kernel_mul_mm into its own standalone kernel, gated by GGML_METAL_HAS_TENSOR.

The legacy simdgroup_matrix kernel is preserved under #else.

Previously both paths were interleaved via #ifdef blocks within a single kernel, forcing the tensor path to share the legacy kernel's data layout and threadgroup memory scheme. Splitting the kernel enabled memory and dispatch optimizations that weren't possible when the two paths shared code structure.

* cont : cleanup

* cont : cleanup

* cont : cleanup

---------

Co-authored-by: Georgi Gerganov <redacted>
ggml/src/ggml-metal/ggml-metal-device.cpp
ggml/src/ggml-metal/ggml-metal-device.h
ggml/src/ggml-metal/ggml-metal-device.m
ggml/src/ggml-metal/ggml-metal-impl.h
ggml/src/ggml-metal/ggml-metal-ops.cpp
ggml/src/ggml-metal/ggml-metal.metal