forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
782f191
commit ddc1f03
Showing
34 changed files
with
233 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (C) 2025 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "emitters/utils.hpp" | ||
#include "libxsmm.h" | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
namespace tpp { | ||
|
||
inline libxsmm_datatype ov_to_xsmm_dtype(ov::element::Type_t elemet_type) { | ||
switch (elemet_type) { | ||
case ov::element::Type_t::f32: | ||
return LIBXSMM_DATATYPE_F32; | ||
case ov::element::Type_t::bf16: | ||
return LIBXSMM_DATATYPE_BF16; | ||
case ov::element::Type_t::f16: | ||
return LIBXSMM_DATATYPE_F16; | ||
case ov::element::Type_t::i8: | ||
return LIBXSMM_DATATYPE_I8; | ||
case ov::element::Type_t::u8: | ||
return LIBXSMM_DATATYPE_U8; | ||
default: | ||
OV_CPU_JIT_EMITTER_THROW("Attempt to convert unsupported ov data type"); | ||
return LIBXSMM_DATATYPE_IMPLICIT; | ||
} | ||
} | ||
|
||
} // namespace tpp | ||
} // namespace intel_cpu | ||
} // namespace ov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/plugins/intel_cpu/src/transformations/tpp/aarch64/pass/lowered/brgemm_tpp_blocking.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "brgemm_tpp_blocking.hpp" | ||
|
||
#include "snippets/itt.hpp" | ||
#include "snippets/lowered/linear_ir.hpp" | ||
#include "snippets/lowered/loop_manager.hpp" | ||
#include "snippets/snippets_isa.hpp" | ||
#include "snippets/utils/utils.hpp" | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
namespace tpp { | ||
namespace pass { | ||
namespace aarch64 { | ||
using namespace ov::snippets::utils; | ||
|
||
bool BrgemmTPPBlocking::SetBrgemmBeta::run(ov::snippets::lowered::LinearIR& linear_ir, | ||
ov::snippets::lowered::LinearIR::constExprIt begin, | ||
ov::snippets::lowered::LinearIR::constExprIt end) { | ||
for (auto expr_it = begin; expr_it != end; ++expr_it) { | ||
if (const auto brgemm = ov::as_type_ptr<ov::intel_cpu::tpp::op::BrgemmTPP>(expr_it->get()->get_node())) | ||
brgemm->set_beta(0); | ||
} | ||
return true; | ||
} | ||
|
||
std::shared_ptr<snippets::lowered::pass::PassBase> BrgemmTPPBlocking::SetBrgemmBeta::merge( | ||
const std::shared_ptr<snippets::lowered::pass::PassBase>& other) { | ||
return !other || ov::is_type<SetBrgemmBeta>(other) ? std::make_shared<SetBrgemmBeta>() : nullptr; | ||
} | ||
|
||
std::tuple<size_t, size_t, size_t> BrgemmTPPBlocking::get_blocking_params( | ||
const ov::snippets::lowered::ExpressionPtr& brgemm_expr) const { | ||
size_t m, n, k; | ||
std::tie(m, n, k) = get_brgemm_dimensions(brgemm_expr); | ||
OPENVINO_ASSERT(!is_dynamic_value(m) && !is_dynamic_value(n) && !is_dynamic_value(n), | ||
"BrgemmTPP doesn't support dynamic shapes"); | ||
|
||
size_t m_blk, n_blk, k_blk; | ||
std::tie(m_blk, n_blk, k_blk) = BrgemmBlockingBase::get_blocking_params(brgemm_expr); | ||
|
||
auto get_projected_blk = [](const size_t dim, const size_t blk) { | ||
return ov::snippets::utils::is_full_dim_value(blk) ? dim : blk; | ||
}; | ||
return std::make_tuple(get_projected_blk(m, m_blk), get_projected_blk(n, n_blk), get_projected_blk(k, k_blk)); | ||
} | ||
|
||
ov::snippets::lowered::SpecificIterationHandlers BrgemmTPPBlocking::get_k_loop_handlers(size_t work_amount, | ||
size_t block_size) const { | ||
ov::snippets::lowered::SpecificIterationHandlers handlers = | ||
ov::snippets::lowered::pass::BrgemmBlockingBase::get_k_loop_handlers(work_amount, block_size); | ||
handlers.register_pass<ov::snippets::lowered::SpecificLoopIterType::FIRST_ITER, SetBrgemmBeta>(); | ||
return handlers; | ||
} | ||
|
||
} // namespace aarch64 | ||
} // namespace pass | ||
} // namespace tpp | ||
} // namespace intel_cpu | ||
} // namespace ov |
Oops, something went wrong.