OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[CPU] change Eltwise layout selection logic for x86 non-CNN ModelType (#26419)
Bo Liuce1bcd2a765f
diff --git a/src/plugins/intel_cpu/src/nodes/eltwise.cpp b/src/plugins/intel_cpu/src/nodes/eltwise.cppindex 1a898655769..f2f6ce503bd 100644--- a/src/plugins/intel_cpu/src/nodes/eltwise.cpp+++ b/src/plugins/intel_cpu/src/nodes/eltwise.cpp@@ -2591,11 +2591,19 @@ void Eltwise::initSupportedPrimitiveDescriptors() {return;#endif- if (isChannelsFirstApplicable)- supportedPrimitiveDescriptors.emplace_back(initDesc(ChannelsFirst));- if (isBlockedApplicable)- supportedPrimitiveDescriptors.emplace_back(initDesc(Blocked));- supportedPrimitiveDescriptors.emplace_back(initDesc(Planar));+ if (context->getConfig().modelType == Config::ModelType::CNN) {+ if (isChannelsFirstApplicable)+ supportedPrimitiveDescriptors.emplace_back(initDesc(ChannelsFirst));+ if (isBlockedApplicable)+ supportedPrimitiveDescriptors.emplace_back(initDesc(Blocked));+ supportedPrimitiveDescriptors.emplace_back(initDesc(Planar));+ } else {+ supportedPrimitiveDescriptors.emplace_back(initDesc(Planar));+ if (isChannelsFirstApplicable)+ supportedPrimitiveDescriptors.emplace_back(initDesc(ChannelsFirst));+ if (isBlockedApplicable)+ supportedPrimitiveDescriptors.emplace_back(initDesc(Blocked));+ }}void Eltwise::createPrimitive() {