Added common ov::execution_mode hint (#15048)

* [GPU] Added common exec mode hint and gpu support

* Add ov::inference precision and update usages. Deprecate ov::hint::inference_precision property

* [GPU] Execution mode tests and fixes

* Fixed code style

* Moved execution_mode test to common. Fixes for python API

* Remove deprecations for hint::inference_precision and just keep both

* Fix test
This commit is contained in:
Vladimir Paramuzov
2023-01-18 20:13:00 +04:00
committed by GitHub
parent 53e699eaba
commit 2201a5f83e
38 changed files with 282 additions and 128 deletions

View File

@@ -500,13 +500,13 @@ int main(int argc, char* argv[]) {
auto it_device_infer_precision = device_infer_precision.find(device);
if (it_device_infer_precision != device_infer_precision.end()) {
// set to user defined value
if (supported(ov::hint::inference_precision.name())) {
device_config.emplace(ov::hint::inference_precision(it_device_infer_precision->second));
if (supported(ov::inference_precision.name())) {
device_config.emplace(ov::inference_precision(it_device_infer_precision->second));
} else if (device == "MULTI" || device == "AUTO") {
// check if the element contains the hardware device property
auto value_vec = split(it_device_infer_precision->second, ' ');
if (value_vec.size() == 1) {
auto key = ov::hint::inference_precision.name();
auto key = ov::inference_precision.name();
device_config[key] = it_device_infer_precision->second;
} else {
// set device inference_precison properties in the AUTO/MULTI plugin
@@ -523,16 +523,16 @@ int main(int argc, char* argv[]) {
is_dev_set_property[it.first] = false;
device_config.erase(it.first);
device_config.insert(
ov::device::properties(it.first, ov::hint::inference_precision(it.second)));
ov::device::properties(it.first, ov::inference_precision(it.second)));
} else {
auto& property = device_config[it.first].as<ov::AnyMap>();
property.emplace(ov::hint::inference_precision(it.second));
property.emplace(ov::inference_precision(it.second));
}
}
}
} else {
throw std::logic_error("Device " + device + " doesn't support config key '" +
ov::hint::inference_precision.name() + "'! " +
ov::inference_precision.name() + "'! " +
"Please specify -infer_precision for correct devices in format "
"<dev1>:<infer_precision1>,<dev2>:<infer_precision2>" +
" or via configuration file.");