From 93451fb29f99363dd1d5c8a0147ac28405564ef6 Mon Sep 17 00:00:00 2001 From: liubo-intel Date: Wed, 23 Oct 2024 01:23:54 -0400 Subject: [PATCH] add chanel first format support for rand=3 Deconv to use amx fp16 kernel --- src/plugins/intel_cpu/src/nodes/deconv.cpp | 20 ++++++------------- .../src/nodes/executors/acl/acl_convert.cpp | 6 ------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/deconv.cpp b/src/plugins/intel_cpu/src/nodes/deconv.cpp index c27bf2347833f7..cb340afc029304 100644 --- a/src/plugins/intel_cpu/src/nodes/deconv.cpp +++ b/src/plugins/intel_cpu/src/nodes/deconv.cpp @@ -426,8 +426,10 @@ std::vector Deconvolution::getAvailableFormatsForDims(const else if (dims.getRank() == 2) return {memory::format_tag::nc}; else if (dims.getRank() == 3) - return {memory::format_tag::tnc, memory::format_tag::ntc, - memory::format_tag::ncw, memory::format_tag::nCw8c, memory::format_tag::nCw16c }; + return {memory::format_tag::ncw, + memory::format_tag::nCw8c, + memory::format_tag::nCw16c, + memory::format_tag::nwc}; else if (dims.getRank() == 4) return {memory::format_tag::nchw, memory::format_tag::nChw8c, memory::format_tag::nChw16c, memory::format_tag::nhwc }; @@ -461,18 +463,8 @@ void Deconvolution::getSupportedDescriptors() { outputDataType = DnnlExtensionUtils::ElementTypeToDataType(outPrecision); if (inputDataType == memory::data_type::bf16 || outputDataType == memory::data_type::bf16) inputDataType = outputDataType = memory::data_type::bf16; - - if (inputDataType == memory::data_type::f16 || outputDataType == memory::data_type::f16) { - // TODO: remove this limitation after adding support for f16 in oneDNN MFDNN-12580 - if (std::any_of(deconvAttrs.stride.begin(), deconvAttrs.stride.end(), [](ptrdiff_t stride) { - return stride != 1; - })) { - inputDataType = outputDataType = memory::data_type::f32; - } else { - inputDataType = outputDataType = memory::data_type::f16; - } - } - + if (inputDataType == memory::data_type::f16 || outputDataType == memory::data_type::f16) + inputDataType = outputDataType = memory::data_type::f16; if (!fusedWith.empty()) { outputDataType = DnnlExtensionUtils::ElementTypeToDataType(fusedWith[fusedWith.size() - 1]->getOriginalOutputPrecisionAtPort(0)); } diff --git a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_convert.cpp b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_convert.cpp index 4c2c0d20e7813e..440af52749bc9c 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_convert.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_convert.cpp @@ -92,12 +92,6 @@ bool ACLConvertExecutorBuilder::isSupported(const ConvertParams& convertParams, DEBUG_LOG("NECopy does not support source precision: ", convertParams.srcPrc.to_string()); return false; } - auto srcDataLayout = getAclDataLayoutByMemoryDesc(srcDesc); - auto dstDataLayout = getAclDataLayoutByMemoryDesc(dstDesc); - if (srcDataLayout == DataLayout::UNKNOWN || dstDataLayout == DataLayout::UNKNOWN) { - DEBUG_LOG("NECopy does not support source or destination layout"); - return false; - } if ((convertParams.srcPrc == ov::element::i8 && !one_of(convertParams.dstPrc, ov::element::i16, ov::element::i32,