Skip to content

Commit

Permalink
[API][AUTO] Fail to get PERF_COUNT from compiled_model (openvinotoolk…
Browse files Browse the repository at this point in the history
…it#23123)

### Details:
 - *Fail to get PERF_COUNT from compiled_model*

### Tickets:
 - *CVS-130349*
  • Loading branch information
Haiqi Pan authored and bbielawx committed Apr 12, 2024
1 parent 5e796a8 commit 2f42b43
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/plugins/auto/src/auto_compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ ov::Any AutoCompiledModel::get_property(const std::string& name) const {
ov::device::priorities,
ov::device::properties,
ov::hint::model_priority,
ov::loaded_from_cache};
ov::loaded_from_cache,
ov::enable_profiling};
return ro_properties;
};
const auto& default_rw_properties = []() {
Expand All @@ -63,6 +64,8 @@ ov::Any AutoCompiledModel::get_property(const std::string& name) const {
supported_properties.insert(supported_properties.end(), ro_properties.begin(), ro_properties.end());
supported_properties.insert(supported_properties.end(), rw_properties.begin(), rw_properties.end());
return decltype(ov::supported_properties)::value_type(supported_properties);
} else if (name == ov::enable_profiling) {
return m_context->m_need_perf_counters;
} else if (name == ov::hint::performance_mode) {
return m_context->m_performance_hint;
} else if (name == ov::device::priorities) {
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/auto/src/cumulative_compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ ov::Any AutoCumuCompiledModel::get_property(const std::string& name) const {
ov::device::properties,
ov::hint::model_priority,
ov::loaded_from_cache,
ov::intel_auto::schedule_policy};
ov::intel_auto::schedule_policy,
ov::enable_profiling};
return ro_properties;
};
const auto& default_rw_properties = []() {
Expand All @@ -63,6 +64,8 @@ ov::Any AutoCumuCompiledModel::get_property(const std::string& name) const {
supported_properties.insert(supported_properties.end(), ro_properties.begin(), ro_properties.end());
supported_properties.insert(supported_properties.end(), rw_properties.begin(), rw_properties.end());
return decltype(ov::supported_properties)::value_type(supported_properties);
} else if (name == ov::enable_profiling) {
return m_context->m_need_perf_counters;
} else if (name == ov::hint::performance_mode) {
return m_context->m_performance_hint;
} else if (name == ov::intel_auto::schedule_policy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "behavior/compiled_model/properties.hpp"

#include "openvino/runtime/auto/properties.hpp"
#include "openvino/runtime/properties.hpp"
#include "openvino/runtime/system_conf.hpp"

Expand Down Expand Up @@ -138,4 +139,24 @@ INSTANTIATE_TEST_SUITE_P(smoke_OVClassCompiledModelGetPropertyTest,
OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY,
::testing::Combine(::testing::Values("AUTO:TEMPLATE"),
::testing::ValuesIn(multiModelPriorityConfigs)));

const std::vector<ov::AnyMap> auto_default_properties = {
{ov::enable_profiling(false)},
{ov::hint::model_priority(ov::hint::Priority::MEDIUM)},
{ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)}};

INSTANTIATE_TEST_SUITE_P(smoke_Auto_Default_test,
OVClassCompiledModelPropertiesDefaultTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_AUTO),
::testing::ValuesIn(auto_default_properties)),
OVClassCompiledModelPropertiesDefaultTests::getTestCaseName);

const std::vector<ov::AnyMap> multi_default_properties = {{ov::enable_profiling(false)}};

INSTANTIATE_TEST_SUITE_P(smoke_Multi_Default_test,
OVClassCompiledModelPropertiesDefaultTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_TEMPLATE),
::testing::ValuesIn(multi_default_properties)),
OVClassCompiledModelPropertiesDefaultTests::getTestCaseName);

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const std::vector<ov::AnyMap> multi_Auto_properties = {
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::intel_auto::device_bind_buffer("NO")},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::intel_auto::enable_startup_fallback("YES")},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::intel_auto::enable_startup_fallback("NO")},
};
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::enable_profiling(true)},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::enable_profiling(false)}};

INSTANTIATE_TEST_SUITE_P(smoke_AutoMultiBehaviorTests,
OVPropertiesTests,
Expand All @@ -41,7 +42,9 @@ const std::vector<ov::AnyMap> multi_setcore_properties = {
const std::vector<ov::AnyMap> multi_compileModel_properties = {
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE),
ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT),
ov::hint::model_priority(ov::hint::Priority::MEDIUM)}};
ov::hint::model_priority(ov::hint::Priority::MEDIUM)},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::enable_profiling(true)},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::enable_profiling(false)}};

INSTANTIATE_TEST_SUITE_P(smoke_MultiCompileModelBehaviorTests,
OVSetPropComplieModleGetPropTests,
Expand Down Expand Up @@ -70,7 +73,9 @@ const std::vector<ov::AnyMap> auto_compileModel_properties = {
ov::hint::model_priority(ov::hint::Priority::MEDIUM)},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE),
ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT),
ov::hint::model_priority(ov::hint::Priority::MEDIUM)}};
ov::hint::model_priority(ov::hint::Priority::MEDIUM)},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::enable_profiling(true)},
{ov::device::priorities(ov::test::utils::DEVICE_TEMPLATE), ov::enable_profiling(false)}};

INSTANTIATE_TEST_SUITE_P(smoke_AutoCompileModelBehaviorTests,
OVSetPropComplieModleGetPropTests,
Expand Down

0 comments on commit 2f42b43

Please sign in to comment.