Skip to content

Commit

Permalink
apply and fix
Browse files Browse the repository at this point in the history
- apply rv64 patch
- fix arm tests
- fix the comments
  • Loading branch information
xczhai committed Dec 24, 2024
1 parent c576825 commit 6720e7f
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,19 @@ jit_dnnl_emitter::jit_dnnl_emitter(jit_generator* host,

void jit_dnnl_emitter::set_injector() {
if (host_isa_ == cpu::x64::sse41) {
eltwise_injector_sse42 = std::make_shared<jit_uni_eltwise_injector<cpu::x64::sse41>>(h, kind, alpha, beta, 1.f);
eltwise_injector_sse42 =
std::make_shared<jit_uni_eltwise_injector<cpu::x64::sse41>>(h, kind, alpha, beta, 1.f, data_type::f32);
} else if (host_isa_ == cpu::x64::avx2) {
eltwise_injector_avx2 = std::make_shared<jit_uni_eltwise_injector<cpu::x64::avx2>>(h, kind, alpha, beta, 1.f);
eltwise_injector_avx2 =
std::make_shared<jit_uni_eltwise_injector<cpu::x64::avx2>>(h, kind, alpha, beta, 1.f, data_type::f32);
} else if (host_isa_ == cpu::x64::avx512_core) {
eltwise_injector_avx512_core =
std::make_shared<jit_uni_eltwise_injector<cpu::x64::avx512_core>>(h, kind, alpha, beta, 1.f);
std::make_shared<jit_uni_eltwise_injector<cpu::x64::avx512_core>>(h,
kind,
alpha,
beta,
1.f,
data_type::f32);
} else {
OV_CPU_JIT_EMITTER_THROW("Unsupported ISA ", host_isa_);
}
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/intel_cpu/src/nodes/common/softmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "utils/bfloat16.hpp"

using namespace dnnl;
using namespace dnnl::impl;
using namespace dnnl::impl::cpu;
using namespace dnnl::impl::cpu::x64;
using namespace dnnl::impl::utils;
Expand Down Expand Up @@ -67,7 +68,8 @@ struct jit_uni_softmax_kernel_f32 : public jit_uni_softmax_kernel, public jit_ge
}

void generate() override {
exp_injector.reset(new jit_uni_eltwise_injector<isa>(this, dnnl::impl::alg_kind::eltwise_exp, 0.f, 0.f, 1.0f));
exp_injector.reset(
new jit_uni_eltwise_injector<isa>(this, dnnl::impl::alg_kind::eltwise_exp, 0.f, 0.f, 1.0f, data_type::f32));

if (mayiuse(avx512_core))
uni_vcvtneps2bf16.reset(new jit_uni_vcvtneps2bf16(this, isa));
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_cpu/src/nodes/interpolate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ struct jit_uni_interpolate_kernel_f32 : public jit_uni_interpolate_kernel, publi
post_op.eltwise.alg,
post_op.eltwise.alpha,
post_op.eltwise.beta,
1.f));
1.f,
data_type::f32));
} else if (post_op.is_depthwise()) {
depthwise_injectors.push_back(std::make_shared<jit_uni_depthwise_injector_f32<isa>>(this, post_op));
} else if (post_op.is_quantization()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "utils/general_utils.h"

using namespace dnnl::impl;
using namespace dnnl::impl::cpu;

#define GET_OFF(field) offsetof(NmsCallArgs, field)
Expand All @@ -19,7 +20,8 @@ void NonMaxSuppression<isa>::generate() {
load_vector_emitter.reset(new jit_load_emitter(this, isa, ov::element::f32, ov::element::f32, vector_step));
load_scalar_emitter.reset(new jit_load_emitter(this, isa, ov::element::f32, ov::element::f32, scalar_step));

exp_injector.reset(new x64::jit_uni_eltwise_injector<isa>(this, dnnl::impl::alg_kind::eltwise_exp, 0.f, 0.f, 1.f));
exp_injector.reset(
new x64::jit_uni_eltwise_injector<isa>(this, dnnl::impl::alg_kind::eltwise_exp, 0.f, 0.f, 1.f, data_type::f32));

this->preamble();

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_cpu/src/nodes/mvn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ struct jit_uni_mvn_kernel_f32 : public jit_uni_mvn_kernel, public jit_generator
post_op.eltwise.alg,
post_op.eltwise.alpha,
post_op.eltwise.beta,
post_op.eltwise.scale));
post_op.eltwise.scale,
data_type::f32));
} else if (post_op.is_depthwise()) {
depthwise_injectors.push_back(std::make_shared<jit_uni_depthwise_injector_f32<isa>>(this, post_op));
} else if (post_op.is_quantization()) {
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_cpu/src/nodes/normalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ struct jit_uni_normalize_kernel_f32 : public jit_uni_normalize_kernel, public ji
post_op.eltwise.alg,
post_op.eltwise.alpha,
post_op.eltwise.beta,
post_op.eltwise.scale));
post_op.eltwise.scale,
data_type::f32));
} else if (post_op.is_depthwise()) {
depthwise_injectors.push_back(std::make_shared<jit_uni_depthwise_injector_f32<isa>>(this, post_op));
} else if (post_op.is_quantization()) {
Expand Down
17 changes: 14 additions & 3 deletions src/plugins/intel_cpu/src/nodes/reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ struct jit_uni_reduce_kernel_f32 : public jit_uni_reduce_kernel, public jit_gene

void generate() override {
if (jcp_.reduce_mode == Algorithm::ReduceLogSumExp) {
exp_injector = std::make_shared<jit_uni_eltwise_injector<isa>>(this, alg_kind::eltwise_exp, 0.f, 0.f, 1.f);
exp_injector = std::make_shared<jit_uni_eltwise_injector<isa>>(this,
alg_kind::eltwise_exp,
0.f,
0.f,
1.f,
data_type::f32);
}

if (mayiuse(avx512_core))
Expand Down Expand Up @@ -1209,7 +1214,8 @@ struct jit_uni_reduce_post_kernel_f32 : public jit_uni_reduce_post_kernel, publi
post_op.eltwise.alg,
post_op.eltwise.alpha,
post_op.eltwise.beta,
post_op.eltwise.scale));
post_op.eltwise.scale,
data_type::f32));
} else if (post_op.is_depthwise()) {
depthwise_injectors.push_back(std::make_shared<jit_uni_depthwise_injector_f32<isa>>(this, post_op));
} else if (post_op.is_quantization()) {
Expand All @@ -1223,7 +1229,12 @@ struct jit_uni_reduce_post_kernel_f32 : public jit_uni_reduce_post_kernel, publi
}

