Skip to content

Commit

Permalink
[Snippets][Aarch64] Added FloorMod tokenization
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova committed Dec 18, 2024
1 parent 9763adc commit 274ba54
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ CPUTargetMachine::CPUTargetMachine(dnnl::impl::cpu::aarch64::cpu_isa_t host_isa)
jitters[ov::op::v0::Elu::get_type_info_static()] = CREATE_CPU_EMITTER(jit_elu_emitter);
jitters[ov::op::v0::Exp::get_type_info_static()] = CREATE_CPU_EMITTER(jit_exp_emitter);
jitters[ov::op::v0::Floor::get_type_info_static()] = CREATE_CPU_EMITTER(jit_floor_emitter);
jitters[ov::op::v1::FloorMod::get_type_info_static()] = CREATE_CPU_EMITTER(jit_floor_mod_emitter);
jitters[ov::op::v0::Gelu::get_type_info_static()] = CREATE_CPU_EMITTER(jit_gelu_erf_emitter);
jitters[ov::op::v7::Gelu::get_type_info_static()] =
CREATE_GELU_V7_EMITTER(jit_gelu_erf_emitter, jit_gelu_tanh_emitter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1125,13 +1125,14 @@ void Transformations::MainSnippets(void) {
ov::is_type<ov::op::v0::Clamp>(n) || ov::is_type<ov::op::v0::Ceiling>(n) ||
ov::is_type<ov::op::v0::Convert>(n) || ov::is_type<ov::op::v1::Divide>(n) ||
ov::is_type<ov::op::v0::Elu>(n) || ov::is_type<ov::op::v0::Exp>(n) ||
ov::is_type<ov::op::v0::Floor>(n) || ov::is_type<ov::op::v0::Gelu>(n) ||
ov::is_type<ov::op::v7::Gelu>(n) || ov::is_type<ov::op::v4::HSwish>(n) ||
ov::is_type<ov::op::v1::Maximum>(n) || ov::is_type<ov::op::v1::Minimum>(n) ||
ov::is_type<ov::op::v4::Mish>(n) || ov::is_type<ov::op::v1::Mod>(n) ||
ov::is_type<ov::op::v1::Multiply>(n) || ov::is_type<ov::op::v0::Relu>(n) ||
ov::is_type<ov::op::v0::Sigmoid>(n) || ov::is_type<ov::op::v1::Subtract>(n) ||
ov::is_type<ov::op::v4::Swish>(n) || ov::is_type<ov::op::v0::Tanh>(n));
ov::is_type<ov::op::v0::Floor>(n) || ov::is_type<ov::op::v1::FloorMod>(n) ||
ov::is_type<ov::op::v0::Gelu>(n) || ov::is_type<ov::op::v7::Gelu>(n) ||
ov::is_type<ov::op::v4::HSwish>(n) || ov::is_type<ov::op::v1::Maximum>(n) ||
ov::is_type<ov::op::v1::Minimum>(n) || ov::is_type<ov::op::v4::Mish>(n) ||
ov::is_type<ov::op::v1::Mod>(n) || ov::is_type<ov::op::v1::Multiply>(n) ||
ov::is_type<ov::op::v0::Relu>(n) || ov::is_type<ov::op::v0::Sigmoid>(n) ||
ov::is_type<ov::op::v1::Subtract>(n) || ov::is_type<ov::op::v4::Swish>(n) ||
ov::is_type<ov::op::v0::Tanh>(n));
#else
// CPU Plugin support Swish in Subgraph via conversion to SwichCPU which assumes second input to be constant,
// and CPU Plugin does not support Mish for x64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ std::string EltwiseLayerCPUTest::getPrimitiveType(const utils::EltwiseTypes& elt
return "jit";
}
#endif
if (eltwise_type == utils::EltwiseTypes::MOD) {
if (eltwise_type == utils::EltwiseTypes::FLOOR_MOD ||
eltwise_type == utils::EltwiseTypes::MOD) {
return "ref";
} else {
return "acl";
Expand Down Expand Up @@ -317,10 +318,8 @@ const std::vector<utils::EltwiseTypes>& eltwiseOpTypesBinInp() {
#if defined(OPENVINO_ARCH_X86) || defined(OPENVINO_ARCH_X86_64)
utils::EltwiseTypes::SUBTRACT, // TODO: Fix CVS-105430
utils::EltwiseTypes::DIVIDE, // TODO: Fix CVS-105430
utils::EltwiseTypes::FLOOR_MOD, // TODO: Fix CVS-111875
#elif defined(OPENVINO_ARCH_ARM64)
utils::EltwiseTypes::FLOOR_MOD,
#endif
utils::EltwiseTypes::FLOOR_MOD,
utils::EltwiseTypes::SQUARED_DIFF,
utils::EltwiseTypes::MOD,
};
Expand All @@ -331,6 +330,7 @@ const std::vector<utils::EltwiseTypes>& eltwiseOpTypesBinInpSnippets() {
static const std::vector<utils::EltwiseTypes> eltwiseOpTypesBinInp = {
utils::EltwiseTypes::ADD,
utils::EltwiseTypes::MULTIPLY,
utils::EltwiseTypes::FLOOR_MOD,
utils::EltwiseTypes::MOD,
};
return eltwiseOpTypesBinInp;
Expand Down

0 comments on commit 274ba54

Please sign in to comment.