Skip to content

Commit

Permalink
[CPU] remove OPENVINO_SUPPRESS_DEPRECATED_START/END (openvinotoolkit#…
Browse files Browse the repository at this point in the history
  • Loading branch information
riverlijunjie authored Jan 22, 2024
1 parent 02c47e4 commit c39b1f6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 58 deletions.
43 changes: 0 additions & 43 deletions src/plugins/intel_cpu/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ void Config::readProperties(const ov::AnyMap& prop, const ModelType modelType) {
ov::internal::exclusive_async_requests.name(),
". Expected only true/false");
}
OPENVINO_SUPPRESS_DEPRECATED_START
} else if (key.compare(InferenceEngine::PluginConfigParams::KEY_DUMP_EXEC_GRAPH_AS_DOT) == 0) {
// empty string means that dumping is switched off
dumpToDot = val.as<std::string>();
OPENVINO_SUPPRESS_DEPRECATED_END
} else if (key == ov::intel_cpu::lp_transforms_mode.name()) {
try {
lpTransformsMode = val.as<bool>() ? LPTransformsMode::On : LPTransformsMode::Off;
Expand All @@ -217,29 +212,6 @@ void Config::readProperties(const ov::AnyMap& prop, const ModelType modelType) {
if (!device_id.empty()) {
OPENVINO_THROW("CPU plugin supports only '' as device id");
}
OPENVINO_SUPPRESS_DEPRECATED_START
} else if (key == InferenceEngine::PluginConfigParams::KEY_ENFORCE_BF16) {
bool enable;
try {
enable = val.as<bool>();
} catch (ov::Exception&) {
OPENVINO_THROW("Wrong value ",
val.as<std::string>(),
" for property key ",
key,
". Expected only true/false");
}
if (enable) {
if (hasHardwareSupport(ov::element::bf16)) {
inferencePrecision = ov::element::bf16;
} else {
OPENVINO_THROW("Platform doesn't support BF16 format");
}
} else {
inferencePrecision = ov::element::f32;
}
inferencePrecisionSetExplicitly = true;
OPENVINO_SUPPRESS_DEPRECATED_END
} else if (key == ov::hint::inference_precision.name()) {
try {
auto const prec = val.as<ov::element::Type>();
Expand Down Expand Up @@ -391,21 +363,6 @@ void Config::updateProperties() {

_config.insert({ov::hint::performance_mode.name(), ov::util::to_string(hintPerfMode)});
_config.insert({ov::hint::num_requests.name(), std::to_string(hintNumRequests)});

OPENVINO_SUPPRESS_DEPRECATED_START
if (inferencePrecision == ov::element::bf16) {
_config.insert(
{InferenceEngine::PluginConfigParams::KEY_ENFORCE_BF16, InferenceEngine::PluginConfigParams::YES});
} else {
_config.insert(
{InferenceEngine::PluginConfigParams::KEY_ENFORCE_BF16, InferenceEngine::PluginConfigParams::NO});
}
_config.insert({InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS,
std::to_string(streamExecutorConfig._streams)});
_config.insert(
{InferenceEngine::PluginConfigParams::KEY_CPU_THREADS_NUM, std::to_string(streamExecutorConfig._threads)});
_config.insert({InferenceEngine::PluginConfigParams::KEY_DUMP_EXEC_GRAPH_AS_DOT, dumpToDot});
OPENVINO_SUPPRESS_DEPRECATED_END
}

} // namespace intel_cpu
Expand Down
10 changes: 0 additions & 10 deletions src/plugins/intel_cpu/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,8 @@ void Engine::apply_performance_hints(ov::AnyMap& config, const std::shared_ptr<o

const auto perf_hint_name = getPerfHintName();
if (perf_hint_name == ov::util::to_string(ov::hint::PerformanceMode::LATENCY)) {
OPENVINO_SUPPRESS_DEPRECATED_START
config[CONFIG_KEY(CPU_THROUGHPUT_STREAMS)] = CONFIG_VALUE(CPU_THROUGHPUT_NUMA);
OPENVINO_SUPPRESS_DEPRECATED_END
config[ov::num_streams.name()] = latency_hints;
} else if (perf_hint_name == ov::util::to_string(ov::hint::PerformanceMode::THROUGHPUT)) {
OPENVINO_SUPPRESS_DEPRECATED_START
config[CONFIG_KEY(CPU_THROUGHPUT_STREAMS)] = tput_hints.first;
OPENVINO_SUPPRESS_DEPRECATED_END
config[ov::num_streams.name()] = tput_hints.first;
config[ov::threading::big_core_streams.name()] = std::to_string(tput_hints.second.big_core_streams);
config[ov::threading::small_core_streams.name()] = std::to_string(tput_hints.second.small_core_streams);
Expand Down Expand Up @@ -329,10 +323,6 @@ void Engine::get_performance_streams(Config& config, const std::shared_ptr<ov::M
} else {
config.streamExecutorConfig.set_config_zero_stream();
}

OPENVINO_SUPPRESS_DEPRECATED_START
config._config[CONFIG_KEY(CPU_THROUGHPUT_STREAMS)] = std::to_string(config.streamExecutorConfig._streams);
OPENVINO_SUPPRESS_DEPRECATED_END
}

void Engine::calculate_streams(Config& conf, const std::shared_ptr<ov::Model>& model, bool imported) const {
Expand Down
5 changes: 0 additions & 5 deletions src/plugins/intel_cpu/src/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ static void setInfo(pugi::xml_node& root, std::shared_ptr<ov::Model>& model) {
ModelSerializer::ModelSerializer(std::ostream& ostream) : _ostream(ostream) {}

void ModelSerializer::operator<<(const std::shared_ptr<ov::Model>& model) {
OPENVINO_SUPPRESS_DEPRECATED_START
auto serializeInfo = [&](std::ostream& stream) {
const std::string name = "cnndata";
pugi::xml_document xml_doc;
Expand All @@ -41,9 +40,7 @@ void ModelSerializer::operator<<(const std::shared_ptr<ov::Model>& model) {
xml_doc.save(stream);
};

// Serialize to old representation in case of old API
ov::pass::StreamSerialize serializer(_ostream, serializeInfo);
OPENVINO_SUPPRESS_DEPRECATED_END
serializer.run_on_model(std::const_pointer_cast<ov::Model>(model->clone()));
}

Expand All @@ -64,7 +61,6 @@ void ModelDeserializer::operator>>(std::shared_ptr<ov::Model>& model) {
// read model input/output precisions
_istream.seekg(hdr.custom_data_offset);

OPENVINO_SUPPRESS_DEPRECATED_START
pugi::xml_document xmlInOutDoc;
if (hdr.custom_data_size > 0) {
std::string xmlInOutString;
Expand All @@ -75,7 +71,6 @@ void ModelDeserializer::operator>>(std::shared_ptr<ov::Model>& model) {
OPENVINO_THROW("NetworkNotRead: The inputs and outputs information is invalid.");
}
}
OPENVINO_SUPPRESS_DEPRECATED_END

// read blob content
_istream.seekg(hdr.consts_offset);
Expand Down

0 comments on commit c39b1f6

Please sign in to comment.