Skip to content

Commit bed97f3

Browse files
author
dmitrygo
committed
[CPU] Enabled brconv implementation
1 parent ed30265 commit bed97f3

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/plugins/intel_cpu/src/node.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,8 @@ const std::vector<impl_desc_type>& MKLDNNNode::getPrimitivesPriority() {
868868
impl_desc_type::jit_avx512_amx_dw,
869869
impl_desc_type::jit_avx512_amx_1x1,
870870
impl_desc_type::jit_avx512_amx,
871-
// Brgconv kernels disabled in order to prevent perf degradations on non AMX HW
872-
// impl_desc_type::brgconv_avx512_1x1,
873-
// impl_desc_type::brgconv_avx512,
871+
impl_desc_type::brgconv_avx512_1x1,
872+
impl_desc_type::brgconv_avx512,
874873
impl_desc_type::jit_uni_dw,
875874
impl_desc_type::jit_uni_1x1,
876875
impl_desc_type::jit_uni,

src/plugins/intel_cpu/src/nodes/conv.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,13 @@ void MKLDNNConvolutionNode::getSupportedDescriptors() {
465465
auto inputShape = getInputShapeAtPort(0);
466466
auto outputShape = getOutputShapeAtPort(0);
467467

468+
if (one_of(inputDataType, memory::data_type::f32, memory::data_type::bf16) &&
469+
impl::cpu::x64::mayiuse(impl::cpu::x64::avx512_core)) {
470+
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nspc);
471+
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nspc);
472+
createDescriptor({ in_candidate }, { out_candidate });
473+
}
474+
468475
if (IC == 1 && groupOC == 1) {
469476
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
470477
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, ncsp);
@@ -488,7 +495,9 @@ void MKLDNNConvolutionNode::getSupportedDescriptors() {
488495
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, ncsp);
489496
createDescriptor({ in_candidate }, { out_candidate });
490497

491-
if (inputDataType != memory::data_type::bf16 && isNspcAvailable()) {
498+
if ((inputDataType != memory::data_type::bf16 && isNspcAvailable()) ||
499+
(one_of(inputDataType, memory::data_type::f32, memory::data_type::bf16) &&
500+
impl::cpu::x64::mayiuse(impl::cpu::x64::avx512_core))) {
492501
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nspc);
493502
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nspc);
494503
createDescriptor({ in_candidate }, { out_candidate });

0 commit comments

Comments
 (0)