Conversion fail for ov::hint::performance_mode with UNDEFINED value (#15903)

* Update ov::hint::performance_hint UNDEFINED value from empty string to "UNDEFINED".
Update benchmark Python version.
Update the description about hint setting within benchmark APP README and help message.

* Drop the reduntant changes.
This commit is contained in:
Wang, Yang
2023-02-23 21:28:02 +08:00
committed by GitHub
parent 0283bce431
commit 5a463d9886
7 changed files with 11 additions and 11 deletions

View File

@@ -121,7 +121,7 @@ Options:
'throughput' or 'tput': device performance mode will be set to THROUGHPUT.
'cumulative_throughput' or 'ctput': device performance mode will be set to CUMULATIVE_THROUGHPUT.
'latency': device performance mode will be set to LATENCY.
'none': no device performance mode will be set.
'none': device performance mode will be set to UNDEFINED.
Using explicit 'nstreams' or other device-specific options, please set hint to 'none'
-api "<sync/async>" Optional (deprecated). Enable Sync/Async API. Default value is "async".
-niter "<integer>" Optional. Number of iterations. If not specified, the number of iterations is calculated depending on a device.

View File

@@ -41,7 +41,7 @@ static const char hint_message[] =
" 'cumulative_throughput' or 'ctput': device performance mode will be set to "
"CUMULATIVE_THROUGHPUT.\n"
" 'latency': device performance mode will be set to LATENCY.\n"
" 'none': no device performance mode will be set.\n"
" 'none': device performance mode will be set to UNDEFINED.\n"
" Using explicit 'nstreams' or other device-specific options, please set hint to "
"'none'";

View File

@@ -13,7 +13,7 @@
namespace InferenceEngine {
struct PerfHintsConfig {
std::string ovPerfHint = "";
std::string ovPerfHint = "UNDEFINED";
int ovPerfHintNumRequests = 0;
/**
@@ -73,12 +73,12 @@ struct PerfHintsConfig {
*/
static std::string CheckPerformanceHintValue(const std::string& val) {
if (val == PluginConfigParams::LATENCY || val == PluginConfigParams::THROUGHPUT ||
val == PluginConfigParams::CUMULATIVE_THROUGHPUT || val == "")
val == PluginConfigParams::CUMULATIVE_THROUGHPUT || val == PluginConfigParams::UNDEFINED)
return val;
else
IE_THROW() << "Wrong value for property key " << PluginConfigParams::KEY_PERFORMANCE_HINT
<< ". Expected only " << PluginConfigParams::LATENCY << "/" << PluginConfigParams::THROUGHPUT
<< "/" << PluginConfigParams::CUMULATIVE_THROUGHPUT;
<< "/" << PluginConfigParams::CUMULATIVE_THROUGHPUT << "/" << PluginConfigParams::UNDEFINED;
}
/**

View File

@@ -268,6 +268,7 @@ DECLARE_CONFIG_VALUE(MODEL_PRIORITY_LOW);
DECLARE_CONFIG_KEY(PERFORMANCE_HINT);
DECLARE_CONFIG_VALUE(LATENCY);
DECLARE_CONFIG_VALUE(THROUGHPUT);
DECLARE_CONFIG_VALUE(UNDEFINED);
DECLARE_CONFIG_VALUE(CUMULATIVE_THROUGHPUT);
/**
* @brief (Optional) config key that backs the (above) Performance Hints

View File

@@ -302,7 +302,7 @@ enum class PerformanceMode {
inline std::ostream& operator<<(std::ostream& os, const PerformanceMode& performance_mode) {
switch (performance_mode) {
case PerformanceMode::UNDEFINED:
return os << "";
return os << "UNDEFINED";
case PerformanceMode::LATENCY:
return os << "LATENCY";
case PerformanceMode::THROUGHPUT:
@@ -323,7 +323,7 @@ inline std::istream& operator>>(std::istream& is, PerformanceMode& performance_m
performance_mode = PerformanceMode::THROUGHPUT;
} else if (str == "CUMULATIVE_THROUGHPUT") {
performance_mode = PerformanceMode::CUMULATIVE_THROUGHPUT;
} else if (str == "") {
} else if (str == "UNDEFINED") {
performance_mode = PerformanceMode::UNDEFINED;
} else {
throw ov::Exception{"Unsupported performance mode: " + str};

View File

@@ -29,9 +29,8 @@ const std::map<std::string, std::string> supportedConfigKeysWithDefaults = {
{GNA_CONFIG_KEY(LIB_N_THREADS), "1"},
{CONFIG_KEY(SINGLE_THREAD), CONFIG_VALUE(YES)},
{CONFIG_KEY(LOG_LEVEL), PluginConfigParams::LOG_NONE},
{CONFIG_KEY(PERFORMANCE_HINT), ""},
{CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS), "1"}
};
{CONFIG_KEY(PERFORMANCE_HINT), "UNDEFINED"},
{CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS), "1"}};
IE_SUPPRESS_DEPRECATED_END
class GNAPluginConfigTest : public ::testing::Test {

View File

@@ -112,7 +112,7 @@ def main():
if is_flag_set_in_command_line('hint'):
if args.perf_hint=='none':
logger.warning(f"No device {device} performance hint is set.")
args.perf_hint = ''
args.perf_hint = 'UNDEFINED'
else:
args.perf_hint = "THROUGHPUT" if benchmark.api_type == "async" else "LATENCY"
logger.warning(f"Performance hint was not explicitly specified in command line. " +