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

[API][AUTO] Fail to get PERF_COUNT from compiled_model #23123

Merged
merged 21 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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: 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};
peterchen-intel marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -54,6 +54,12 @@ INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests,
::testing::ValuesIn(multi_properties)),
OVClassCompiledModelPropertiesTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests,
OVClassAutoCheckProfiling,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_MULTI),
::testing::ValuesIn(multi_properties)),
OVClassCompiledModelPropertiesTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_OVCompiledModelIncorrectDevice,
OVCompiledModelIncorrectDevice,
::testing::Values("TEMPLATE"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ using OVClassCompiledModelPropertiesDefaultTests = OVClassCompiledModelPropertie
using OVClassCompiledModelPropertiesIncorrectTests = OVClassCompiledModelPropertiesTests;
using OVCompiledModelIncorrectDevice = OVClassBaseTestP;
using OVClassCompileModelWithCorrectPropertiesTest = OVClassCompiledModelPropertiesTests;
using OVClassAutoCheckProfiling = OVClassCompiledModelPropertiesTests;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should avoid this


class OVClassCompiledModelSetCorrectConfigTest :
public OVClassNetworkTest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ TEST_P(OVClassCompiledModelPropertiesTests, canCompileModelWithPropertiesAndChec
}
}

TEST_P(OVClassAutoCheckProfiling, canCompileModelWithProfilingAndCheckProfiling) {
auto compiled_model = core->compile_model(model, target_device, properties);
OV_ASSERT_NO_THROW(auto enable_profiling = compiled_model.get_property(ov::enable_profiling));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should avoid enable Auto specific cases in shared tests
and try leverage existing test or use unit tests to cover

Copy link
Contributor

@yangwang201911 yangwang201911 Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refer to this AUTO test case [here] to set property with no throw(

).
Refer to this test case [here] to set property and get property correctly (
TEST_P(OVClassCompiledModelSetCorrectConfigTest, canSetConfig) {
)
Refer to this test case to check the default value of added property [here] ) .

TEST_P(OVClassCompileModelWithCorrectPropertiesTest, IgnoreEnableMMap) {
if (target_device.find("HETERO:") == 0 || target_device.find("MULTI:") == 0 || target_device.find("AUTO:") == 0 ||
target_device.find("BATCH:") == 0)
Expand Down
Loading