Revert inference precision to be a hint (#16634)
This commit is contained in:
1 parent
7d8f4af78a
commit
0250f62d11
38 files changed
+126
-134
No files matched your search
@@ -327,7 +327,7 @@ DEFINE_string(nstreams, "", infer_num_streams_message);
|
||||
/// @brief Define flag for inference only mode <br>
|
||||
DEFINE_bool(inference_only, true, inference_only_message);
|
||||
|
||||
/// @brief Define flag for inference precision
|
||||
/// @brief Define flag for inference precision hint
|
||||
DEFINE_string(infer_precision, "", inference_precision_message);
|
||||
|
||||
/// @brief Specify precision for all input layers of the network
|
||||
|
||||
@@ -481,17 +481,17 @@ 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::inference_precision.name())) {
|
||||
device_config.emplace(ov::inference_precision(it_device_infer_precision->second));
|
||||
if (supported(ov::hint::inference_precision.name())) {
|
||||
device_config.emplace(ov::hint::inference_precision(it_device_infer_precision->second));
|
||||
} else if (is_virtual_device(device)) {
|
||||
update_device_config_for_virtual_device(it_device_infer_precision->second,
|
||||
device_config,
|
||||
ov::inference_precision,
|
||||
ov::hint::inference_precision,
|
||||
is_dev_set_property,
|
||||
is_load_config);
|
||||
} else {
|
||||
throw std::logic_error("Device " + device + " doesn't support config key '" +
|
||||
ov::inference_precision.name() + "'! " +
|
||||
ov::hint::inference_precision.name() + "'! " +
|
||||
"Please specify -infer_precision for correct devices in format "
|
||||
"<dev1>:<infer_precision1>,<dev2>:<infer_precision2>" +
|
||||
" or via configuration file.");
|
||||
|
||||
@@ -200,7 +200,7 @@ void update_device_config_for_virtual_device(const std::string& value,
|
||||
const auto& device_value = it.second;
|
||||
if (device_config.find(ov::device::properties.name()) == device_config.end() ||
|
||||
(is_load_config && is_dev_set_property[device_name])) {
|
||||
// Create ov::device::properties with ov::num_stream/ov::inference_precision and
|
||||
// Create ov::device::properties with ov::num_stream/ov::hint::inference_precision and
|
||||
// 1. Insert this ov::device::properties into device config if this
|
||||
// ov::device::properties isn't existed. Otherwise,
|
||||
// 2. Replace the existed ov::device::properties within device config.
|
||||
|
||||
@@ -220,7 +220,7 @@ int main(int argc, char* argv[]) {
|
||||
gnaPluginConfig[ov::intel_gna::scale_factors_per_input.name()] = scale_factors_per_input;
|
||||
}
|
||||
}
|
||||
gnaPluginConfig[ov::inference_precision.name()] = (FLAGS_qb == 8) ? ov::element::i8 : ov::element::i16;
|
||||
gnaPluginConfig[ov::hint::inference_precision.name()] = (FLAGS_qb == 8) ? ov::element::i8 : ov::element::i16;
|
||||
const std::unordered_map<std::string, ov::intel_gna::HWGeneration> StringHWGenerationMap{
|
||||
{"GNA_TARGET_1_0", ov::intel_gna::HWGeneration::GNA_1_0},
|
||||
{"GNA_TARGET_2_0", ov::intel_gna::HWGeneration::GNA_2_0},
|
||||
|
||||
Reference in new issue
Block a user