diff --git a/src/plugins/intel_cpu/src/emitters/snippets/x64/jit_brgemm_copy_b_emitter.cpp b/src/plugins/intel_cpu/src/emitters/snippets/x64/jit_brgemm_copy_b_emitter.cpp index 1169e87753aec2..8d2f33b18513f6 100644 --- a/src/plugins/intel_cpu/src/emitters/snippets/x64/jit_brgemm_copy_b_emitter.cpp +++ b/src/plugins/intel_cpu/src/emitters/snippets/x64/jit_brgemm_copy_b_emitter.cpp @@ -57,6 +57,7 @@ jit_brgemm_copy_b_emitter::jit_brgemm_copy_b_emitter(jit_generator* h, cpu_isa_t m_inner_N_tail = m_N_blk % m_inner_N_block; m_brgemmVNNIFactor = compute_vnni_factor(m_brg_weight_etype); + OV_CPU_JIT_EMITTER_ASSERT(m_brgemmVNNIFactor > 0, "brgemmVNNIFactor value must be positive."); OV_CPU_JIT_EMITTER_ASSERT(m_K_blk == m_K || m_K_blk % m_brgemmVNNIFactor == 0, "K Block size (", m_K_blk, "), which is not divisible by brgemmVNNIFactor (", m_brgemmVNNIFactor, ") and not equal to K dimension (", m_K, diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/op/brgemm_utils.cpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/op/brgemm_utils.cpp index 2535aa2d6118cf..4e8414d7d09430 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/op/brgemm_utils.cpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/op/brgemm_utils.cpp @@ -99,7 +99,9 @@ size_t get_repacking_buffer_size(const ov::snippets::lowered::ExpressionPtr& cop // Low precision repacking writes the result by m_brgemmVNNIFactor * m_inner_n_block blocks // despite the actual size of the input data. Because of that we have to round-up the allocation shape to always have enough memory allocated. // For the details, please see 'copy_4x64' and 'copy_2x32' implementations and usage in onednn/src/cpu/x64/matmul/brgemm_matmul_copy_utils.cpp - return N_dim * rnd_up(k_blk, brgemm_utils::compute_vnni_factor(precision)); + const auto brgemmVNNIFactor = brgemm_utils::compute_vnni_factor(precision); + OPENVINO_ASSERT(brgemmVNNIFactor > 0, "brgemmVNNIFactor value must be positive."); + return N_dim * rnd_up(k_blk, brgemmVNNIFactor); } }