Skip to content

Commit

Permalink
replace ref_f16 Deconv kernels with jit_f32 kernels before oneDNN sup…
Browse files Browse the repository at this point in the history
…port for model performance on GNR, e.g. hifigan
  • Loading branch information
liubo-intel committed Oct 16, 2024
1 parent c714284 commit e80205d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/plugins/intel_cpu/src/nodes/deconv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,21 @@ 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)
inputDataType = outputDataType = memory::data_type::f16;

if (inputDataType == memory::data_type::f16 || outputDataType == memory::data_type::f16) {
bool hasStrides = false;
for (size_t i = 0; i < deconvAttrs.stride.size(); i++) {
if (deconvAttrs.stride[i] != 1) {
hasStrides = true;
break;
}
}
if (hasStrides)
inputDataType = outputDataType = memory::data_type::f32;
else
inputDataType = outputDataType = memory::data_type::f16;
}

if (!fusedWith.empty()) {
outputDataType = DnnlExtensionUtils::ElementTypeToDataType(fusedWith[fusedWith.size() - 1]->getOriginalOutputPrecisionAtPort(0));
}
Expand Down

0 comments on commit e80205d

Please sign in to comment.