@@ -2574,14 +2574,6 @@ void Eltwise::initSupportedPrimitiveDescriptors() {
2574
2574
return ;
2575
2575
}
2576
2576
#endif
2577
- // To make attention_mask process align with SDPA layout
2578
- if (getAlgorithm () == Algorithm::EltwiseClamp) {
2579
- auto parentNode = getParentEdgeAt (0 )->getParent ();
2580
- if (Config::ModelType::LLM == context->getConfig ().modelType && " Ceiling" == parentNode->getTypeStr () &&
2581
- Algorithm::MathCeiling == parentNode->getAlgorithm ()) {
2582
- isChannelsFirstApplicable = false ;
2583
- }
2584
- }
2585
2577
2586
2578
#if defined(OV_CPU_WITH_SHL)
2587
2579
eltwiseAttrs = {algorithm, alpha, beta, gamma };
@@ -2599,11 +2591,19 @@ void Eltwise::initSupportedPrimitiveDescriptors() {
2599
2591
return ;
2600
2592
#endif
2601
2593
2602
- if (isChannelsFirstApplicable)
2603
- supportedPrimitiveDescriptors.emplace_back (initDesc (ChannelsFirst));
2604
- if (isBlockedApplicable)
2605
- supportedPrimitiveDescriptors.emplace_back (initDesc (Blocked));
2606
- supportedPrimitiveDescriptors.emplace_back (initDesc (Planar));
2594
+ if (context->getConfig ().modelType == Config::ModelType::CNN) {
2595
+ if (isChannelsFirstApplicable)
2596
+ supportedPrimitiveDescriptors.emplace_back (initDesc (ChannelsFirst));
2597
+ if (isBlockedApplicable)
2598
+ supportedPrimitiveDescriptors.emplace_back (initDesc (Blocked));
2599
+ supportedPrimitiveDescriptors.emplace_back (initDesc (Planar));
2600
+ } else {
2601
+ supportedPrimitiveDescriptors.emplace_back (initDesc (Planar));
2602
+ if (isChannelsFirstApplicable)
2603
+ supportedPrimitiveDescriptors.emplace_back (initDesc (ChannelsFirst));
2604
+ if (isBlockedApplicable)
2605
+ supportedPrimitiveDescriptors.emplace_back (initDesc (Blocked));
2606
+ }
2607
2607
}
2608
2608
2609
2609
void Eltwise::createPrimitive () {
0 commit comments