Skip to content

Commit c538dc5

Browse files
authored
cpu: x64: disable small shapes for brgemm matmul reorder (#2513)
1 parent e4cd53a commit c538dc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cpu/x64/matmul/brgemm_matmul_reorders.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2022-2024 Intel Corporation
2+
* Copyright 2022-2025 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -219,6 +219,9 @@ status_t init_conf(matmul::brgemm_matmul_conf_t &conf,
219219
CHECK(calculate_plain_transpose_blocks(batch, M, K, src_md, dst_md));
220220
N = 0;
221221
in_ld = M;
222+
// The heuristic value is empirical
223+
const bool is_small_shape = batch * M * K < 49152;
224+
VDISPATCH_REORDER_IC(!is_small_shape, VERBOSE_SMALL_SHAPES);
222225
} else {
223226
batch = ndims > 2 ? dims[ndims - 3] : 1;
224227
M = 0;

0 commit comments

Comments
 (0)