]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
metal : optimize Metal Tensor API usage for GGML_OP_MUL_MAT (llama/20962)
authorDeveloper-Ecosystem-Engineering <redacted>
Sat, 25 Apr 2026 12:14:28 +0000 (05:14 -0700)
committerGeorgi Gerganov <redacted>
Thu, 30 Apr 2026 08:29:19 +0000 (11:29 +0300)
commit21da84303e9cea074f16850e9a2573f68b75b48f
tree7b9970ce7f3181426f4af72ec6148df27e278a0e
parent6296fd5a904edbd9785a9e8e06d38564e3c70b49
metal : optimize Metal Tensor API usage for GGML_OP_MUL_MAT (llama/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