if (jcp_.reduce_mode == Algorithm::ReduceLogSum || jcp_.reduce_mode == Algorithm::ReduceLogSumExp) {
log_injector = std::make_shared<jit_uni_eltwise_injector<isa>>(this, alg_kind::eltwise_log, 0.f, 0.f, 1.f);
log_injector = std::make_shared<jit_uni_eltwise_injector<isa>>(this,
alg_kind::eltwise_log,
0.f,
0.f,
1.f,
data_type::f32);
}

if (mayiuse(avx512_core))
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/intel_cpu/src/nodes/region_yolo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "openvino/opsets/opset1.hpp"
#include "utils/bfloat16.hpp"

using namespace dnnl::impl;
using namespace dnnl::impl::cpu;
using namespace dnnl::impl::cpu::x64;
using namespace dnnl::impl::utils;
Expand Down Expand Up @@ -45,7 +46,8 @@ struct jit_uni_logistic_kernel_f32 : public jit_uni_logistic_kernel, public jit_
}

void generate() override {
exp_injector.reset(new jit_uni_eltwise_injector<isa>(this, dnnl::impl::alg_kind::eltwise_exp, 0.f, 0.f, 1.f));
exp_injector.reset(
new jit_uni_eltwise_injector<isa>(this, dnnl::impl::alg_kind::eltwise_exp, 0.f, 0.f, 1.f, data_type::f32));

if (mayiuse(avx512_core))
uni_vcvtneps2bf16.reset(new jit_uni_vcvtneps2bf16(this, isa));
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/intel_cpu/src/utils/verbose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ void Verbose::printInfo() {
shift(written);
written = snprintf(portsInfo + written_total, CPU_VERBOSE_DAT_LEN - written_total, "%s", prefix.c_str());
shift(written);
std::string fmt_str =
dnnl::impl::md2fmt_str(prefix.c_str(), desc, dnnl::impl::format_kind_t::dnnl_format_kind_undef);
std::string fmt_str = dnnl::impl::md2fmt_str("", desc, dnnl::impl::format_kind_t::dnnl_format_kind_undef);
written = snprintf(portsInfo + written_total, CPU_VERBOSE_DAT_LEN - written_total, "%s", fmt_str.c_str());
shift(written);
written = snprintf(portsInfo + written_total, CPU_VERBOSE_DAT_LEN - written_total, ":");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ std::vector<std::string> disabledTestPatterns() {
// tests are useless on such platforms
retVector.emplace_back(R"(.*(BF|bf)16.*)");
retVector.emplace_back(R"(.*bfloat16.*)");
// Issue: MFDNN-12876
// Issue: MFDNN-12818
retVector.emplace_back(R"(.*smoke_LPT/RecurrentCellTransformation.CompareWithRefImpl/f32_\[1,1,3\]_CPU_f32FQ_X_level=256_.*_FQ_W_level=255.*)");
retVector.emplace_back(R"(.*smoke_static/ConvertFqRnnToQuantizedRnn.CompareWithRefs/Type=GRUSequence.*2.5.10.*2.1.4.*2.1.4.*)");
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/thirdparty/onednn

0 comments on commit 6720e7f

Please sign in to comment.