Skip to content

Commit

Permalink
[Snippets][CPU] Applied Vladislav comments
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova committed Nov 25, 2024
1 parent 93a9f81 commit 6ca525c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2023 Intel Corporation
// Copyright (C) 2020-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

Expand Down Expand Up @@ -48,7 +48,6 @@ std::string BrgemmAMXKernelConfig::StaticParams::to_string() const {
ss << "vnni_factor = " << vnni_factor << "\n";
return ss.str();
}
#undef PRINT
#endif

BrgemmAMXKernelExecutor::BrgemmAMXKernelExecutor(ov::intel_cpu::MultiCacheWeakPtr kernel_cache, BrgemmAMXKernelConfig config) :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-20243 Intel Corporation
// Copyright (C) 2020-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

Expand All @@ -23,7 +23,7 @@ struct BrgemmAMXKernelConfig : public snippets::KernelExecutorBase::GenericConfi
BrgemmAMXKernelConfig() = delete;

std::unique_ptr<GenericConfig> get_clone_ptr() const override {
return std::unique_ptr<BrgemmAMXKernelConfig>( new BrgemmAMXKernelConfig(*this));
return std::unique_ptr<BrgemmAMXKernelConfig>(new BrgemmAMXKernelConfig(*this));
}

bool is_completed() const override { return BrgemmBaseKernelConfig::is_completed(); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2023 Intel Corporation
// Copyright (C) 2020-2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ bool InsertBrgemmCopyBuffers::run(LinearIR& linear_ir, LinearIR::constExprIt beg
OPENVINO_ASSERT(!ov::snippets::utils::is_dynamic_value(M_blk), "M blk cannot be dynamic!");

const auto inner_k_blk = brgemm_utils::repacking::compute_inner_k_block(src_dt);
const size_t tile_scratch_size = BrgemmCPU::SCRATCH_BYTE_SIZE;
const size_t repacked_in0_size = ov::snippets::utils::is_dynamic_value(K_dim) || K_dim % inner_k_blk ?
const auto tile_scratch_size = BrgemmCPU::SCRATCH_BYTE_SIZE;
const auto current_scratch_size = scratch_expr->get_byte_size();
OPENVINO_ASSERT(current_scratch_size == tile_scratch_size,
"Tile scratchpad for BrgemmAMX should have byte size ", tile_scratch_size);
const size_t repacked_in0_size = ov::snippets::utils::is_dynamic_value(K_dim) || K_dim % inner_k_blk > 0 ?
(M_blk * inner_k_blk * src_dt.size()) : 0;
scratch_expr->set_allocation_size(tile_scratch_size + repacked_in0_size);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ TEST_P(MHABF16AMXBufferAllocationTest, BufferAllocationCPU) {
// Scratchpad memory for AMX with CopyA (dynamic case) has allocation size which depends on element count in vector register.
// So the current `expected_allocation_size` in the test is targeted on real AVX512 platforms with vector registers with 512 bits.
// If the test infrastructure has AVX2, the allocation size will not be matched.
if (m_linear_ir.is_dynamic() && !with_cpu_x86_avx512_core())
if (!with_cpu_x86_avx512_core())
GTEST_SKIP();
Validate();
}
Expand Down

0 comments on commit 6ca525c

Please sign in to comment.