Skip to content

Commit 9c2b783

Browse files
committed
metal : improve MoE mul_mat_id condition
ggml-ci
1 parent e1e56f7 commit 9c2b783

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ggml/src/ggml-metal/ggml-metal.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,12 +2863,9 @@ static void ggml_metal_encode_node(
28632863

28642864
// for now the matrix-matrix multiplication kernel only works on A14+/M1+ SoCs
28652865
// AMD GPU and older A-chips will reuse matrix-vector multiplication kernel
2866-
// !!!
2867-
// TODO: for now, always use mat-vec kernels until we figure out how to improve the
2868-
// indirect matrix multiplication
2869-
// !!!
28702866
if ([device supportsFamily:MTLGPUFamilyApple7] &&
28712867
ne00 % 32 == 0 && ne00 >= 64 &&
2868+
ne01 / ne02 >= 512 && // NOTE: this is based on Mixtral shapes, might need adjustments
28722869
dst_rows > dst_rows_min) {
28732870
// some Metal matrix data types require aligned pointers
28742871
// ref: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf (Table 2.5)

0 commit comments

Comments
 (0)