Skip to content

Commit

Permalink
Fix pre-commit issue (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui authored Feb 14, 2024
1 parent c20e4f7 commit 0a9de75
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ but the listed CMake argument can be used to override.

Configuration of OpenVINO for a model is done through the Parameters section of the model's 'config.pbtxt' file. The parameters and their description are as follows.

* `PERFORMANCE_HINT`: Presetting performance tunning options. Accepted values `LATENCY` for low concurrency use case and `THROUGHPUT` for high concurrency scenarios.
* `PERFORMANCE_HINT`: Presetting performance tuning options. Accepted values `LATENCY` for low concurrency use case and `THROUGHPUT` for high concurrency scenarios.
* `CPU_EXTENSION_PATH`: Required for CPU custom layers. Absolute path to a shared library with the kernels implementations.
* `INFERENCE_NUM_THREADS`: Maximum number of threads that can be used for inference tasks. Should be a non-negative number. Default is equal to number of cores.
* `COMPILATION_NUM_THREADS`: Maximum number of threads that can be used for compilation tasks. Should be a non-negative number.
Expand Down
22 changes: 12 additions & 10 deletions src/openvino.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ ModelState::ParseParameters(const std::string& device)
ParseParameter("COMPILATION_NUM_THREADS", params, &device_config));
RETURN_IF_ERROR(ParseParameter("HINT_BF16", params, &device_config));
RETURN_IF_ERROR(ParseParameter("NUM_STREAMS", params, &device_config));
RETURN_IF_ERROR(ParseParameter("PERFORMANCE_HINT", params, &device_config));
RETURN_IF_ERROR(
ParseParameter("PERFORMANCE_HINT", params, &device_config));
}
}

Expand Down Expand Up @@ -369,10 +370,9 @@ ModelState::ParseParameterHelper(
*ov_property = ov::streams::num(ov::streams::AUTO);
} else if (value->compare("numa") == 0) {
*ov_property = ov::streams::num(ov::streams::NUMA);
} else if (IsNumber(*value)){
} else if (IsNumber(*value)) {
*ov_property = ov::streams::num(std::stoi(*value));
}
else{
} else {
return TRITONSERVER_ErrorNew(
TRITONSERVER_ERROR_INVALID_ARG,
(std::string("expected the parameter '") + mkey +
Expand All @@ -381,20 +381,22 @@ ModelState::ParseParameterHelper(
}
} else if (mkey.compare("PERFORMANCE_HINT") == 0) {
if (value->compare("latency") == 0) {
*ov_property = ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY);
*ov_property =
ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY);
} else if (value->compare("throughput") == 0) {
*ov_property = ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT);
*ov_property =
ov::hint::performance_mode(ov::hint::PerformanceMode::THROUGHPUT);
} else if (value->compare("cumulative_throughput") == 0) {
*ov_property = ov::hint::performance_mode(ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT);
*ov_property = ov::hint::performance_mode(
ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT);
} else {
return TRITONSERVER_ErrorNew(
return TRITONSERVER_ErrorNew(
TRITONSERVER_ERROR_INVALID_ARG,
(std::string("expected the parameter '") + mkey +
"' to be LATENCY/THROUGHPUT/CUMULATIVE_THROUGHPUT, got " + *value)
.c_str());
}
}
else {
} else {
return TRITONSERVER_ErrorNew(
TRITONSERVER_ERROR_INVALID_ARG,
(std::string("the parameter '") + mkey +
Expand Down

0 comments on commit 0a9de75

Please sign in to comment.