Skip to content

Commit

Permalink
[CPU][ARM] Enable f16 Interpolate on ARM (#25961)
Browse files Browse the repository at this point in the history
### Details:
 - Lack of f16 Interpolation leads to additional Converts in `fastseg`.

### Tickets:
 - *ticket-id*
  • Loading branch information
alvoron authored Aug 12, 2024
1 parent e7bb434 commit 4f1f11b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/plugins/intel_cpu/src/nodes/interpolate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,13 @@ void Interpolate::initSupportedPrimitiveDescriptors() {
return;

ov::element::Type inputPrecision = getOriginalInputPrecisionAtPort(DATA_ID);
if ((inputPrecision != ov::element::i8) && (inputPrecision != ov::element::u8) && (inputPrecision != ov::element::bf16)) {

#if defined(OV_CPU_WITH_ACL)
bool isInputPrecisionSupported = one_of(inputPrecision, ov::element::i8, ov::element::u8, ov::element::f16);
#else
bool isInputPrecisionSupported = one_of(inputPrecision, ov::element::i8, ov::element::u8, ov::element::bf16);
#endif
if (!isInputPrecisionSupported) {
inputPrecision = ov::element::f32;
}

Expand All @@ -2039,9 +2045,11 @@ void Interpolate::initSupportedPrimitiveDescriptors() {
outputPrecision = fusedWith[fusedWith.size() - 1]->getOriginalOutputPrecisionAtPort(DATA_ID);
}

#if !defined(OV_CPU_WITH_ACL)
if (!mayiuse(cpu::x64::sse41)) {
inputPrecision = outputPrecision = ov::element::f32;
}
#endif

auto targetShapeType = ov::element::i32;
auto scalesType = ov::element::f32;
Expand Down Expand Up @@ -2115,6 +2123,8 @@ void Interpolate::initSupportedPrimitiveDescriptors() {
canUseAclExecutor = !supportedPrimitiveDescriptors.empty();
if (canUseAclExecutor)
return;
//fallback to f32 if ref is used
inputPrecision = outputPrecision = ov::element::f32;
#endif

if (dataRank == 4) {
Expand Down Expand Up @@ -2147,6 +2157,8 @@ void Interpolate::initSupportedPrimitiveDescriptors() {
canUseAclExecutor = !supportedPrimitiveDescriptors.empty();
if (canUseAclExecutor)
return;
//fallback to f32 if ref is used
inputPrecision = outputPrecision = ov::element::f32;
#endif

if (!mayiuse(cpu::x64::sse41) || interpAttrs.mode == InterpolateMode::linear) {
Expand Down

0 comments on commit 4f1f11b

Please sign in to comment.