Skip to content

Commit a23b9bd

Browse files
authored
ggml : fix unaligned access in AMX code (#16315)
1 parent 04e632a commit a23b9bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ggml/src/ggml-cpu/amx/amx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class extra_buffer_type : ggml::cpu::extra_buffer_type {
149149
if (op->op == GGML_OP_MUL_MAT && is_contiguous_2d(op->src[0]) && // src0 must be contiguous
150150
is_contiguous_2d(op->src[1]) && // src1 must be contiguous
151151
op->src[0]->buffer && op->src[0]->buffer->buft == ggml_backend_amx_buffer_type() &&
152+
op->src[0]->ne[0] % (TILE_K * 2 * 32) == 0 && // TODO: not sure if correct (https://github.com/ggml-org/llama.cpp/pull/16315)
152153
op->ne[0] % (TILE_N * 2) == 0 && // out_features is 32x
153154
(qtype_has_amx_kernels(op->src[0]->type) || (op->src[0]->type == GGML_TYPE_F16))) {
154155
// src1 must be host buffer

0 commit comments

Comments
 (0)