From 474527f47acb1aeff2bf52efd64e09ac95d8ef5b Mon Sep 17 00:00:00 2001 From: Andrey Kalinin Date: Mon, 6 Feb 2023 13:48:18 -0800 Subject: [PATCH] cpu: x64: brgemm unrolled kernel: don't load from dst if bd_mask exists --- src/cpu/x64/brgemm/jit_brgemm_amx_uker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu/x64/brgemm/jit_brgemm_amx_uker.cpp b/src/cpu/x64/brgemm/jit_brgemm_amx_uker.cpp index be7674f4de0..860e996ff46 100644 --- a/src/cpu/x64/brgemm/jit_brgemm_amx_uker.cpp +++ b/src/cpu/x64/brgemm/jit_brgemm_amx_uker.cpp @@ -1623,7 +1623,8 @@ void jit_brgemm_amx_uker_base_t::generate() { // if beta == 1 and C datatype is f32 it is better to perform addition by // reading tiles directly from C instead of by reading/writing by vectors may_load_accumulators_ - = (brg.beta == 1.f && brg.dt_c == data_type::f32 && !brg.is_bf32); + = (brg.beta == 1.f && brg.dt_c == data_type::f32 && !brg.is_bf32) + && brg.brgattr.bd_mask_level == 0; need_to_apply_alpha_beta_ = (brg.beta != 0.f && !may_load_accumulators_) || brg.alpha != 1.f; const bool has_zero_points = !everyone_is(brgemm_broadcast_t::none,