Skip to content

Commit

Permalink
Adjusted Convolution descriptors list
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-gorokhov committed Jan 10, 2023
1 parent 282abb5 commit ee7f70a
Showing 1 changed file with 28 additions and 38 deletions.
66 changes: 28 additions & 38 deletions src/plugins/intel_cpu/src/nodes/conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,49 +547,39 @@ void Convolution::getSupportedDescriptors() {
bool acceptedFormat = inputDataType == memory::data_type::bf16;
bool nspcAdded = false;
acceptedFormat |= (shouldTryBrgconv && inputDataType == memory::data_type::f32);
// if (acceptedFormat && impl::cpu::x64::mayiuse(impl::cpu::x64::avx512_core)) {
// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nspc);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nspc);
// createDescriptor({ in_candidate }, { out_candidate });
// nspcAdded = true;
// }

// if (IC == 1 && groupOC == 1) {
// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, ncsp);
// createDescriptor({ in_candidate }, { out_candidate });
// } else if (IC < 4) {
// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp16c);
// createDescriptor({ in_candidate }, { out_candidate });
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp8c);
// createDescriptor({ in_candidate }, { out_candidate });
// } else {
// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nCsp16c);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp16c);
// createDescriptor({ in_candidate }, { out_candidate });
// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nCsp8c);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp8c);
// createDescriptor({ in_candidate }, { out_candidate });
// }

// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, ncsp);
// createDescriptor({ in_candidate }, { out_candidate });

// if (!nspcAdded && (inputDataType != memory::data_type::bf16 && isNspcAvailable())) {
// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nspc);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nspc);
// createDescriptor({ in_candidate }, { out_candidate });
// }
if (acceptedFormat && impl::cpu::x64::mayiuse(impl::cpu::x64::avx512_core)) {
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nspc);
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nspc);
createDescriptor({ in_candidate }, { out_candidate });
nspcAdded = true;
}

if (IC == 1 && groupOC == 1) {
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, ncsp);
createDescriptor({ in_candidate }, { out_candidate });
} else if (IC < 4) {
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp16c);
createDescriptor({ in_candidate }, { out_candidate });
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp8c);
createDescriptor({ in_candidate }, { out_candidate });
} else {
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nCsp16c);
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp16c);
createDescriptor({ in_candidate }, { out_candidate });
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nCsp8c);
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nCsp8c);
createDescriptor({ in_candidate }, { out_candidate });
}

in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, nspc);
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, nspc);
createDescriptor({ in_candidate }, { out_candidate });

// in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
// out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, ncsp);
// createDescriptor({ in_candidate }, { out_candidate });
in_candidate = std::make_shared<DnnlBlockedMemoryDesc>(inputShape, inputDataType, ncsp);
out_candidate = std::make_shared<DnnlBlockedMemoryDesc>(outputShape, outputDataType, ncsp);
createDescriptor({ in_candidate }, { out_candidate });
}
}
}
Expand Down

0 comments on commit ee7f70a

Please sign in to comment.