Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPU][ARM] Make f16 precision as default for CNN #22839

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/plugins/intel_cpu/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,7 @@ void Config::readProperties(const ov::AnyMap& prop, const ModelType modelType) {
if (executionMode == ov::hint::ExecutionMode::PERFORMANCE) {
inferencePrecision = ov::element::f32;
#if defined(OV_CPU_ARM_ENABLE_FP16)
// fp16 precision is used as default precision on ARM for non-convolution networks
// fp16 ACL convolution is slower than fp32
if (modelType != ModelType::CNN)
inferencePrecision = ov::element::f16;
inferencePrecision = ov::element::f16;
#else
if (mayiuse(avx512_core_bf16))
inferencePrecision = ov::element::bf16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class AutoBatching_Test : public OVPluginTestBase,

if (target_device.find("CPU") != std::string::npos) {
config.insert(ov::num_streams(static_cast<int32_t>(num_streams)));
config.insert(ov::hint::inference_precision(ov::element::f32));
}
// minimize timeout to reduce test time
config.insert(ov::auto_batch_timeout(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ TEST_P(CoreThreadingTestsWithIter, smoke_CompileModel_Accuracy_SingleCore) {
}

auto getOutputBlob = [&](ov::Core& core) {
auto compiled_model = core.compile_model(model, target_device);
ov::AnyMap f32_precision_property = {{ov::hint::inference_precision.name(), ov::element::f32.to_string()}};
auto compiled_model = core.compile_model(model, target_device, f32_precision_property);
auto req = compiled_model.create_infer_request();
for (const auto& input : inputs) {
req.set_tensor(input.first, input.second);
Expand Down Expand Up @@ -530,7 +531,8 @@ TEST_P(CoreThreadingTestsWithIter, smoke_CompileModel_Accuracy_MultipleCores) {
}

auto getOutputBlob = [&](ov::Core& core) {
auto compiled_model = core.compile_model(model, target_device);
ov::AnyMap f32_precision_property = {{ov::hint::inference_precision.name(), ov::element::f32.to_string()}};
auto compiled_model = core.compile_model(model, target_device, f32_precision_property);
auto req = compiled_model.create_infer_request();
for (const auto& input : inputs) {
req.set_tensor(input.first, input.second);
Expand Down
Loading