From 5aa03f8e30655efbba0352a4a0726010510d6e10 Mon Sep 17 00:00:00 2001 From: Georgy Krivoruchko Date: Sat, 17 Jun 2023 11:25:19 +0400 Subject: [PATCH 01/44] [TF FE] Extended support of tagged MetaGraphs and variables handling in SavedModel (#18084) * Added support of alternate MetaGraph tags Added support of variables without explicit RestoreV2 * Applied comments --- .../tensorflow/src/checkpoint_utils.hpp | 1 + src/frontends/tensorflow/src/frontend.cpp | 47 ++++-- .../src/graph_iterator_saved_model.cpp | 25 +++ .../src/graph_iterator_saved_model.hpp | 146 +++++++++++------- .../tensorflow/src/op/var_handle.cpp | 4 + .../tensorflow/tests/convert_saved_model.cpp | 14 ++ .../generate_saved_model_multi-graph.py | 48 ++++++ .../tools/mo/moc_frontend/pipeline.py | 5 +- 8 files changed, 222 insertions(+), 68 deletions(-) create mode 100644 src/frontends/tensorflow/tests/test_models/gen_scripts/generate_saved_model_multi-graph.py diff --git a/src/frontends/tensorflow/src/checkpoint_utils.hpp b/src/frontends/tensorflow/src/checkpoint_utils.hpp index 07ffb2d7ecb..f83bef87e83 100644 --- a/src/frontends/tensorflow/src/checkpoint_utils.hpp +++ b/src/frontends/tensorflow/src/checkpoint_utils.hpp @@ -18,6 +18,7 @@ namespace tensorflow { #define VARIABLES_INDEX_FOOTER_SIZE 48 #define BLOCK_TRAILER_SIZE 5 #define SAVED_TENSOR_SLICES_KEY "" +#define META_GRAPH_DEFAULT_TAG "serve" template static T smUnpack(char*& ptr, const char* ptr_end) { diff --git a/src/frontends/tensorflow/src/frontend.cpp b/src/frontends/tensorflow/src/frontend.cpp index 06036576354..676f6a30c46 100644 --- a/src/frontends/tensorflow/src/frontend.cpp +++ b/src/frontends/tensorflow/src/frontend.cpp @@ -137,6 +137,9 @@ bool FrontEnd::supported_impl(const std::vector& variants) const { } else if (GraphIteratorProtoTxt::is_supported(model_path)) { // text protobuf format with checkpoints return true; + } else if (GraphIteratorSavedModel::is_supported(model_path)) { + // saved model format with tagged metagraphs + return true; } } #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) @@ -167,6 +170,9 @@ bool FrontEnd::supported_impl(const std::vector& variants) const { } else if (GraphIteratorProtoTxt::is_supported(model_path)) { // text protobuf format with checkpoints return true; + } else if (GraphIteratorSavedModel::is_supported(model_path)) { + // saved model format with tagged metagraphs + return true; } } #endif @@ -194,11 +200,7 @@ ov::frontend::InputModel::Ptr FrontEnd::load_impl(const std::vector& va return std::make_shared(std::make_shared(model_path), m_telemetry); } else if (GraphIteratorSavedModel::is_supported(model_path)) { std::shared_ptr graph_iterator; - if (variants.size() > 1 && variants[1].is()) { - graph_iterator = std::make_shared(model_path, variants[1].as()); - } else { - graph_iterator = std::make_shared(model_path, std::string("serve")); - } + graph_iterator = std::make_shared(model_path, std::string("serve")); return std::make_shared(graph_iterator, m_telemetry, graph_iterator->get_variables_index(), @@ -249,6 +251,18 @@ ov::frontend::InputModel::Ptr FrontEnd::load_impl(const std::vector& va graph_iterator->get_checkpoint_v1_reader(), false); } + auto saved_model_tags = paths[1]; + if (GraphIteratorSavedModel::is_supported(model_path)) { + std::shared_ptr graph_iterator; + graph_iterator = std::make_shared(model_path, saved_model_tags); + return std::make_shared(graph_iterator, + m_telemetry, + graph_iterator->get_variables_index(), + graph_iterator->get_saved_model_input_names(), + graph_iterator->get_saved_model_output_names(), + nullptr, + true); + } } #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) else if (variants[0].is()) { @@ -258,13 +272,7 @@ ov::frontend::InputModel::Ptr FrontEnd::load_impl(const std::vector& va return std::make_shared(std::make_shared(model_path), m_telemetry); } else if (GraphIteratorSavedModel::is_supported(model_path)) { std::shared_ptr graph_iterator; - if (variants.size() > 1 && variants[1].is()) { - graph_iterator = std::make_shared( - model_path, - ov::util::wstring_to_string(variants[1].as())); - } else { - graph_iterator = std::make_shared(model_path, std::string("serve")); - } + graph_iterator = std::make_shared(model_path, std::string(META_GRAPH_DEFAULT_TAG)); return std::make_shared(graph_iterator, m_telemetry, graph_iterator->get_variables_index(), @@ -315,6 +323,18 @@ ov::frontend::InputModel::Ptr FrontEnd::load_impl(const std::vector& va graph_iterator->get_checkpoint_v1_reader(), false); } + auto saved_model_tags = ov::util::wstring_to_string(paths[1]); + if (GraphIteratorSavedModel::is_supported(model_path)) { + std::shared_ptr graph_iterator; + graph_iterator = std::make_shared(model_path, saved_model_tags); + return std::make_shared(graph_iterator, + m_telemetry, + graph_iterator->get_variables_index(), + graph_iterator->get_saved_model_input_names(), + graph_iterator->get_saved_model_output_names(), + nullptr, + true); + } } #endif else if (variants[0].is()) { @@ -362,7 +382,8 @@ std::shared_ptr FrontEnd::convert(const ov::frontend::InputModel::Ptr ++counter; } exception_message - << "\nTo facilitate the conversion of unsupported operations, refer to Frontend Extension documentation: " + << "\nTo facilitate the conversion of unsupported operations, refer to Frontend Extension " + "documentation: " "https://docs.openvino.ai/latest/openvino_docs_Extensibility_UG_Frontend_Extensions.html \n"; } diff --git a/src/frontends/tensorflow/src/graph_iterator_saved_model.cpp b/src/frontends/tensorflow/src/graph_iterator_saved_model.cpp index 1d22d20f442..ece0148d19b 100644 --- a/src/frontends/tensorflow/src/graph_iterator_saved_model.cpp +++ b/src/frontends/tensorflow/src/graph_iterator_saved_model.cpp @@ -72,6 +72,31 @@ std::basic_string get_variables_index_name() { } #endif +std::vector GraphIteratorSavedModel::split_tags(const std::string tags) const { + std::vector tag_list = {}; + std::size_t len = tags.length(); + if (len == 0) { + return tag_list; + } + std::string tag = ""; + std::size_t last_delimeter_pos = 0; + std::size_t delimeter_pos = std::string::npos; + while ((delimeter_pos = tags.find_first_of(",", last_delimeter_pos)) != std::string::npos) { + tag = tags.substr(last_delimeter_pos, delimeter_pos - last_delimeter_pos); + tag_list.push_back(tag); + last_delimeter_pos = delimeter_pos + 1; + } + if (last_delimeter_pos != std::string::npos) { + if (last_delimeter_pos < len) { + tag = tags.substr(last_delimeter_pos); + } else { + tag = ""; + } + tag_list.push_back(tag); + } + return tag_list; +} + } // namespace tensorflow } // namespace frontend } // namespace ov diff --git a/src/frontends/tensorflow/src/graph_iterator_saved_model.hpp b/src/frontends/tensorflow/src/graph_iterator_saved_model.hpp index d05378ff636..377e17c947e 100644 --- a/src/frontends/tensorflow/src/graph_iterator_saved_model.hpp +++ b/src/frontends/tensorflow/src/graph_iterator_saved_model.hpp @@ -70,84 +70,122 @@ private: bool read_saved_model(const std::basic_string& path, const std::string& tags) { std::basic_string save_model_path = path + get_saved_model_name(); std::ifstream sm_stream{save_model_path.c_str(), std::ifstream::in | std::ifstream::binary}; - FRONT_END_GENERAL_CHECK(sm_stream && sm_stream.is_open(), "Model file does not exist"); + FRONT_END_GENERAL_CHECK(sm_stream && sm_stream.is_open(), "[TensorFlow Frontend] Model file does not exist"); std::basic_string varIndexPath = path + get_variables_index_name(); if (ov::util::file_exists(varIndexPath)) { m_variables_index = std::make_shared(); std::ifstream vi_stream{varIndexPath.c_str(), std::ifstream::in | std::ifstream::binary}; FRONT_END_GENERAL_CHECK(vi_stream && vi_stream.is_open(), - "Saved Model's variable index file does not exist"); + "[TensorFlow Frontend] Saved Model's variable index file does not exist"); FRONT_END_GENERAL_CHECK(m_variables_index->read_variables(vi_stream, path), - "Saved Model's variable index file cannot be parsed"); + "[TensorFlow Frontend] Saved Model's variable index file cannot be parsed"); } bool res = m_saved_model->ParseFromIstream(&sm_stream); - FRONT_END_GENERAL_CHECK(res && m_saved_model->meta_graphs_size(), "Saved Model cannot be parsed"); + FRONT_END_GENERAL_CHECK(res && m_saved_model->meta_graphs_size(), + "[TensorFlow Frontend] Saved Model cannot be parsed"); + auto tag_list = split_tags(tags); + + // SavedModel can contain several MetaGraph with different tags. Look for MetaGraph with the required tag for (const auto& meta_graph : m_saved_model->meta_graphs()) { if (!meta_graph.has_graph_def()) { continue; } - if (m_saved_model->meta_graphs_size() > 1) { - bool tag_found = false; - for (const auto& tag : meta_graph.meta_info_def().tags()) { - if (tags.find(tag) != std::string::npos) { - tag_found = true; - break; - } - } - if (!tag_found) { - continue; - } + bool tag_found = false; + + if (meta_graph.meta_info_def().tags_size() > 0) { + tag_found = std::all_of(meta_graph.meta_info_def().tags().begin(), + meta_graph.meta_info_def().tags().end(), + [&tag_list](const std::string& tag) { + return std::find(tag_list.begin(), tag_list.end(), tag) != tag_list.end(); + }); } - std::map validSignatures = {}; - for (const auto& sit : meta_graph.signature_def()) { - const std::string& key = sit.first; - const ::tensorflow::SignatureDef& val = sit.second; - if (is_valid_signature(val)) { - validSignatures[key] = &val; - } + if (tag_found) { + return load_meta_graph(meta_graph); } - - // MetaGraph may have a list of signatures, but at this moment we need information only about - // "serving_default" signature which contains information about inputs/outputs names for the - // model. Situation when it is missing in a file also could be. - auto serving_default = validSignatures.find("serving_default"); - - if (serving_default != validSignatures.end()) { - m_inputs_map = std::make_shared>(); - m_outputs_map = std::make_shared>(); - for (const auto& input : serving_default->second->inputs()) { - (*m_inputs_map)[input.second.name()] = input.first; - } - for (const auto& output : serving_default->second->outputs()) { - (*m_outputs_map)[output.second.name()] = output.first; - } - } - - m_graph_def = std::make_shared<::tensorflow::GraphDef>(meta_graph.graph_def()); - - // Update variables map using information by resolving AssignVariableOp graph nodes - std::map var_map; - VariablesIndex::map_assignvariable(m_graph_def, var_map); - if (var_map.size() > 0 && m_variables_index.get() != nullptr) { - for (auto var : var_map) { - m_variables_index->map_variable(var.first, var.second); - } - } - - initialize_decoders_and_library(); - - return true; } - FRONT_END_GENERAL_CHECK(false, "Saved Model doesn't contain MetaGraph with requested tag"); + // Alternate behavior for working with "default tag" to support additional cases for read_model + if (tags == META_GRAPH_DEFAULT_TAG) { + // If we have only one MetaGraph - try to use it + if (m_saved_model->meta_graphs_size() == 1 && m_saved_model->meta_graphs(0).has_graph_def()) { + return load_meta_graph(m_saved_model->meta_graphs(0)); + } + + // If MetaGraph with tag == META_GRAPH_DEFAULT_TAG already found - we shouldn't reach this place. + // Otherwise we try to find a MetaGraph with no tags as an alternative + for (const auto& meta_graph : m_saved_model->meta_graphs()) { + if (!meta_graph.has_graph_def()) { + continue; + } + + if (meta_graph.meta_info_def().tags_size() == 0) { + return load_meta_graph(meta_graph); + } + } + + FRONT_END_GENERAL_CHECK(false, + "[TensorFlow Frontend] Saved Model doesn't contain any applicable MetaGraph"); + } + + FRONT_END_GENERAL_CHECK(false, + "[TensorFlow Frontend] Saved Model doesn't contain MetaGraph with requested tag"); return false; } + + /// \brief Does a loading of exact meta-graph + bool load_meta_graph(const ::tensorflow::MetaGraphDef& meta_graph) { + std::map validSignatures = {}; + for (const auto& sit : meta_graph.signature_def()) { + const std::string& key = sit.first; + const ::tensorflow::SignatureDef& val = sit.second; + if (is_valid_signature(val)) { + validSignatures[key] = &val; + } + } + + // MetaGraph may have a list of signatures, but at this moment we need information only about + // "serving_default" signature which contains information about inputs/outputs names for the + // model. Situation when it is missing in a file also could be. + auto serving_default = validSignatures.find("serving_default"); + + if (serving_default != validSignatures.end()) { + m_inputs_map = std::make_shared>(); + m_outputs_map = std::make_shared>(); + for (const auto& input : serving_default->second->inputs()) { + (*m_inputs_map)[input.second.name()] = input.first; + } + for (const auto& output : serving_default->second->outputs()) { + (*m_outputs_map)[output.second.name()] = output.first; + } + } + + m_graph_def = std::make_shared<::tensorflow::GraphDef>(meta_graph.graph_def()); + + // Update variables map using information by resolving AssignVariableOp graph nodes + std::map var_map; + VariablesIndex::map_assignvariable(m_graph_def, var_map); + if (var_map.size() > 0 && m_variables_index.get() != nullptr) { + for (auto var : var_map) { + m_variables_index->map_variable(var.first, var.second); + } + } + + initialize_decoders_and_library(); + + return true; + } + + /// \brief Splitting tags by using "," delimeter + /// \param[in] tags String with tags separated by "," + /// \return Returns vector with splitted tags, no trimming is used. When you pass "tag1, tag2" + /// you will have a vector ["tag1", " tag2"]. Because TensorFlow saves tags without trimming + std::vector split_tags(const std::string tags) const; }; // GraphIteratorSavedModel } // namespace tensorflow diff --git a/src/frontends/tensorflow/src/op/var_handle.cpp b/src/frontends/tensorflow/src/op/var_handle.cpp index bb8b1c11839..9f6819ccba4 100644 --- a/src/frontends/tensorflow/src/op/var_handle.cpp +++ b/src/frontends/tensorflow/src/op/var_handle.cpp @@ -67,6 +67,10 @@ OutputVector translate_varhandle_op(const NodeContext& node) { auto shape = node.get_attribute<::ov::PartialShape>("shape").get_shape(); bool result = var_index->get_mapped_variable(var_name, &entry_data, &entry_size); + if (!result) { + result = var_index->get_variable(var_name, &entry_data, &entry_size); + } + TENSORFLOW_OP_VALIDATION(node, result, "[TensorFlow Frontend] Internal error: Cannot find requested variable."); ::tensorflow::BundleEntryProto entry; diff --git a/src/frontends/tensorflow/tests/convert_saved_model.cpp b/src/frontends/tensorflow/tests/convert_saved_model.cpp index 1c67892ddc8..6979dfc792e 100644 --- a/src/frontends/tensorflow/tests/convert_saved_model.cpp +++ b/src/frontends/tensorflow/tests/convert_saved_model.cpp @@ -124,3 +124,17 @@ TEST_F(FrontEndConversionWithReferenceTestsF, SavedModelBroadcastIssue) { model_ref = make_shared(OutputVector{x}, ParameterVector{}); } } + +TEST_F(FrontEndConversionWithReferenceTestsF, SavedModelMultiGraph) { + // The test verifies loading of MetaGraph with empty tags as default + // And verifies loading variables with no corresponding RestoreV2 + { model = convert_model("saved_model_multi-graph"); } + { + // create a reference graph + auto x = make_shared(element::f32, Shape{2, 3}, vector{1, 2, 3, 3, 2, 1}); + auto y = make_shared(element::f32, Shape{1}); + auto add = make_shared(x, y); + + model_ref = make_shared(OutputVector{add}, ParameterVector{y}); + } +} diff --git a/src/frontends/tensorflow/tests/test_models/gen_scripts/generate_saved_model_multi-graph.py b/src/frontends/tensorflow/tests/test_models/gen_scripts/generate_saved_model_multi-graph.py new file mode 100644 index 00000000000..c7d5e051327 --- /dev/null +++ b/src/frontends/tensorflow/tests/test_models/gen_scripts/generate_saved_model_multi-graph.py @@ -0,0 +1,48 @@ +# Copyright (C) 2023 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +import os +import sys + +import tensorflow as tf + +export_dir = os.path.join(sys.argv[1], "saved_model_multi-graph") + +#Slash replacing required because otherwise fails on Windows +builder = tf.compat.v1.saved_model.Builder(export_dir if os.name != 'nt' else export_dir.replace("/", "\\")) + +# Create the graph and model +with tf.compat.v1.Session(graph=tf.Graph()) as sess: + x_value = [[1.,2.,3.],[3.,2.,1.]] + z_value = [[2.,2.,1.],[1.,1.,2.]] + tf_x = tf.compat.v1.Variable(x_value, name="custom_variable_name") + tf_y = tf.compat.v1.placeholder(dtype=tf.float32, shape=[1], name='y') + tf_z = tf.constant(z_value) + tf_add = tf.add(tf_x, tf_y, name="AddOperation") + tf_identity = tf.identity(tf_add, name="AddIdentity") + tf.subtract(tf_identity, tf_z, name="SubOperation") + sess.run(tf.compat.v1.global_variables_initializer()) + + builder.add_meta_graph_and_variables(sess, ["train"]) + +with tf.compat.v1.Session(graph=tf.Graph()) as sess: + x_value = [[1.,2.,3.],[3.,2.,1.]] + tf_x = tf.compat.v1.Variable(x_value, name="custom_variable_name") + tf_y = tf.compat.v1.placeholder(dtype=tf.float32, shape=[1], name='y') + tf_add = tf.add(tf_x, tf_y, name="AddOperation") + sess.run(tf.compat.v1.global_variables_initializer()) + + saver = tf.compat.v1.train.Saver(var_list=None, defer_build=True) + builder.add_meta_graph([], saver=saver) + +with tf.compat.v1.Session(graph=tf.Graph()) as sess: + x_value = [[1.,2.,3.],[3.,2.,1.]] + tf_x = tf.compat.v1.Variable(x_value, name="custom_variable_name") + tf_y = tf.compat.v1.placeholder(dtype=tf.float32, shape=[1], name='y') + tf_add = tf.subtract(tf_x, tf_y, name="SubOperation") + sess.run(tf.compat.v1.global_variables_initializer()) + + saver = tf.compat.v1.train.Saver(var_list=None, defer_build=True) + builder.add_meta_graph(["test","test2"], saver=saver) + +builder.save() diff --git a/tools/mo/openvino/tools/mo/moc_frontend/pipeline.py b/tools/mo/openvino/tools/mo/moc_frontend/pipeline.py index 32d43a698f6..f41fff6aa31 100644 --- a/tools/mo/openvino/tools/mo/moc_frontend/pipeline.py +++ b/tools/mo/openvino/tools/mo/moc_frontend/pipeline.py @@ -42,7 +42,10 @@ def moc_pipeline(argv: argparse.Namespace, moc_front_end: FrontEnd): # frozen model without v1 checkpoints input_model = moc_front_end.load(argv.input_model) elif argv.saved_model_dir: - input_model = moc_front_end.load(argv.saved_model_dir) + if argv.saved_model_tags: + input_model = moc_front_end.load([argv.saved_model_dir, argv.saved_model_tags]) + else: + input_model = moc_front_end.load(argv.saved_model_dir) elif argv.input_meta_graph: input_model = moc_front_end.load(argv.input_meta_graph) if argv.output: From 358893c758650e43eb5b2ffe045437aafdca1cd3 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 17 Jun 2023 15:22:38 +0400 Subject: [PATCH 02/44] Fixed compilaiton of ONNX FE tests (#18126) --- src/frontends/onnx/tests/op_extension.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/frontends/onnx/tests/op_extension.cpp b/src/frontends/onnx/tests/op_extension.cpp index c9320f276f4..2a02bdf5fdb 100644 --- a/src/frontends/onnx/tests/op_extension.cpp +++ b/src/frontends/onnx/tests/op_extension.cpp @@ -150,7 +150,8 @@ INSTANTIATE_TEST_SUITE_P(ONNXOpExtensionViaCommonConstructor, FrontEndOpExtensionTest::getTestCaseName); TEST(ONNXOpExtensionViaCommonConstructor, onnx_op_extension_via_template_arg_with_custom_domain) { - const auto ext = std::make_shared>("CustomRelu", "my_custom_domain"); + const auto ext = + std::make_shared>("CustomRelu", "my_custom_domain"); auto fe = std::make_shared(); fe->add_extension(ext); @@ -163,7 +164,8 @@ TEST(ONNXOpExtensionViaCommonConstructor, onnx_op_extension_via_template_arg_wit } TEST(ONNXOpExtensionViaCommonConstructor, onnx_op_extension_via_ov_type_name_with_custom_domain) { - const auto ext = std::make_shared>("opset1::Relu", "CustomRelu", "my_custom_domain"); + const auto ext = + std::make_shared>("opset1::Relu", "CustomRelu", "my_custom_domain"); auto fe = std::make_shared(); fe->add_extension(ext); @@ -199,7 +201,8 @@ TEST(ONNXOpExtensionViaCommonConstructor, onnx_op_extension_mixed_legacy_and_new ov::util::path_join({TEST_ONNX_MODELS_DIRNAME, "relu_custom_domain.onnx"})); ov::Core core; core.add_extension(std::make_shared()); - const auto new_api_ext = std::make_shared>("CustomRelu", "my_custom_domain"); + const auto new_api_ext = + std::make_shared>("CustomRelu", "my_custom_domain"); core.add_extension(new_api_ext); EXPECT_NO_THROW(core.read_model(input_model_path)); } From 26c4ed7ba8f685a2c1c253a184d153fbec67ec28 Mon Sep 17 00:00:00 2001 From: Georgiy Manuilov Date: Sat, 17 Jun 2023 15:49:41 +0200 Subject: [PATCH 03/44] Add workaround for MSVC141 bug evoking C2440 compilation error (#18122) MSVC141 fails to handle reinterpret cast of a template function pointer due to a bug in the compiler: https://developercommunity.visualstudio.com/t/bug-reinterpret-cast-address-of-templated-static-f/396044 --- src/plugins/intel_cpu/src/emitters/utils.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_cpu/src/emitters/utils.cpp b/src/plugins/intel_cpu/src/emitters/utils.cpp index 236be4118e3..4530c74a979 100644 --- a/src/plugins/intel_cpu/src/emitters/utils.cpp +++ b/src/plugins/intel_cpu/src/emitters/utils.cpp @@ -154,11 +154,14 @@ void RegPrinter::print_vmm(jit_generator &h, REG_T vmm, const char *name) { h.mov(abi_param2, reinterpret_cast(vmm.toString())); h.mov(abi_param1, reinterpret_cast(name)); if (vmm.isZMM()) { - h.mov(h.rax, reinterpret_cast(&print_vmm_prc)); + auto p = &print_vmm_prc; + h.mov(h.rax, reinterpret_cast(p)); } else if (vmm.isYMM()) { - h.mov(h.rax, reinterpret_cast(&print_vmm_prc)); + auto p = &print_vmm_prc; + h.mov(h.rax, reinterpret_cast(p)); } else { - h.mov(h.rax, reinterpret_cast(&print_vmm_prc)); + auto p = &print_vmm_prc; + h.mov(h.rax, reinterpret_cast(p)); } align_rsp(h); h.call(h.rax); @@ -191,7 +194,8 @@ void RegPrinter::print_reg(jit_generator &h, REG_T reg, const char *name) { h.mov(abi_param3, h.rsp); h.mov(abi_param2, reinterpret_cast(reg.toString())); h.mov(abi_param1, reinterpret_cast(name)); - h.mov(h.rax, reinterpret_cast(&print_reg_prc)); + auto p = &print_reg_prc; + h.mov(h.rax, reinterpret_cast(p)); align_rsp(h); h.call(h.rax); restore_rsp(h); From 3c623e890d01918c3f0bc16d52e922c6e3d4ce30 Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Sat, 17 Jun 2023 21:44:20 +0400 Subject: [PATCH 04/44] [MO][TF FE] Remove WA for supporting different TF formats (#18078) * [MO][TF FE] Remove WA for supporting different TF formats After providing direct support of all TensorFlow formats, we are ready to remove WA that converts all unsupported formats to frozen protobuf using native TensorFlow Signed-off-by: Kazantsev, Roman * Debug failure for LSTM multicell * Reset default graph before entering session * Remove temporal debug info --------- Signed-off-by: Kazantsev, Roman --- tools/mo/openvino/tools/mo/convert_impl.py | 26 +-- tools/mo/openvino/tools/mo/front/tf/loader.py | 42 +---- .../mo/front/tf/convert_to_pb_test.py | 163 ------------------ 3 files changed, 7 insertions(+), 224 deletions(-) delete mode 100644 tools/mo/unit_tests/mo/front/tf/convert_to_pb_test.py diff --git a/tools/mo/openvino/tools/mo/convert_impl.py b/tools/mo/openvino/tools/mo/convert_impl.py index dc42100144d..44028578caf 100644 --- a/tools/mo/openvino/tools/mo/convert_impl.py +++ b/tools/mo/openvino/tools/mo/convert_impl.py @@ -390,18 +390,12 @@ def prepare_ir(argv: argparse.Namespace): if moc_front_end: fallback_reasons = check_fallback(argv) if len(fallback_reasons) == 0: - path_to_aux_pb = None - orig_argv_values = {"input_model": argv.input_model, "model_name": argv.model_name} - if not argv.use_legacy_frontend and is_tf: - if tf_frontend_with_python_bindings_installed and 'tf' in available_moc_front_ends and \ - type_supported_by_tf_fe(argv.input_model): - argv.input_model = create_tf_graph_iterator(argv.input_model, - argv.placeholder_shapes, - argv.placeholder_data_types, - getattr(argv, "example_input", None)) - else: - from openvino.tools.mo.front.tf.loader import convert_to_pb - path_to_aux_pb = convert_to_pb(argv) + if is_tf and tf_frontend_with_python_bindings_installed and \ + type_supported_by_tf_fe(argv.input_model): + argv.input_model = create_tf_graph_iterator(argv.input_model, + argv.placeholder_shapes, + argv.placeholder_data_types, + getattr(argv, "example_input", None)) try: t.send_event("mo", "conversion_method", moc_front_end.get_name() + "_frontend") moc_front_end.add_extension(TelemetryExtension("mo", t.send_event, t.send_error, t.send_stack_trace)) @@ -424,14 +418,6 @@ def prepare_ir(argv: argparse.Namespace): # re-throw exception for all frontends except TensorFlow FE # and in case unexpected conversion failures raise - finally: - # TODO: remove this workaround once new TensorFlow frontend supports non-frozen formats: checkpoint, MetaGraph, and SavedModel - # Now it converts all TensorFlow formats to the frozen .pb format in case new TensorFlow frontend - if is_tf and path_to_aux_pb is not None: - argv.input_model = orig_argv_values["input_model"] - argv.model_name = orig_argv_values["model_name"] - if path_to_aux_pb is not None and os.path.exists(path_to_aux_pb): - os.remove(path_to_aux_pb) if len(fallback_reasons) > 0: reasons_message = ", ".join(fallback_reasons) diff --git a/tools/mo/openvino/tools/mo/front/tf/loader.py b/tools/mo/openvino/tools/mo/front/tf/loader.py index 9b78b2da2fa..72acbe0dd6d 100644 --- a/tools/mo/openvino/tools/mo/front/tf/loader.py +++ b/tools/mo/openvino/tools/mo/front/tf/loader.py @@ -248,7 +248,6 @@ def saved_model_load(imported, env_setup): def load_tf_graph_def(graph_file_name: str = "", is_binary: bool = True, checkpoint: str = "", model_dir: str = "", saved_model_tags: list = [], meta_graph_file: str = "", user_output_node_names_list: list = []): - if not isinstance(graph_file_name, str) and graph_file_name is not None: return prepare_graph_def(graph_file_name) # As a provisional solution, use a native TF methods to load a model protobuf @@ -291,6 +290,7 @@ def load_tf_graph_def(graph_file_name: str = "", is_binary: bool = True, checkpo for node in input_meta_graph_def.graph_def.node: if '_output_shapes' in node.attr: del node.attr['_output_shapes'] + tf_v1.reset_default_graph() # pylint: disable=no-member with tf_v1.Session() as sess: restorer = tf_v1.train.import_meta_graph(input_meta_graph_def) @@ -326,46 +326,6 @@ def load_tf_graph_def(graph_file_name: str = "", is_binary: bool = True, checkpo raise Error("Unknown configuration of input model parameters") -def convert_to_pb(argv: argparse.Namespace): - from openvino.tools.mo.utils.cli_parser import get_model_name - if argv.input_model is not None and not isinstance(argv.input_model, (str, Path)): - return None - env_setup = get_environment_setup("tf") - if "tensorflow" in env_setup and env_setup["tensorflow"] >= LooseVersion("2.0.0"): - tf.keras.backend.clear_session() - - # any model format on disk is accepted by TensorFlow Frontend - # only model from memory requires temporal saving on a disk - if (argv.input_model and isinstance(argv.input_model, str)) or argv.saved_model_dir or argv.input_meta_graph: - return None - - user_output_node_names_list = argv.output if argv.output else None - if user_output_node_names_list is not None and not isinstance(user_output_node_names_list, list): - user_output_node_names_list = user_output_node_names_list.split(',') - graph_def, _, _, _ = load_tf_graph_def( - graph_file_name=argv.input_model, - is_binary=not argv.input_model_is_text, - checkpoint=argv.input_checkpoint, - user_output_node_names_list=user_output_node_names_list, - model_dir=argv.saved_model_dir, - meta_graph_file=argv.input_meta_graph, - saved_model_tags=argv.saved_model_tags) - if argv.model_name: - model_name = argv.model_name - elif argv.input_model: - model_name = get_model_name(argv.input_model) - elif argv.saved_model_dir: - model_name = "saved_model" - elif argv.input_meta_graph: - model_name = get_model_name(argv.input_meta_graph) - argv.model_name = model_name - tf_v1.io.write_graph(graph_def, argv.output_dir if argv.output_dir != '.' else os.getcwd(), - model_name + "_tmp.pb", as_text=False) - path_to_pb = os.path.normpath(os.path.join(argv.output_dir, model_name + "_tmp.pb")) - argv.input_model = path_to_pb - return path_to_pb - - def protobuf_attrs(pb: tf_v1.NodeDef): return {'pb': pb} diff --git a/tools/mo/unit_tests/mo/front/tf/convert_to_pb_test.py b/tools/mo/unit_tests/mo/front/tf/convert_to_pb_test.py deleted file mode 100644 index 1abe5ddd456..00000000000 --- a/tools/mo/unit_tests/mo/front/tf/convert_to_pb_test.py +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright (C) 2018-2023 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -import argparse -import os -import tempfile -import unittest - -from openvino.tools.mo.front.tf.loader import convert_to_pb - - -class ConvertToPBTests(unittest.TestCase): - test_directory = os.path.dirname(os.path.realpath(__file__)) - - def setUp(self): - self.argv = argparse.Namespace(input_model=None, input_model_is_text=False, input_checkpoint=None, output=None, - saved_model_dir=None, input_meta_graph=None, saved_model_tags=None, - model_name='model', output_dir=None) - - @unittest.skip("Ticket: 106651") - def test_saved_model(self): - import tensorflow as tf - with tempfile.TemporaryDirectory(dir=self.test_directory) as tmp_dir: - inputs = tf.keras.Input(shape=(3,)) - x = tf.keras.layers.Dense(4, activation=tf.nn.relu)(inputs) - outputs = tf.keras.layers.Dense(5, activation=tf.nn.softmax)(x) - model = tf.keras.Model(inputs=inputs, outputs=outputs) - model.save(tmp_dir) - self.argv.saved_model_dir = tmp_dir - self.argv.output_dir = tmp_dir - path_to_pb = convert_to_pb(self.argv) - self.assertTrue(os.path.exists(path_to_pb), "The auxiliary .pb is not generated") - self.assertTrue(os.path.getsize(path_to_pb) != 0, "The auxiliary .pb is empty") - - def test_meta_format(self): - try: - import tensorflow.compat.v1 as tf_v1 - except ImportError: - import tensorflow as tf_v1 - from tensorflow.python.eager.context import graph_mode - - with tempfile.TemporaryDirectory(dir=self.test_directory) as tmp_dir: - with graph_mode(): - a = tf_v1.get_variable("A", initializer=tf_v1.constant(3, shape=[2])) - b = tf_v1.get_variable("B", initializer=tf_v1.constant(5, shape=[2])) - tf_v1.add(a, b, name='Add') - init_op = tf_v1.global_variables_initializer() - saver = tf_v1.train.Saver() - with tf_v1.Session() as sess: - sess.run(init_op) - saver.save(sess, os.path.join(tmp_dir, 'model')) - - self.argv.input_meta_graph = os.path.join(tmp_dir, 'model.meta') - self.argv.output_dir = tmp_dir - path_to_pb = convert_to_pb(self.argv) - self.assertTrue(path_to_pb is None, "Auxiliary .pb must not be generated for .meta") - - def test_text_frozen_format(self): - try: - import tensorflow.compat.v1 as tf_v1 - except ImportError: - import tensorflow as tf_v1 - tf_v1.reset_default_graph() - - # Create the graph and model - with tempfile.TemporaryDirectory(dir=self.test_directory) as tmp_dir: - with tf_v1.Session() as sess: - x = tf_v1.placeholder(tf_v1.float32, [2, 3], 'x') - y = tf_v1.placeholder(tf_v1.float32, [2, 3], 'y') - tf_v1.add(x, y, name="add") - - tf_v1.global_variables_initializer() - tf_v1.io.write_graph(sess.graph, tmp_dir, 'model.pbtxt', as_text=True) - - # initialize test case and check - self.argv.input_model = os.path.join(tmp_dir, 'model.pbtxt') - self.argv.input_model_is_text = True - self.argv.output_dir = tmp_dir - self.assertTrue(os.path.exists(self.argv.input_model), - "The test model in frozen text format must exist") - # test convert_to_pb - path_to_pb = convert_to_pb(self.argv) - self.assertTrue(path_to_pb is None, "Auxiliary .pb must not be generated for .pbtxt") - - def test_binary_frozen_format(self): - try: - import tensorflow.compat.v1 as tf_v1 - except ImportError: - import tensorflow as tf_v1 - tf_v1.reset_default_graph() - - # Create the graph and model - with tempfile.TemporaryDirectory(dir=self.test_directory) as tmp_dir: - with tf_v1.Session() as sess: - x = tf_v1.placeholder(tf_v1.float32, [2, 3], 'x') - y = tf_v1.placeholder(tf_v1.float32, [2, 3], 'y') - tf_v1.add(x, y, name="add") - - tf_v1.global_variables_initializer() - tf_v1.io.write_graph(sess.graph, tmp_dir, 'model.pb', as_text=False) - - # initialize test case and check - self.argv.input_model = os.path.join(tmp_dir, 'model.pb') - self.argv.input_model_is_text = False - self.argv.output_dir = tmp_dir - self.assertTrue(os.path.exists(self.argv.input_model), - "The test model in frozen binary format must exist") - # test convert_to_pb - expect no auxiliary model created - self.assertIsNone(convert_to_pb(self.argv)) - - def test_meta_format_session_clearing(self): - try: - import tensorflow.compat.v1 as tf_v1 - except ImportError: - import tensorflow as tf_v1 - - from openvino.tools.mo.utils.versions_checker import get_environment_setup - from distutils.version import LooseVersion - - env_setup = get_environment_setup("tf") - use_tf2 = False - if "tensorflow" in env_setup and env_setup["tensorflow"] >= LooseVersion("2.0.0"): - use_tf2 = True - - from tensorflow.python.eager.context import graph_mode - - with tempfile.TemporaryDirectory(dir=self.test_directory) as tmp_dir: - with graph_mode(): - a = tf_v1.get_variable("A", initializer=tf_v1.constant(3, shape=[2])) - b = tf_v1.get_variable("B", initializer=tf_v1.constant(5, shape=[2])) - tf_v1.add(a, b, name='Add') - init_op = tf_v1.global_variables_initializer() - saver = tf_v1.train.Saver() - with tf_v1.Session() as sess: - sess.run(init_op) - saver.save(sess, os.path.join(tmp_dir, 'model1')) - if use_tf2: - import tensorflow as tf - tf.keras.backend.clear_session() - - with graph_mode(): - c = tf_v1.get_variable("C", initializer=tf_v1.constant(3, shape=[2])) - d = tf_v1.get_variable("D", initializer=tf_v1.constant(5, shape=[2])) - tf_v1.add(c, d, name='Add1') - init_op = tf_v1.global_variables_initializer() - saver = tf_v1.train.Saver() - with tf_v1.Session() as sess: - sess.run(init_op) - saver.save(sess, os.path.join(tmp_dir, 'model2')) - if use_tf2: - import tensorflow as tf - tf.keras.backend.clear_session() - - self.argv.input_meta_graph = os.path.join(tmp_dir, 'model1.meta') - self.argv.output_dir = tmp_dir - path_to_pb = convert_to_pb(self.argv) - self.assertTrue(path_to_pb is None, "Auxiliary .pb must not be generated for .meta") - - self.argv.input_meta_graph = os.path.join(tmp_dir, 'model2.meta') - self.argv.output_dir = tmp_dir - self.argv.input_model = None - path_to_pb = convert_to_pb(self.argv) - self.assertTrue(path_to_pb is None, "Auxiliary .pb must not be generated for .meta") From 5574acc6ca0d5a32bfdf4214bb4b891d901041cf Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 18 Jun 2023 21:33:57 +0400 Subject: [PATCH 05/44] Fixed Snappy dependent option default value (#18128) --- cmake/features.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index fc7a07252e6..546fc721938 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -126,7 +126,7 @@ ie_option(ENABLE_OV_IR_FRONTEND "Enable IR FrontEnd" ON) ie_option(ENABLE_OV_TF_FRONTEND "Enable TensorFlow FrontEnd" ON) ie_option(ENABLE_OV_TF_LITE_FRONTEND "Enable TensorFlow Lite FrontEnd" ON) ie_dependent_option(ENABLE_SNAPPY_COMPRESSION "Enables compression support for TF FE" ON - "ENABLE_OV_TF_FRONTEND" ON) + "ENABLE_OV_TF_FRONTEND" OFF) if(CMAKE_HOST_LINUX AND LINUX) # Debian packages are enabled on Ubuntu systems From 555c083336e5a77a045eebc3036028d8410fb7a8 Mon Sep 17 00:00:00 2001 From: "Min, Byungil" Date: Mon, 19 Jun 2023 14:05:22 +0900 Subject: [PATCH 06/44] [GPU] Optimize out Gather by converting to implicit crop (#17743) + Changed Gather if it divides input tensor along batch axis + Converted Gather to cldnn Crop in CreateGatherOpBase + Added implicit Crop condition for batch axis Signed-off-by: Min, Byungil --- .../graph_optimizer/prepare_buffer_fusing.cpp | 175 ++++++++++++------ .../intel_gpu/src/plugin/ops/gather.cpp | 54 ++++-- .../single_layer_tests/gather.cpp | 19 ++ .../passes/prepare_buffer_fusing_test.cpp | 58 +++++- .../tests/unit/shape_infer/gather_si_test.cpp | 9 + .../tests/unit/test_cases/crop_gpu_test.cpp | 51 +++++ .../tests/unit/test_cases/gather_gpu_test.cpp | 61 ++++++ 7 files changed, 359 insertions(+), 68 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp index 4432f7b7ade..773a8c90e5e 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp @@ -317,6 +317,72 @@ static bool can_reshape_be_optimized(const reshape_node& node) { return node.is_in_place() && !node.has_fused_primitives(); } +static bool is_optimizable_padding_for_crop(const crop_node& node) { + const auto& crop_layout = node.get_output_layout(); + auto input_layout = node.get_dependency(0).get_output_layout(); + auto crop_prim = node.get_primitive(); + auto opt_lower_pad = crop_prim->offsets.feature[0]; + auto opt_upper_pad = input_layout.feature() - crop_prim->offsets.feature[0] - crop_layout.get_tensor().feature[0]; + + // do not optimize crop if paddings are not properly aligned + for (auto& usr : node.get_users()) { + auto usr_layout = usr->get_output_layout(); + if (usr_layout.format == format::b_fs_yx_fsv16 && + (opt_lower_pad % 16 != 0 || opt_upper_pad % 16 != 0)) + return false; + + if (input_layout.data_padding.lower_size().batch[0] != 0 || input_layout.data_padding.upper_size().batch[0] != 0 || + input_layout.data_padding.lower_size().spatial[0] != 0 || input_layout.data_padding.upper_size().spatial[0] != 0 || + input_layout.data_padding.lower_size().spatial[1] != 0 || input_layout.data_padding.upper_size().spatial[1] != 0) + return false; + + // oneDNN doesn't support paddings + if (usr->get_preferred_impl_type() == impl_types::onednn) + return false; + } + + return true; +} + +static bool can_crop_be_optimized_along_feature(const crop_node& node) { + const auto& crop_layout = node.get_output_layout(); + auto format = crop_layout.format; + auto input_layout = node.get_dependency(0).get_output_layout(); + const auto& crop_size = crop_layout.get_tensor(); + const auto& out_pad = crop_layout.data_padding; + + if (format == format::bfyx && crop_size.batch[0] == input_layout.batch() && + crop_size.spatial[0] == input_layout.spatial(0) && + crop_size.spatial[1] == input_layout.spatial(1) && out_pad.lower_size().feature[0] == 0 && + out_pad.upper_size().feature[0] == 0 && out_pad.lower_size().batch[0] == 0 && + out_pad.upper_size().batch[0] == 0 && out_pad.lower_size().spatial[0] == 0 && + out_pad.lower_size().spatial[1] == 0 && out_pad.upper_size().spatial[0] == 0 && + out_pad.upper_size().spatial[1] == 0) { + return true; + } + + return false; +} + +static bool can_crop_be_optimized_along_batch(const crop_node& node) { + const auto& crop_layout = node.get_output_layout(); + auto format = crop_layout.format; + auto input_layout = node.get_dependency(0).get_output_layout(); + const auto crop_shape = crop_layout.get_ordered_dims(); + const auto input_shape = input_layout.get_ordered_dims(); + const auto& in_padding = input_layout.data_padding; + const auto& out_padding = crop_layout.data_padding; + + // Check format's order is 'bxxx' and only batch size is different + if (format::is_simple_data_format(format) && format::traits(format)._order[0] == 0 && + std::equal(input_shape.begin()+1, input_shape.end(), crop_shape.begin()+1) && + !out_padding && !in_padding) { + return true; + } + + return false; +} + static void propagate_padding_to_opt_out_users(program_node& node, cldnn::padding padding_data) { if (padding_data == cldnn::padding()) return; @@ -366,6 +432,7 @@ void prepare_buffer_fusing::run(program& p) { if (!can_optimize(node)) continue; + // zero copy program_helpers::do_for_types(*node, [&p](crop_node& node) { // if the node is marked as network output, prevent optimizations which would affect a form of its output, @@ -392,56 +459,38 @@ void prepare_buffer_fusing::run(program& p) { if (p.is_loop_body() && node.get_dependency(0).is_type()) { return; } - // optimization is available for cropping across depth(features) only + + // optimization is available for cropping across depth(features) or batch // if output padding has defined padding across features already it wouldn't // work because it expect to have zeros in the padded area. + if (!is_optimizable_padding_for_crop(node)) + return; + const auto& crop_layout = node.get_output_layout(); - auto format = crop_layout.format; - auto crop_prim = node.get_primitive(); - auto input_layout = node.get_input_layout(0); const auto& crop_size = crop_layout.get_tensor(); - const auto& out_padd = crop_layout.data_padding; - auto opt_lower_pad = crop_prim->offsets.feature[0]; - auto opt_upper_pad = input_layout.feature() - crop_prim->offsets.feature[0] - crop_size.feature[0]; + const auto& out_pad = crop_layout.data_padding; + auto input_layout = node.get_input_layout(0); + auto crop_prim = node.get_primitive(); - // do not optimize crop if paddings are not properly aligned - for (auto& usr : node.get_users()) { - auto usr_layout = usr->get_output_layout(); - if (usr_layout.format == format::b_fs_yx_fsv16 && - (opt_lower_pad % 16 != 0 || opt_upper_pad % 16 != 0)) - return; - if (input_layout.data_padding.lower_size().batch[0] != 0 || input_layout.data_padding.upper_size().batch[0] != 0 || - input_layout.data_padding.lower_size().spatial[0] != 0 || input_layout.data_padding.upper_size().spatial[0] != 0 || - input_layout.data_padding.lower_size().spatial[1] != 0 || input_layout.data_padding.upper_size().spatial[1] != 0) - return; - // oneDNN doesn't support paddings - if (usr->get_preferred_impl_type() == impl_types::onednn) - return; - } - - if (format == format::bfyx && crop_size.batch[0] == input_layout.batch() && - crop_size.spatial[0] == input_layout.spatial(0) && - crop_size.spatial[1] == input_layout.spatial(1) && out_padd.lower_size().feature[0] == 0 && - out_padd.upper_size().feature[0] == 0 && out_padd.lower_size().batch[0] == 0 && - out_padd.upper_size().batch[0] == 0 && out_padd.lower_size().spatial[0] == 0 && - out_padd.lower_size().spatial[1] == 0 && out_padd.upper_size().spatial[0] == 0 && - out_padd.upper_size().spatial[1] == 0) { - // Regular crop - // crop input buffer - // |___________data____________| - // - // crop output buffer - // |-------->| offsets[f] |<--| - // |_____data____| - // <------------> - // reference size - // - // In-place crop - // crop output buffer - // |_low_pad_|__data_size__|___|<-upper pad - - // feature num of pad should be accumulated if dep has been optimized out. + // Regular crop + // crop input buffer + // |___________data____________| + // + // crop output buffer + // |-------->| offsets[f] |<--| + // |_____data____| + // <------------> + // reference size + // + // In-place crop + // crop output buffer + // |_low_pad_|__data_size__|___|<-upper pad + if (can_crop_be_optimized_along_feature(node)) { + auto crop_prim = node.get_primitive(); + auto opt_lower_pad = crop_prim->offsets.feature[0]; + auto opt_upper_pad = input_layout.feature() - crop_prim->offsets.feature[0] - crop_size.feature[0]; auto& dep = node.get_dependency(0); + // feature num of pad should be accumulated if dep has been optimized out. if (dep.is_type() && dep.can_be_optimized()) { auto dep_pad = dep.get_output_layout().data_padding; OPENVINO_ASSERT( @@ -454,18 +503,36 @@ void prepare_buffer_fusing::run(program& p) { opt_upper_pad += dep_pad.upper_size().feature[0]; } + // set padding node.set_output_padding( - padding({out_padd.lower_size().batch[0], - opt_lower_pad, - out_padd.lower_size().spatial[0], - out_padd.lower_size().spatial[1]}, - {out_padd.upper_size().batch[0], - opt_upper_pad, - out_padd.upper_size().spatial[0], - out_padd.upper_size().spatial[1]})); - node.can_be_optimized(true); - propagate_padding_to_opt_out_users(node, node.get_output_layout().data_padding); + padding({out_pad.lower_size().batch[0], + opt_lower_pad, + out_pad.lower_size().spatial[0], + out_pad.lower_size().spatial[1]}, + {out_pad.upper_size().batch[0], + opt_upper_pad, + out_pad.upper_size().spatial[0], + out_pad.upper_size().spatial[1]})); + } else if (can_crop_be_optimized_along_batch(node)) { + auto crop_prim = node.get_primitive(); + auto opt_lower_pad = crop_prim->offsets.batch[0]; + auto opt_upper_pad = input_layout.batch() - crop_prim->offsets.batch[0] - crop_size.batch[0]; + + auto new_padding = padding({opt_lower_pad, + out_pad.lower_size().feature[0], + out_pad.lower_size().spatial[0], + out_pad.lower_size().spatial[1]}, + {opt_upper_pad, + out_pad.upper_size().feature[0], + out_pad.upper_size().spatial[0], + out_pad.upper_size().spatial[1]}); + node.set_output_padding(new_padding); + } else { + return; } + + node.can_be_optimized(true); + propagate_padding_to_opt_out_users(node, node.get_output_layout().data_padding); } }); } diff --git a/src/plugins/intel_gpu/src/plugin/ops/gather.cpp b/src/plugins/intel_gpu/src/plugin/ops/gather.cpp index 16dc84eac3b..fe43a793ee5 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/gather.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/gather.cpp @@ -4,12 +4,14 @@ #include "intel_gpu/plugin/program.hpp" #include "intel_gpu/plugin/common_utils.hpp" +#include "transformations/utils/utils.hpp" #include "ngraph/op/gather.hpp" #include "intel_gpu/primitives/gather.hpp" #include "intel_gpu/primitives/reorder.hpp" #include "intel_gpu/primitives/reshape.hpp" +#include "intel_gpu/primitives/crop.hpp" using namespace InferenceEngine; namespace ov { @@ -44,12 +46,13 @@ void CreateGatherOpBase(Program& p, const std::shared_ptr& op, const int64_t } // Dynamic path will do shape infer internally, so no need to pass valid out shape for that case - ov::Shape out_shape = op->get_output_partial_shape(0).is_static() ? op->get_output_shape(0) : ov::Shape{}; + bool is_static = op->get_output_partial_shape(0).is_static(); + ov::Shape out_shape = is_static ? op->get_output_shape(0) : ov::Shape{}; // Update output_shape in case of scalar indice bool need_reshape = false; auto out_shape_original = out_shape; - if (!p.use_new_shape_infer() && op->get_output_partial_shape(0).is_static()) { + if (!p.use_new_shape_infer() && is_static) { auto input1_shape = op->get_input_shape(1); if (input1_shape.size() == 0 && batch_dim == 0) { need_reshape = true; @@ -77,21 +80,50 @@ void CreateGatherOpBase(Program& p, const std::shared_ptr& op, const int64_t } } - // gather + // Set layer name for Gather auto reshapeName = layerName + ""; if (need_reshape) { layerName = layerName + "_reshape_output"; } - auto gatherPrim = cldnn::gather(layerName, - reordered_inputs[0], - reordered_inputs[1], - axis, - out_shape, - batch_dim, - support_neg_ind); + // Check if Gather could be converted to other primitive + const auto input_shape = op->get_input_partial_shape(0); + const auto input_rank = input_shape.rank().get_length(); + const auto& indices = op->input_value(1); + if (is_static && axis == 0 && input_rank > 1 && indices.get_partial_shape().rank().get_length() == 0 && + std::equal(input_shape.begin()+1, input_shape.end(), out_shape.begin()+1)) { + // Gather -> Crop + // this Gather simply divides an input tensor along Batch axis + auto get_crop_layer_name = [&](std::string name, size_t idx)->std::string { + return (name + "/crop_" + std::to_string(idx)); + }; - p.add_primitive(*op, gatherPrim); + // Get indices info to calculate offset + const auto& indices_node = indices.get_node_shared_ptr(); + auto indices_constant = std::dynamic_pointer_cast(indices_node); + float result = 0.f; + ov::op::util::get_single_value(indices_constant, result); + + // Set tensors for crop shape and offset + InferenceEngine::SizeVector start_offset(input_shape.size()); + start_offset[0] = static_cast(result); + auto offsetTensor = tensor_from_dims(start_offset, 0); + auto outTensor = tensor_from_dims(out_shape, 1); + + // Create Crop + layerName = get_crop_layer_name(layerName, static_cast(result)); + auto cropPrim = cldnn::crop(layerName, reordered_inputs[0], outTensor, offsetTensor); + p.add_primitive(*op, cropPrim); + } else { + auto gatherPrim = cldnn::gather(layerName, + reordered_inputs[0], + reordered_inputs[1], + axis, + out_shape, + batch_dim, + support_neg_ind); + p.add_primitive(*op, gatherPrim); + } // Add reorder and reshape for scalar indice if (need_reshape) { diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp index a7993fa9e2c..ac4a3eca063 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp @@ -559,4 +559,23 @@ INSTANTIATE_TEST_SUITE_P( GatherLayerTest::getTestCaseName ); +const auto GatherAxes0Optimized = []() { + return testing::Combine(testing::ValuesIn({std::vector{4, 8, 2, 2}}), + testing::ValuesIn({std::vector{}}), + testing::ValuesIn({std::tuple{0, 0}}), + testing::ValuesIn(netPrecisionsFP32), + testing::Values(InferenceEngine::Precision::UNSPECIFIED), + testing::Values(InferenceEngine::Precision::UNSPECIFIED), + testing::Values(InferenceEngine::Layout::ANY), + testing::Values(InferenceEngine::Layout::ANY), + testing::Values(CommonTestUtils::DEVICE_GPU)); +}; + +INSTANTIATE_TEST_SUITE_P( + smoke_Gather7Axes0Optimized, + Gather8IndiceScalarLayerTest, + GatherAxes0Optimized(), + Gather8IndiceScalarLayerTest::getTestCaseName +); + } // namespace diff --git a/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp b/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp index 6ffa6250ad4..0c86c29ef8a 100644 --- a/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp @@ -8,6 +8,7 @@ #include "intel_gpu/graph/program.hpp" #include "data_inst.h" +#include "crop_inst.h" #include "reshape_inst.h" #include "fully_connected_inst.h" #include "permute_inst.h" @@ -165,7 +166,7 @@ TEST(prepare_buffer_fusing, in_place_concat_static) { topology.add(concatenation("concat", { input_info("permute1"), input_info("permute2") }, 2)); topology.add(permute("output", input_info("concat"), {0, 2, 3, 1})); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::optimize_data(true)); auto prog = program::build_program(engine, topology, config, false, false); ASSERT_NE(prog, nullptr); @@ -218,7 +219,7 @@ TEST(prepare_buffer_fusing, in_place_concat_dynamic) { topology.add(concatenation("concat", { input_info("permute1"), input_info("permute2") }, 2)); topology.add(permute("output", input_info("concat"), {0, 2, 3, 1})); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::optimize_data(true)); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); auto prog = program::build_program(engine, topology, config, false, false); @@ -273,7 +274,7 @@ TEST(prepare_buffer_fusing, in_place_concat_dynamic__static_dim_dyn_pad) { topology.add(concatenation("concat", { input_info("permute1"), input_info("permute2") }, 2)); topology.add(permute("output", input_info("concat"), {0, 2, 3, 1})); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::optimize_data(true)); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); auto prog = program::build_program(engine, topology, config, false, false); @@ -311,3 +312,54 @@ TEST(prepare_buffer_fusing, in_place_concat_dynamic__static_dim_dyn_pad) { ASSERT_EQ(ref_output[x], output_ptr[x]); } } + +TEST(prepare_buffer_fusing, crop_b_axis) { + auto& engine = get_test_engine(); + + auto input1 = engine.allocate_memory({ data_types::f32, format::bfyx, tensor{ 3, 2, 2, 2 } }); + + set_values(input1, { + 1.f, 2.f, 3.f, 4.f, 1.f, 2.f, 3.f, 4.f, + 5.f, 6.f, 7.f, 8.f, 5.f, 6.f, 7.f, 11.f, + 9.f, 10.f, 11.f, 12.f, 9.f, 10.f, 11.f, 12.f + }); + + topology topology; + topology.add(input_layout("Input", input1->get_layout())); + topology.add(crop("crop", input_info("Input"), tensor{1, 2, 2, 2}, tensor(1, 0, 0, 0))); + topology.add(reorder("reorder", input_info("crop"), format::bfyx, data_types::i8)); + + ExecutionConfig config = get_test_default_config(engine); + config.set_property(ov::intel_gpu::optimize_data(true)); + network network(engine, topology, config); + + network.set_input_data("Input", input1); + + auto outputs = network.execute(); + + auto crop_prim = network.get_primitive("crop"); + ASSERT_EQ(crop_prim->can_be_optimized(), true); + + auto output = outputs.at("reorder").get_memory(); + cldnn::mem_lock output_ptr(output, get_test_stream()); + + std::vector expected_results = { + 5, 6, 7, 8, 5, 6, 7, 11 + }; + + int crop_batch_num = 1; + int crop_feature_num = 2; + int crop_y_size = 2; + int crop_x_size = 2; + for (int b = 0; b < crop_batch_num; ++b) { + for (int f = 0; f < crop_feature_num; ++f) { + for (int y = 0; y < crop_y_size; ++y) { + for (int x = 0; x < crop_x_size; ++x) { + int linear_id = x + 2 * (y + 2 * f); + int output_linear_id = x + crop_x_size * (y + crop_y_size * (f + crop_feature_num * b)); + ASSERT_EQ(output_ptr[output_linear_id], expected_results[linear_id]); + } + } + } + } +} diff --git a/src/plugins/intel_gpu/tests/unit/shape_infer/gather_si_test.cpp b/src/plugins/intel_gpu/tests/unit/shape_infer/gather_si_test.cpp index 26ac1a60015..aedcfb9d4dc 100644 --- a/src/plugins/intel_gpu/tests/unit/shape_infer/gather_si_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/shape_infer/gather_si_test.cpp @@ -61,4 +61,13 @@ INSTANTIATE_TEST_SUITE_P(smoke, gather_test, }, })); +INSTANTIATE_TEST_SUITE_P(optimized, gather_test, + testing::ValuesIn(std::vector{ + { + layout{ov::PartialShape{3, 4, 2, 2}, data_types::f32, format::bfyx}, layout{ov::PartialShape{1}, data_types::f32, format::bfyx}, + 0, 0, + layout{ov::PartialShape{1, 4, 2, 2}, data_types::f32, format::bfyx} + }, + })); + } // shape_infer_tests diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/crop_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/crop_gpu_test.cpp index 2fe73506993..bbafada74a4 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/crop_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/crop_gpu_test.cpp @@ -1576,3 +1576,54 @@ TEST(crop_gpu, optimized_out_crop) { ASSERT_TRUE(all_primitives["crop1"] == "_optimized_"); ASSERT_TRUE(all_primitives["crop2"] == "_optimized_"); } + +TEST(crop_single_axis, simple_Baxis) { + auto& engine = get_test_engine(); + + auto input1 = engine.allocate_memory({ data_types::f32, format::bfyx, tensor{ 3, 2, 1, 2 } }); + + set_values(input1, { + 1.f, 2.f, 3.f, 4.f, + 5.f, 6.f, 7.f, 8.f, + 9.f, 10.f, 11.f, 12.f + }); + + topology topology; + topology.add(input_layout("Input", input1->get_layout())); + topology.add(crop("crop", input_info("Input"), tensor{1, 2, 1, 2}, tensor(1, 0, 0, 0))); + topology.add(reorder("reorder", input_info("crop"), format::bfyx, data_types::i8)); + + ExecutionConfig config = get_test_default_config(engine); + config.set_property(ov::intel_gpu::optimize_data(true)); + network network(engine, topology, config); + + network.set_input_data("Input", input1); + + + auto outputs = network.execute(); + auto output = outputs.at("reorder").get_memory(); + cldnn::mem_lock output_ptr(output, get_test_stream()); + + std::vector expected_results = { + 5, 6, 7, 8 + }; + + int crop_batch_num = 1; + int crop_feature_num = 2; + int crop_y_size = 2; + int crop_x_size = 1; + for (int b = 0; b < crop_batch_num; ++b) { + for (int f = 0; f < crop_feature_num; ++f) { + for (int y = 0; y < crop_y_size; ++y) { + for (int x = 0; x < crop_x_size; ++x) { + int linear_id = x + y + 2 * f; + int output_linear_id = x + crop_x_size * (y + crop_y_size * (f + crop_feature_num * b)); + ASSERT_EQ(output_ptr[output_linear_id], expected_results[linear_id]); + } + } + } + } + + auto crop_prim = network.get_primitive("crop"); + ASSERT_EQ(crop_prim->can_be_optimized(), true); +} diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp index 57d3e982be9..c2c3f839395 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp @@ -2097,3 +2097,64 @@ TEST(gather_gpu_u8, 322_axisF) { TEST(gather_gpu_u8, export_import) { test_gather_gpu_u8_322_axisF(true); } + +TEST(gather_single_axis, simple_Baxis) { + auto& engine = get_test_engine(); + + auto input1 = engine.allocate_memory({ data_types::f32, format::bfyx, tensor{ 3, 2, 1, 2 } }); // Dictionary + auto input2 = engine.allocate_memory({ data_types::i32, format::bfyx, tensor{ 1 } }); // Indexes + int64_t axis = 0; + + set_values(input1, { + 1.f, 2.f, 3.f, 4.f, + 5.f, 6.f, 7.f, 8.f, + 9.f, 10.f, 11.f, 12.f + }); + + set_values(input2, { + 1 + }); + + topology topology; + topology.add(input_layout("InputDictionary", input1->get_layout())); + topology.add(input_layout("InputText", input2->get_layout())); + topology.add( + gather("gather", input_info("InputDictionary"), input_info("InputText"), axis, ov::Shape{1, 2, 2, 1}) + ); + topology.add(reorder("reorder", input_info("gather"), format::bfyx, data_types::i8)); + + ExecutionConfig config = get_test_default_config(engine); + config.set_property(ov::intel_gpu::optimize_data(true)); + network network(engine, topology, config); + + network.set_input_data("InputDictionary", input1); + network.set_input_data("InputText", input2); + + auto outputs = network.execute(); + + auto output = outputs.at("reorder").get_memory(); + cldnn::mem_lock output_ptr(output, get_test_stream()); + + std::vector expected_results = { + 5, 6, 7, 8 + }; + + int crop_batch_num = 1; + int crop_feature_num = 2; + int crop_y_size = 2; + int crop_x_size = 1; + for (int b = 0; b < crop_batch_num; ++b) { + for (int f = 0; f < crop_feature_num; ++f) { + for (int y = 0; y < crop_y_size; ++y) { + for (int x = 0; x < crop_x_size; ++x) { + int linear_id = x + y + 2 * f; + int output_linear_id = x + crop_x_size * (y + crop_y_size * (f + crop_feature_num * b)); + ASSERT_EQ(output_ptr[output_linear_id], expected_results[linear_id]); + } + } + } + } + + auto crop_prim = network.get_primitive("gather"); + ASSERT_EQ(crop_prim->can_be_optimized(), false); +} From fa545ffb1c0e1d708e06e5413485d0d6c67aa641 Mon Sep 17 00:00:00 2001 From: Luo Cheng Date: Mon, 19 Jun 2023 13:30:23 +0800 Subject: [PATCH 07/44] [CPU] MHA will produce NAN when all inputs are negative (#15995) --- src/plugins/intel_cpu/src/nodes/mha.cpp | 8 ++++++-- .../tests/functional/subgraph_tests/src/mha.cpp | 11 ++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/mha.cpp b/src/plugins/intel_cpu/src/nodes/mha.cpp index 5be06b7ef94..fd5bab73981 100644 --- a/src/plugins/intel_cpu/src/nodes/mha.cpp +++ b/src/plugins/intel_cpu/src/nodes/mha.cpp @@ -73,7 +73,9 @@ private: mov(reg_buffer_aux, reg_buffer); mov(reg_work_amount, jcp_.work_amount); mov(reg_work_amount_aux, reg_work_amount); - uni_vpxor(get_vmm_max(0), get_vmm_max(0), get_vmm_max(0)); + mov(reg_tmp, dnnl::impl::float2int(-FLT_MAX)); + vmovq(xmm_tmp, reg_tmp); + vbroadcastss(get_vmm_max(0), xmm_tmp); // mul1 input is const and always float if (jcp_.with_mul_scales) { @@ -117,7 +119,9 @@ private: sub(rsp, sizeof(float) * vec_size); uni_vmovups(ptr[rsp], get_vmm_max(0)); - uni_vpxor(get_vmm_max(0), get_vmm_max(0), get_vmm_max(0)); + mov(reg_tmp, dnnl::impl::float2int(-FLT_MAX)); + vmovq(xmm_tmp, reg_tmp); + vbroadcastss(get_vmm_max(0), xmm_tmp); for (size_t i = 0; i < vec_size; i++) { mov(reg_tmp_32, ptr[rsp + i * sizeof(float)]); vmovq(xmm_tmp, reg_tmp); diff --git a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/mha.cpp b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/mha.cpp index 4f7a10056cc..ce3ee202801 100644 --- a/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/mha.cpp +++ b/src/plugins/intel_cpu/tests/functional/subgraph_tests/src/mha.cpp @@ -188,18 +188,23 @@ public: for (size_t i = 0; i < funcInputs.size(); ++i) { const auto& funcInput = funcInputs[i]; ov::Tensor tensor; - tensor = ov::test::utils::create_and_fill_tensor_normal_distribution(funcInput.get_element_type(), targetInputStaticShapes[i], 1.0f, 0.5f); + // TODO: after snippets fixed should remove 2nd condition, ticket: 105339 + if (patternType == 0 || expectedNode == "Subgraph") + tensor = ov::test::utils::create_and_fill_tensor_normal_distribution(funcInput.get_element_type(), targetInputStaticShapes[i], 1.0f, 0.5f); + else + // generate all negative inputs + tensor = ov::test::utils::create_and_fill_tensor_unique_sequence(funcInput.get_element_type(), targetInputStaticShapes[i], -1, -5); inputs.insert({funcInput.get_node_shared_ptr(), tensor}); } } protected: + size_t patternType; + std::string expectedNode; void SetUp() override { std::vector inputShapes; std::vector inputPrecisions; std::vector matMulIn0Precisions; - size_t patternType; - std::string expectedNode; std::tie(inputShapes, inputPrecisions, matMulIn0Precisions, patternType, expectedNode, targetDevice) = this->GetParam(); init_input_shapes(inputShapes); From 9943ffc2591c975d02abe38b7e7ee041f03c7a3a Mon Sep 17 00:00:00 2001 From: "Min, Byungil" Date: Mon, 19 Jun 2023 16:41:47 +0900 Subject: [PATCH 08/44] [GPU] Fix unit-tests for dGPU (#18125) + Resolved unit-tests failure on dGPU + Applied get_test_default_config for testing config Signed-off-by: Min, Byungil --- .../intel_gpu/tests/unit/passes/kernels_cache_test.cpp | 2 +- .../intel_gpu/tests/unit/test_cases/arg_max_gpu_test.cpp | 2 +- .../tests/unit/test_cases/concatenation_gpu_test.cpp | 2 +- .../tests/unit/test_cases/deconvolution_gpu_test.cpp | 2 +- .../intel_gpu/tests/unit/test_cases/eltwise_gpu_test.cpp | 6 +++--- .../tests/unit/test_cases/fully_connected_gpu_test.cpp | 2 +- .../tests/unit/test_cases/scatter_nd_update_gpu_test.cpp | 2 +- .../tests/unit/test_cases/strided_slice_gpu_test.cpp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp b/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp index 2e63cc630c2..547b3ac5984 100644 --- a/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp @@ -60,7 +60,7 @@ TEST(kernels_cache, reuse_kernel_for_static_model_01) { eltwise("sum", {input_info("concat1"), input_info("concat2")}, eltwise_mode::sum), reorder("output", input_info("sum"), {{3, 2}, data_types::f16, format::bfyx})); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); auto prog = program::build_program(engine, topology, config, false, false); auto& cache = prog->get_kernels_cache(); diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/arg_max_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/arg_max_gpu_test.cpp index 1bf43241c15..0b5d5db256b 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/arg_max_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/arg_max_gpu_test.cpp @@ -898,7 +898,7 @@ TEST(arg_max_min_gpu, dynamic) { set_values(input, input_vec); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); network network(engine, topology, config); network.set_input_data("input", input); diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/concatenation_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/concatenation_gpu_test.cpp index 91ea17c4a66..93ad9cfc18c 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/concatenation_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/concatenation_gpu_test.cpp @@ -110,7 +110,7 @@ void start_concat_test_dynamic(impl_types impl_type) { padding{ { 0,0,0,0 }, 0 }) ); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::optimize_data(true)); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); if (impl_type != impl_types::any) { diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/deconvolution_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/deconvolution_gpu_test.cpp index 1f47df76231..16a07f20cac 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/deconvolution_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/deconvolution_gpu_test.cpp @@ -303,7 +303,7 @@ TYPED_TEST(deconvolution_basic, no_bias_basic_wsiz2x2_in2x2x1x1_nopad_exclude_fu reorder("plane_output", input_info("elt_scale"), format::bfyx, data_types::f32) ); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); config.set_property(ov::intel_gpu::optimize_data(true)); diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/eltwise_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/eltwise_gpu_test.cpp index 3a2edaabeaf..84f43d5eabc 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/eltwise_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/eltwise_gpu_test.cpp @@ -1382,7 +1382,7 @@ TEST(eltwise_gpu_f32, dynamic_kernel_broadcast_mixed_ranks_3d_2d) { set_values(input2, { 0.5f, -0.5f, 1.0f, -1.0f, 2.f }); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); network network(engine, topology, config); network.set_input_data("input1", input1); @@ -1441,7 +1441,7 @@ TEST(eltwise_gpu_f32, dynamic_kernel_broadcast_mixed_ranks_5d_2d) { set_values(input2, { 0.5f, -0.5f, 1.0f, -1.0f, 2.f }); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); network network(engine, topology, config); network.set_input_data("input1", input1); @@ -1500,7 +1500,7 @@ TEST(eltwise_cpu_impl_f32, dynamic_kernel_broadcast_mixed_ranks_5d_2d) { set_values(input2, { 0.5f, -0.5f, 1.0f, -1.0f, 2.f }); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{{"eltwise", {format::bfzyx, "", impl_types::cpu}}})); diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/fully_connected_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/fully_connected_gpu_test.cpp index 9d0ffa548be..f9729429166 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/fully_connected_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/fully_connected_gpu_test.cpp @@ -2537,7 +2537,7 @@ public: fc_prim.output_data_types = {type_to_data_type::value}; topo.add(fc_prim); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::optimize_data(true)); network net(engine, topo, config); diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/scatter_nd_update_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/scatter_nd_update_gpu_test.cpp index c7cee584112..8cc9f3c471e 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/scatter_nd_update_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/scatter_nd_update_gpu_test.cpp @@ -4474,7 +4474,7 @@ TEST(scatter_nd_update_gpu, dynamic_5d) { topology.add(input_layout("updates", input3_layout)); topology.add(scatter_nd_update("scatter_nd_update", input_info("data"), input_info("indices"), input_info("updates"), 5)); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); network network(engine, topology, config); diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/strided_slice_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/strided_slice_gpu_test.cpp index 2e32544548f..065e3e9e781 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/strided_slice_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/strided_slice_gpu_test.cpp @@ -710,7 +710,7 @@ public: topology.add(data("input4", strides)); topology.add(strided_slice("strided_slice", input_info("input"), input_info("input2"), input_info("input3"), input_info("input4"), {}, {}, {}, {}, {}, {})); - ExecutionConfig config; + ExecutionConfig config = get_test_default_config(engine); config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); if (impl_type != impl_types::any) config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{ {"strided_slice", {format::bfyx, "", impl_types::cpu}} })); From 5c2925ada6761057d2c9bd65a528ce31559bc3f5 Mon Sep 17 00:00:00 2001 From: Xuejun Zhai Date: Mon, 19 Jun 2023 16:52:36 +0800 Subject: [PATCH 09/44] [AUTO BATCH PLUGIN] Split auto_batch.cpp & auto_batch.hpp to small files (#18133) * [AUTO BATCH PLUGIN] split the auto_batch.hpp to plugin.hpp, complied_model.hpp sync_infer_request.hpp async_infer_request.hpp Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] Add plugin.cpp, seprate the plugin related operations from auto_batch.cpp Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] Add compiled_model.cpp, seprate the compiled model related operations from auto_batch.cpp Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] Add sync_infer_request.cpp, seprate the sync request related operations from auto_batch.cpp Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] Add async_infer_request.cpp, seprate the async request related operations from auto_batch.cpp Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] remove auto_batch.cpp Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] fix code format issue Signed-off-by: Zhai, Xuejun --------- Signed-off-by: Zhai, Xuejun --- src/plugins/auto_batch/CMakeLists.txt | 2 +- .../auto_batch/src/async_infer_request.cpp | 66 ++ .../auto_batch/src/async_infer_request.hpp | 25 + src/plugins/auto_batch/src/auto_batch.cpp | 994 ------------------ src/plugins/auto_batch/src/auto_batch.hpp | 189 ---- src/plugins/auto_batch/src/compiled_model.cpp | 244 +++++ src/plugins/auto_batch/src/compiled_model.hpp | 75 ++ src/plugins/auto_batch/src/plugin.cpp | 358 +++++++ src/plugins/auto_batch/src/plugin.hpp | 68 ++ .../auto_batch/src/sync_infer_request.cpp | 349 ++++++ .../auto_batch/src/sync_infer_request.hpp | 49 + .../auto_batch/tests/unit/CMakeLists.txt | 2 +- .../tests/unit/mock_auto_batch_plugin.hpp | 5 +- 13 files changed, 1240 insertions(+), 1186 deletions(-) create mode 100644 src/plugins/auto_batch/src/async_infer_request.cpp create mode 100644 src/plugins/auto_batch/src/async_infer_request.hpp delete mode 100644 src/plugins/auto_batch/src/auto_batch.cpp delete mode 100644 src/plugins/auto_batch/src/auto_batch.hpp create mode 100644 src/plugins/auto_batch/src/compiled_model.cpp create mode 100644 src/plugins/auto_batch/src/compiled_model.hpp create mode 100644 src/plugins/auto_batch/src/plugin.cpp create mode 100644 src/plugins/auto_batch/src/plugin.hpp create mode 100644 src/plugins/auto_batch/src/sync_infer_request.cpp create mode 100644 src/plugins/auto_batch/src/sync_infer_request.hpp diff --git a/src/plugins/auto_batch/CMakeLists.txt b/src/plugins/auto_batch/CMakeLists.txt index 665cfbaf84b..5d10d6371d4 100644 --- a/src/plugins/auto_batch/CMakeLists.txt +++ b/src/plugins/auto_batch/CMakeLists.txt @@ -16,7 +16,7 @@ ov_add_plugin(NAME ${TARGET_NAME} DEVICE_NAME "BATCH" PSEUDO_DEVICE SOURCES ${SOURCES} ${HEADERS} - VERSION_DEFINES_FOR src/auto_batch.cpp ADD_CLANG_FORMAT) + VERSION_DEFINES_FOR src/plugin.cpp ADD_CLANG_FORMAT) target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads) diff --git a/src/plugins/auto_batch/src/async_infer_request.cpp b/src/plugins/auto_batch/src/async_infer_request.cpp new file mode 100644 index 00000000000..f14666ed943 --- /dev/null +++ b/src/plugins/auto_batch/src/async_infer_request.cpp @@ -0,0 +1,66 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "async_infer_request.hpp" + +namespace AutoBatchPlugin { + +using namespace InferenceEngine; + +AutoBatchAsyncInferRequest::AutoBatchAsyncInferRequest( + const AutoBatchInferRequest::Ptr& inferRequest, + InferenceEngine::SoIInferRequestInternal& inferRequestWithoutBatch, + const ITaskExecutor::Ptr& callbackExecutor) + : AsyncInferRequestThreadSafeDefault(inferRequest, nullptr, callbackExecutor), + _inferRequestWithoutBatch(inferRequestWithoutBatch), + _inferRequest{inferRequest} { + // this executor starts the inference while the task (checking the result) is passed to the next stage + struct ThisRequestExecutor : public ITaskExecutor { + explicit ThisRequestExecutor(AutoBatchAsyncInferRequest* _this_) : _this{_this_} {} + void run(Task task) override { + auto& workerInferRequest = _this->_inferRequest->_myBatchedRequestWrapper; + std::pair t; + t.first = _this; + t.second = std::move(task); + workerInferRequest._tasks.push(t); + // it is ok to call size() here as the queue only grows (and the bulk removal happens under the mutex) + const int sz = static_cast(workerInferRequest._tasks.size()); + if (sz == workerInferRequest._batchSize) { + workerInferRequest._cond.notify_one(); + } + }; + AutoBatchAsyncInferRequest* _this = nullptr; + }; + _pipeline = {{/*TaskExecutor*/ std::make_shared(this), /*task*/ [this] { + if (this->_inferRequest->_exceptionPtr) // if the exception happened in the batch1 fallback + std::rethrow_exception(this->_inferRequest->_exceptionPtr); + auto& batchReq = this->_inferRequest->_myBatchedRequestWrapper; + if (batchReq._exceptionPtr) // when the batchN execution failed + std::rethrow_exception(batchReq._exceptionPtr); + // in the case of non-batched execution the blobs were set explicitly + if (AutoBatchInferRequest::eExecutionFlavor::BATCH_EXECUTED == + this->_inferRequest->_wasBatchedRequestUsed) + this->_inferRequest->CopyOutputsIfNeeded(); + }}}; +} + +std::map AutoBatchAsyncInferRequest::GetPerformanceCounts() + const { + CheckState(); + if (AutoBatchInferRequest::eExecutionFlavor::BATCH_EXECUTED == _inferRequest->_wasBatchedRequestUsed) + return _inferRequest->_myBatchedRequestWrapper._inferRequestBatched->GetPerformanceCounts(); + else + return _inferRequestWithoutBatch->GetPerformanceCounts(); +} + +void AutoBatchAsyncInferRequest::Infer_ThreadUnsafe() { + InferUsingAsync(); +} + +AutoBatchAsyncInferRequest::~AutoBatchAsyncInferRequest() { + StopAndWait(); +} +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/src/async_infer_request.hpp b/src/plugins/auto_batch/src/async_infer_request.hpp new file mode 100644 index 00000000000..c6956f8114e --- /dev/null +++ b/src/plugins/auto_batch/src/async_infer_request.hpp @@ -0,0 +1,25 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma once +#include "cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp" +#include "sync_infer_request.hpp" + +namespace AutoBatchPlugin { +class AutoBatchAsyncInferRequest : public InferenceEngine::AsyncInferRequestThreadSafeDefault { +public: + using Ptr = std::shared_ptr; + + explicit AutoBatchAsyncInferRequest(const AutoBatchInferRequest::Ptr& inferRequest, + InferenceEngine::SoIInferRequestInternal& inferRequestWithoutBatch, + const InferenceEngine::ITaskExecutor::Ptr& callbackExecutor); + void Infer_ThreadUnsafe() override; + virtual ~AutoBatchAsyncInferRequest(); + std::map GetPerformanceCounts() const override; + + InferenceEngine::SoIInferRequestInternal _inferRequestWithoutBatch; + AutoBatchInferRequest::Ptr _inferRequest; +}; +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/src/auto_batch.cpp b/src/plugins/auto_batch/src/auto_batch.cpp deleted file mode 100644 index 5f0b1ceed3f..00000000000 --- a/src/plugins/auto_batch/src/auto_batch.cpp +++ /dev/null @@ -1,994 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -#include "auto_batch.hpp" - -#include -#include -#include -#include -#include -#include -#include - -#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp" -#include "dimension_tracker.hpp" -#include "ie_icore.hpp" -#include "ie_ngraph_utils.hpp" -#include "ie_performance_hints.hpp" -#include "openvino/pass/manager.hpp" -#include "openvino/runtime/device_id_parser.hpp" -#include "openvino/runtime/intel_gpu/properties.hpp" -#include "openvino/util/common_util.hpp" -#include "transformations/common_optimizations/dimension_tracking.hpp" -#include "transformations/init_node_info.hpp" -#include "transformations/utils/utils.hpp" - -namespace AutoBatchPlugin { -using namespace InferenceEngine; - -std::vector supported_configKeys = {CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG), - ov::device::priorities.name(), - CONFIG_KEY(AUTO_BATCH_TIMEOUT), - CONFIG_KEY(CACHE_DIR)}; - -template -Blob::Ptr create_shared_blob_on_top_of_batched_blob(Blob::Ptr batched_blob, - std::string name, - const std::set& batched_names, - size_t batch_id, - size_t batch_num) { - typedef typename PrecisionTrait::value_type TYPE; - typedef typename std::add_pointer::type TYPEPTR; - auto ptr = batched_blob->buffer().as(); - auto sizePerBatch = batched_blob->size() / batch_num; - SizeVector dims = batched_blob->getTensorDesc().getDims(); - // for performance reason (copy avoidance) current impl of the auto-batching supports only batching by 0th dim - if (batched_names.count(name)) { - dims[0] = 1; - return make_shared_blob({precision, dims, batched_blob->getTensorDesc().getLayout()}, - ptr + sizePerBatch * batch_id, - sizePerBatch); - } else { - // same blob for all requests (e.g. constants) - return make_shared_blob({precision, dims, batched_blob->getTensorDesc().getLayout()}, ptr); - } -} - -// ------------------------------AutoBatchInferRequest---------------------------- -AutoBatchInferRequest::AutoBatchInferRequest(const std::vector>& inputs, - const std::vector>& outputs, - AutoBatchExecutableNetwork::WorkerInferRequest& workerRequest, - int batch_id, - int num_batch, - const std::set& batchedInputs, - const std::set& batchedOutputs) - : IInferRequestInternal(inputs, outputs), - _myBatchedRequestWrapper(workerRequest), - _batchId(batch_id), - _batchSize(num_batch) { - ShareBlobsWithBatchRequest(batchedInputs, batchedOutputs); -} - -AutoBatchInferRequest::AutoBatchInferRequest(const InputsDataMap& networkInputs, - const OutputsDataMap& networkOutputs, - AutoBatchExecutableNetwork::WorkerInferRequest& workerRequest, - int batch_id, - int num_batch, - const std::set& batchedInputs, - const std::set& batchedOutputs) - : IInferRequestInternal(networkInputs, networkOutputs), - _myBatchedRequestWrapper(workerRequest), - _batchId(batch_id), - _batchSize(num_batch) { - ShareBlobsWithBatchRequest(batchedInputs, batchedOutputs); -} - -void AutoBatchInferRequest::ShareBlobsWithBatchRequest(const std::set& batchedInputs, - const std::set& batchedOutputs) { - // Allocate all input blobs - for (const auto& it : _networkInputs) { - auto blob = _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first); - Blob::Ptr res; - switch (it.second->getTensorDesc().getPrecision()) { - case InferenceEngine::Precision::FP32: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I32: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I8: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U32: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::FP64: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::FP16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::BF16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U64: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I64: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U8: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::BOOL: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedInputs, - _batchId, - _batchSize); - break; - default: - IE_THROW() << "Unsupported input precision " << it.second->getTensorDesc().getPrecision(); - } - _inputs[it.first] = res; - } - // Allocate all output blobs - for (const auto& it : _networkOutputs) { - auto blob = _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first); - Blob::Ptr res; - switch (it.second->getTensorDesc().getPrecision()) { - case InferenceEngine::Precision::FP32: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I32: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I8: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U32: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::FP64: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::FP16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::BF16: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U64: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::I64: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::U8: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - case InferenceEngine::Precision::BOOL: - res = create_shared_blob_on_top_of_batched_blob( - _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), - it.first, - batchedOutputs, - _batchId, - _batchSize); - break; - default: - IE_THROW(NotImplemented) << "Unsupported input precision " << it.second->getTensorDesc().getPrecision(); - } - _outputs[it.first] = res; - } -} -void AutoBatchInferRequest::SetBlobsToAnotherRequest(SoIInferRequestInternal& req) { - for (const auto& it : _networkInputs) { - auto& name = it.first; - // this request is already in BUSY state, so using the internal functions safely - auto blob = GetBlob(name); - if (req->GetBlob(name) != blob) - req->SetBlob(name, blob); - } - for (const auto& it : _networkOutputs) { - auto& name = it.first; - // this request is already in BUSY state, so using the internal functions safely - auto blob = GetBlob(name); - if (req->GetBlob(name) != blob) - req->SetBlob(name, blob); - } -} - -void AutoBatchInferRequest::CopyInputsIfNeeded() { - for (const auto& it : _networkInputs) { - auto& name = it.first; - // this request is already in BUSY state, so using the internal functions safely - CopyBlobIfNeeded(GetBlob(name), _myBatchedRequestWrapper._inferRequestBatched->GetBlob(name), true); - } -} - -void AutoBatchInferRequest::CopyBlobIfNeeded(InferenceEngine::Blob::CPtr src, - InferenceEngine::Blob::Ptr dst, - bool bInput) { - auto bufferDst = dst->buffer(); - auto ptrDst = bufferDst.as(); - auto bufferSrc = src->cbuffer(); - auto ptrSrc = bufferSrc.as(); - ptrdiff_t szDst = dst->byteSize(); - ptrdiff_t szSrc = src->byteSize(); - if (bInput) { - ptrdiff_t offset = szSrc != szDst ? _batchId * szDst / _batchSize : 0; - if ((ptrDst + offset) == ptrSrc) - return; - else - memcpy(ptrDst + offset, ptrSrc, szSrc); - } else { - ptrdiff_t offset = szSrc != szDst ? _batchId * szSrc / _batchSize : 0; - if ((ptrSrc + offset) == ptrDst) - return; - else - memcpy(ptrDst, ptrSrc + offset, szDst); - } -} - -void AutoBatchInferRequest::CopyOutputsIfNeeded() { - for (const auto& it : _networkOutputs) { - auto& name = it.first; - // this request is already in BUSY state, so using the internal functions safely - CopyBlobIfNeeded(_myBatchedRequestWrapper._inferRequestBatched->GetBlob(name), GetBlob(name), false); - } -} - -AutoBatchAsyncInferRequest::AutoBatchAsyncInferRequest( - const AutoBatchInferRequest::Ptr& inferRequest, - InferenceEngine::SoIInferRequestInternal& inferRequestWithoutBatch, - const ITaskExecutor::Ptr& callbackExecutor) - : AsyncInferRequestThreadSafeDefault(inferRequest, nullptr, callbackExecutor), - _inferRequestWithoutBatch(inferRequestWithoutBatch), - _inferRequest{inferRequest} { - // this executor starts the inference while the task (checking the result) is passed to the next stage - struct ThisRequestExecutor : public ITaskExecutor { - explicit ThisRequestExecutor(AutoBatchAsyncInferRequest* _this_) : _this{_this_} {} - void run(Task task) override { - auto& workerInferRequest = _this->_inferRequest->_myBatchedRequestWrapper; - std::pair t; - t.first = _this; - t.second = std::move(task); - workerInferRequest._tasks.push(t); - // it is ok to call size() here as the queue only grows (and the bulk removal happens under the mutex) - const int sz = static_cast(workerInferRequest._tasks.size()); - if (sz == workerInferRequest._batchSize) { - workerInferRequest._cond.notify_one(); - } - }; - AutoBatchAsyncInferRequest* _this = nullptr; - }; - _pipeline = {{/*TaskExecutor*/ std::make_shared(this), /*task*/ [this] { - if (this->_inferRequest->_exceptionPtr) // if the exception happened in the batch1 fallback - std::rethrow_exception(this->_inferRequest->_exceptionPtr); - auto& batchReq = this->_inferRequest->_myBatchedRequestWrapper; - if (batchReq._exceptionPtr) // when the batchN execution failed - std::rethrow_exception(batchReq._exceptionPtr); - // in the case of non-batched execution the blobs were set explicitly - if (AutoBatchInferRequest::eExecutionFlavor::BATCH_EXECUTED == - this->_inferRequest->_wasBatchedRequestUsed) - this->_inferRequest->CopyOutputsIfNeeded(); - }}}; -} - -std::map AutoBatchAsyncInferRequest::GetPerformanceCounts() - const { - CheckState(); - if (AutoBatchInferRequest::eExecutionFlavor::BATCH_EXECUTED == _inferRequest->_wasBatchedRequestUsed) - return _inferRequest->_myBatchedRequestWrapper._inferRequestBatched->GetPerformanceCounts(); - else - return _inferRequestWithoutBatch->GetPerformanceCounts(); -} - -void AutoBatchAsyncInferRequest::Infer_ThreadUnsafe() { - InferUsingAsync(); -} - -AutoBatchAsyncInferRequest::~AutoBatchAsyncInferRequest() { - StopAndWait(); -} - -// ------------------------------AutoBatchExecutableNetwork---------------------------- -AutoBatchExecutableNetwork::AutoBatchExecutableNetwork( - const InferenceEngine::SoExecutableNetworkInternal& networkWithBatch, - const InferenceEngine::SoExecutableNetworkInternal& networkWithoutBatch, - const DeviceInformation& networkDevice, - const std::unordered_map& config, - const std::set& batchedInputs, - const std::set& batchedOutputs) - : InferenceEngine::ExecutableNetworkThreadSafeDefault(nullptr, - std::make_shared()), - _network{networkWithBatch}, - _networkWithoutBatch{networkWithoutBatch}, - _config{config}, - _batchedInputs(batchedInputs), - _batchedOutputs(batchedOutputs) { - // WA for gcc 4.8 ( fails compilation with member init-list) - _device = networkDevice; - auto time_out = config.find(CONFIG_KEY(AUTO_BATCH_TIMEOUT)); - IE_ASSERT(time_out != config.end()); - _timeOut = ParseTimeoutValue(time_out->second.as()); -} - -AutoBatchExecutableNetwork::~AutoBatchExecutableNetwork() { - _terminate = true; - for (const auto& w : _workerRequests) { - w->_thread.join(); - } - _workerRequests.clear(); -} - -unsigned int AutoBatchExecutableNetwork::ParseTimeoutValue(const std::string& s) { - auto val = std::stoi(s); - if (val < 0) - IE_THROW(ParameterMismatch) << "Value for the " << CONFIG_KEY(AUTO_BATCH_TIMEOUT) << " should be unsigned int"; - return val; -} - -std::shared_ptr AutoBatchExecutableNetwork::GetContext() const { - return _networkWithoutBatch->GetContext(); -} - -InferenceEngine::IInferRequestInternal::Ptr AutoBatchExecutableNetwork::CreateInferRequestImpl( - InferenceEngine::InputsDataMap networkInputs, - InferenceEngine::OutputsDataMap networkOutputs) { - auto workerRequestPtrAndId = GetWorkerInferRequest(); - return std::make_shared(networkInputs, - networkOutputs, - workerRequestPtrAndId.first, - workerRequestPtrAndId.second, - _device.batchForDevice, - _batchedInputs, - _batchedOutputs); -} - -InferenceEngine::IInferRequestInternal::Ptr AutoBatchExecutableNetwork::CreateInferRequestImpl( - const std::vector>& inputs, - const std::vector>& outputs) { - if (!this->_plugin || !_plugin->IsNewAPI()) - return nullptr; - auto workerRequestPtrAndId = GetWorkerInferRequest(); - return std::make_shared(inputs, - outputs, - workerRequestPtrAndId.first, - workerRequestPtrAndId.second, - _device.batchForDevice, - _batchedInputs, - _batchedOutputs); -} - -std::pair AutoBatchExecutableNetwork::GetWorkerInferRequest() { - auto num = _numRequestsCreated++; - std::lock_guard lock(_workerRequestsMutex); - auto batch_id = num % _device.batchForDevice; - if (!batch_id) { // need new request - _workerRequests.push_back(std::make_shared()); - auto workerRequestPtr = _workerRequests.back().get(); - workerRequestPtr->_inferRequestBatched = {_network->CreateInferRequest(), _network._so}; - workerRequestPtr->_batchSize = _device.batchForDevice; - workerRequestPtr->_completionTasks.resize(workerRequestPtr->_batchSize); - workerRequestPtr->_inferRequestBatched->SetCallback( - [workerRequestPtr](std::exception_ptr exceptionPtr) mutable { - if (exceptionPtr) - workerRequestPtr->_exceptionPtr = exceptionPtr; - IE_ASSERT(workerRequestPtr->_completionTasks.size() == (size_t)workerRequestPtr->_batchSize); - // notify the individual requests on the completion - for (int c = 0; c < workerRequestPtr->_batchSize; c++) { - workerRequestPtr->_completionTasks[c](); - } - // reset the timeout - workerRequestPtr->_cond.notify_one(); - }); - - workerRequestPtr->_thread = std::thread([workerRequestPtr, this] { - while (1) { - std::cv_status status; - { - std::unique_lock lock(workerRequestPtr->_mutex); - status = workerRequestPtr->_cond.wait_for(lock, std::chrono::milliseconds(_timeOut)); - } - if (_terminate) { - break; - } else { - // as we pop the tasks from the queue only here - // it is ok to call size() (as the _tasks can only grow in parallel) - const int sz = static_cast(workerRequestPtr->_tasks.size()); - if (sz == workerRequestPtr->_batchSize) { - std::pair t; - for (int n = 0; n < sz; n++) { - IE_ASSERT(workerRequestPtr->_tasks.try_pop(t)); - workerRequestPtr->_completionTasks[n] = std::move(t.second); - t.first->_inferRequest->CopyInputsIfNeeded(); - t.first->_inferRequest->_wasBatchedRequestUsed = - AutoBatchInferRequest::eExecutionFlavor::BATCH_EXECUTED; - } - workerRequestPtr->_inferRequestBatched->StartAsync(); - } else if ((status == std::cv_status::timeout) && sz) { - // timeout to collect the batch is over, have to execute the requests in the batch1 mode - std::pair t; - // popping all tasks collected by the moment of the time-out and execute each with batch1 - std::atomic arrived = {0}; - std::promise all_completed; - auto all_completed_future = all_completed.get_future(); - for (int n = 0; n < sz; n++) { - IE_ASSERT(workerRequestPtr->_tasks.try_pop(t)); - t.first->_inferRequestWithoutBatch->SetCallback( - [t, sz, &arrived, &all_completed](std::exception_ptr p) { - if (p) - t.first->_inferRequest->_exceptionPtr = p; - t.second(); - if (sz == ++arrived) - all_completed.set_value(); - }); - t.first->_inferRequest->_wasBatchedRequestUsed = - AutoBatchInferRequest::eExecutionFlavor::TIMEOUT_EXECUTED; - t.first->_inferRequest->SetBlobsToAnotherRequest(t.first->_inferRequestWithoutBatch); - t.first->_inferRequestWithoutBatch->StartAsync(); - } - all_completed_future.get(); - // now when all the tasks for this batch are completed, start waiting for the timeout again - } - } - } - }); - } - return {*_workerRequests.back(), static_cast(batch_id)}; -} - -InferenceEngine::IInferRequestInternal::Ptr AutoBatchExecutableNetwork::CreateInferRequest() { - if (!_network) { - auto res = _networkWithoutBatch->CreateInferRequest(); - res->setPointerToExecutableNetworkInternal(shared_from_this()); - res->setPointerToSo(_networkWithoutBatch._so); - _so = _networkWithoutBatch._so; - return res; - } - // trying to create the new API request first - IInferRequestInternal::Ptr syncRequestImpl = CreateInferRequestImpl(_parameters, _results); - if (!syncRequestImpl) - syncRequestImpl = CreateInferRequestImpl(_networkInputs, _networkOutputs); - syncRequestImpl->setPointerToExecutableNetworkInternal(shared_from_this()); - InferenceEngine::SoIInferRequestInternal inferRequestWithoutBatch = {_networkWithoutBatch->CreateInferRequest(), - _networkWithoutBatch._so}; - return std::make_shared( - std::static_pointer_cast(syncRequestImpl), - inferRequestWithoutBatch, - _callbackExecutor); -} - -std::shared_ptr AutoBatchExecutableNetwork::GetExecGraphInfo() { - return _network && _network->GetExecGraphInfo() ? _network->GetExecGraphInfo() - : _networkWithoutBatch->GetExecGraphInfo(); -} - -void AutoBatchExecutableNetwork::SetConfig(const std::map& user_config) { - auto timeout = user_config.find(CONFIG_KEY(AUTO_BATCH_TIMEOUT)); - if (timeout == user_config.end() || user_config.size() > 1) { - IE_THROW() << "The only config that can be changed on the fly for the AutoBatching the is the " - << CONFIG_KEY(AUTO_BATCH_TIMEOUT); - } else { - _timeOut = ParseTimeoutValue(timeout->second.as()); - } -} - -InferenceEngine::Parameter AutoBatchExecutableNetwork::GetConfig(const std::string& name) const { - auto it = _config.find(name); - if (it != _config.end()) { - return it->second; - } else { - // find config key among networks config keys - auto param = _networkWithoutBatch->GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS)); - for (auto&& configKey : param.as>()) { - if (configKey == name) { - return _networkWithoutBatch->GetConfig(configKey); - } - } - IE_THROW(NotFound) << name << " not found in the ExecutableNetwork config"; - } -} - -InferenceEngine::Parameter AutoBatchExecutableNetwork::GetMetric(const std::string& name) const { - if (name == METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)) { - auto reqs = 0; - try { - auto hint = _networkWithoutBatch->GetConfig(CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)).as(); - reqs = InferenceEngine::PerfHintsConfig::CheckPerformanceHintRequestValue(hint); - if (!reqs) // no limitations from user, let's deduce the full blown #requests - // (multiplied by the devices capabilities to run multiple requests for further perf) - reqs = _device.batchForDevice * - _networkWithoutBatch->GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)).as(); - } catch (const InferenceEngine::Exception&) { - } - reqs = std::max(reqs, _device.batchForDevice); // round up to the possible user's value - IE_SET_METRIC_RETURN(OPTIMAL_NUMBER_OF_INFER_REQUESTS, reqs); - } else if (name == METRIC_KEY(NETWORK_NAME)) { - IE_SET_METRIC_RETURN(NETWORK_NAME, _networkWithoutBatch->GetMetric(METRIC_KEY(NETWORK_NAME)).as()); - } else if (name == METRIC_KEY(SUPPORTED_METRICS)) { - IE_SET_METRIC_RETURN(SUPPORTED_METRICS, - {METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS), - METRIC_KEY(SUPPORTED_METRICS), - METRIC_KEY(NETWORK_NAME), - METRIC_KEY(SUPPORTED_CONFIG_KEYS), - ov::execution_devices.name()}); - } else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) { - IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, - {CONFIG_KEY(AUTO_BATCH_TIMEOUT)}); // only timeout can be changed on the fly - } else if (name == ov::execution_devices) { - return _networkWithoutBatch->GetMetric(name); - } else { - IE_THROW() << "Unsupported Network metric: " << name; - } -} - -// ------------------------------AutoBatchInferencePlugin---------------------------- - -namespace { - -std::map mergeConfigs(std::map config, - const std::map& user_config) { - for (auto&& kvp : user_config) { - config[kvp.first] = kvp.second; - } - return config; -} - -} // namespace - -DeviceInformation AutoBatchInferencePlugin::ParseBatchDevice(const std::string& deviceWithBatch) { - auto&& d = deviceWithBatch; - auto openingBracket = d.find_first_of('('); - auto closingBracket = d.find_first_of(')', openingBracket); - auto deviceName = d.substr(0, openingBracket); - - int batch = 0; - if (closingBracket != std::string::npos && openingBracket < closingBracket) { - batch = std::stol(d.substr(openingBracket + 1, closingBracket - 1)); - - if (batch <= 0) { - IE_THROW() << "Batch value for '" << deviceName << "' must be > 0, while " << batch << "is passed"; - } - } - return {deviceName, {{}}, batch}; -} - -DeviceInformation AutoBatchInferencePlugin::ParseMetaDevice( - const std::string& devicesBatchCfg, - const std::map& user_config) const { - auto metaDevice = ParseBatchDevice(devicesBatchCfg); - metaDevice.config = GetCore()->GetSupportedConfig(metaDevice.deviceName, user_config); - - // check that no irrelevant config-keys left - for (const auto& k : user_config) { - const auto& name = k.first; - if (metaDevice.config.find(name) == metaDevice.config.end() && - !ov::util::contains(supported_configKeys, name)) { - IE_THROW() << "Unsupported config key: " << name; - } - } - return metaDevice; -} - -RemoteContext::Ptr AutoBatchInferencePlugin::CreateContext(const InferenceEngine::ParamMap& remote_properties) { - auto cfg = remote_properties; - auto it = cfg.find(CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG)); - if (it == cfg.end()) - it = cfg.find(ov::device::priorities.name()); - if (it == cfg.end()) - IE_THROW() << "Value for KEY_AUTO_BATCH_DEVICE_CONFIG is not set"; - - auto val = it->second.as(); - auto core = GetCore(); - if (!core) - return nullptr; - auto metaDevice = ParseMetaDevice(val, std::map()); - cfg.erase(it); - return core->CreateContext(metaDevice.deviceName, cfg); -} - -Parameter AutoBatchInferencePlugin::GetConfig(const std::string& name, - const std::map& user_options) const { - if (supported_configKeys.end() != std::find(supported_configKeys.begin(), supported_configKeys.end(), name)) { - auto it = _config.find(name); - if (it == _config.end()) { - IE_THROW() << "Value for " << name << " is not set"; - } else { - return {it->second}; - } - } else { - IE_THROW() << "Unsupported config key: " << name; - } -} - -void AutoBatchInferencePlugin::CheckConfig(const std::map& user_config) { - for (auto&& kvp : user_config) { - const auto name = kvp.first; - const auto val = kvp.second; - if (supported_configKeys.end() == std::find(supported_configKeys.begin(), supported_configKeys.end(), name)) - IE_THROW() << "Unsupported config key: " << name; - if (name == CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) || name == ov::device::priorities.name()) { - ParseBatchDevice(val); - } else if (name == CONFIG_KEY(AUTO_BATCH_TIMEOUT)) { - try { - auto t = std::stoi(val); - if (t < 0) - IE_THROW(ParameterMismatch); - } catch (const std::exception&) { - IE_THROW(ParameterMismatch) - << " Expecting unsigned int value for " << CONFIG_KEY(AUTO_BATCH_TIMEOUT) << " got " << val; - } - } - } -} - -void AutoBatchInferencePlugin::SetConfig(const std::map& user_config) { - CheckConfig(user_config); - for (auto&& kvp : user_config) { - _config[kvp.first] = kvp.second; - } -} - -static const Version version = {{2, 1}, CI_BUILD_NUMBER, "AutoBatchPlugin"}; -IE_DEFINE_PLUGIN_CREATE_FUNCTION(AutoBatchInferencePlugin, version) - -AutoBatchInferencePlugin::AutoBatchInferencePlugin() { - _pluginName = "BATCH"; - _config[CONFIG_KEY(AUTO_BATCH_TIMEOUT)] = "1000"; // default value, in ms -} - -InferenceEngine::Parameter AutoBatchInferencePlugin::GetMetric( - const std::string& name, - const std::map& user_options) const { - if (name == METRIC_KEY(SUPPORTED_METRICS)) { - std::vector metrics; - metrics.push_back(METRIC_KEY(SUPPORTED_METRICS)); - metrics.push_back(METRIC_KEY(FULL_DEVICE_NAME)); - metrics.push_back(METRIC_KEY(SUPPORTED_CONFIG_KEYS)); - IE_SET_METRIC_RETURN(SUPPORTED_METRICS, metrics); - } else if (name == METRIC_KEY(FULL_DEVICE_NAME)) { - IE_SET_METRIC_RETURN(FULL_DEVICE_NAME, _pluginName); - } else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) { - IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, supported_configKeys); - } else { - IE_THROW(NotFound) << "Unsupported metric key " << name; - } -} - -IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadExeNetworkImpl( - const InferenceEngine::CNNNetwork& network, - const std::map& user_config) { - return LoadNetworkImpl(network, nullptr, user_config); -} - -InferenceEngine::IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadNetworkImpl( - const InferenceEngine::CNNNetwork& network, - const std::shared_ptr ctx, - const std::map& user_config) { - auto core = GetCore(); - if (core == nullptr) { - IE_THROW() << "Please, work with Auto-Batching device via InferencEngine::Core object"; - } - auto fullConfig = mergeConfigs(_config, user_config); - auto device_batch = fullConfig.find(CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG)); - if (device_batch == fullConfig.end()) - device_batch = fullConfig.find(ov::device::priorities.name()); - if (device_batch == fullConfig.end()) { - IE_THROW() << "KEY_AUTO_BATCH key is not set for BATCH device"; - } - auto metaDevice = ParseMetaDevice(device_batch->second, user_config); - const auto& deviceName = metaDevice.deviceName; - const auto& deviceConfig = metaDevice.config; - auto deviceConfigNoAutoBatch = deviceConfig; - // avoid recursive auto-batching - deviceConfigNoAutoBatch[CONFIG_KEY(ALLOW_AUTO_BATCHING)] = CONFIG_VALUE(NO); - - std::set batched_inputs; - std::set batched_outputs; - // check that the auto-batching is applicable in general - try { - // if applicable, the Auto-Batching is implicitly enabled via the performance hints - const auto tput = CONFIG_VALUE(THROUGHPUT); - const bool bTputInPlg = core->GetConfig(deviceName, CONFIG_KEY(PERFORMANCE_HINT)).as() == tput; - const auto& mode = deviceConfig.find(CONFIG_KEY(PERFORMANCE_HINT)); - const bool bTputInLoadCfg = (mode != deviceConfig.end() && mode->second == tput); - // if the auto-batching is enabled implicitly, check the dims carefully, to avoid outstanding failures - const bool check_dims = (bTputInPlg || bTputInLoadCfg); - CNNNetwork clonedNetwork(InferenceEngine::details::cloneNetwork(network)); - auto function = clonedNetwork.getFunction(); - // find the batch dim - ov::pass::Manager m; - m.register_pass(); - m.register_pass(false, check_dims); - m.run_passes(function); - // do not reshape/re-batch originally batched networks and when there are no inputs with the N* layouts - // input(s) should have the batch dim as the first dim (current limitation of the auto-batching impl) - const auto& params = function->get_parameters(); - for (size_t input_id = 0; input_id < params.size(); input_id++) { - const auto& input = params[input_id]; - const auto& shape = input->get_partial_shape(); - // currently no plugin support batched execution for dynamic networks - if (shape.is_dynamic()) - IE_THROW(NotImplemented) << "Auto-batching does not support dynamic networks!"; - // check the batch dim: either 0th (and the original batch size of 1) or none - if (shape.size() && ov::DimensionTracker::get_label(shape[0])) { - const auto& static_shape = input->get_shape(); - if (static_shape[0] != 1) - IE_THROW(NotImplemented) << "Auto-batching does not reshape/re-batch originally batched networks!"; - batched_inputs.insert( - ov::op::util::get_ie_output_name(params[input_id]->output(0))); // batched dim for the input - } else { - // if the 0-th dim is not for the batch, then we support only the case when NONE dimension is batch - for (size_t s = 1; s < shape.size(); s++) - if (ov::DimensionTracker::get_label(shape[s])) - IE_THROW(NotImplemented) - << "Auto-batching operates only networks with inputs/outputs batched by 0th dimension"; - } - } - const auto& results = function->get_results(); - for (size_t output_id = 0; output_id < results.size(); output_id++) { - const auto& output = results[output_id]; - const auto& shape = output->get_output_partial_shape(0); - if (shape.is_dynamic()) - IE_THROW(NotImplemented) << "Auto-batching does not support dynamic networks!"; - // check the batch dim: either 0th (and the original batch size of 1) or none - if (shape.size() && ov::DimensionTracker::get_label(shape[0])) { - if (shape[0] != 1) - IE_THROW(NotImplemented) << "Auto-batching does not reshape/re-batch originally batched networks!"; - const auto& node = output->input_value(0); - batched_outputs.insert( - ov::op::util::get_ie_output_name(ov::Output(node.get_node(), node.get_index()))); - } else { - // if the 0-th dim is not for the batch, then we support only the case when NONE dimension is batch - for (size_t s = 1; s < shape.size(); s++) - if (ov::DimensionTracker::get_label(shape[s])) - IE_THROW(NotImplemented) - << "Auto-batching operates only networks with outputs batched by 0th dimension"; - } - } - if (!batched_inputs.size() || !batched_outputs.size()) - IE_THROW(NotImplemented) - << "Auto-batching supports only networks with inputs/outputs featuring batched dim!"; - } catch (const InferenceEngine::Exception&) { - metaDevice.batchForDevice = 1; - } - - if (!metaDevice.batchForDevice) { - unsigned int requests = 0; - // batch size is not set explicitly via device name e.g. BATCH:GPU(4) - // let's query the optimal batch size - std::map options; - options["MODEL_PTR"] = std::const_pointer_cast(network.getFunction()); - auto optBatchSize = core->GetMetric(deviceName, METRIC_KEY(OPTIMAL_BATCH_SIZE), options).as(); - auto res = core->GetConfig(deviceName, CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)).as(); - requests = PerfHintsConfig::CheckPerformanceHintRequestValue(res); - const auto& reqs = user_config.find(CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)); - if (reqs != user_config.end()) - requests = static_cast(PerfHintsConfig::CheckPerformanceHintRequestValue(reqs->second)); - if (requests) - optBatchSize = std::max(1u, std::min(requests, optBatchSize)); - if (optBatchSize > 2) // batching is usually in-efficient for batch<4 (as batch1 kernels are heavily optimized) - metaDevice.batchForDevice = optBatchSize; - else - metaDevice.batchForDevice = 1; - } - - auto report_footprint = [](std::shared_ptr pCore, std::string device) -> size_t { - size_t footprint = 0; - // TODO: use the per-network metric (22.2) rather than plugin-level - auto stats = - pCore->GetMetric(device, ov::intel_gpu::memory_statistics.name()).as>(); - for (const auto& s : stats) - footprint += s.second; - return footprint; - }; - - size_t batch1_footprint = 0; - if (deviceName.find("GPU") != std::string::npos) - batch1_footprint = report_footprint(core, deviceName); - auto executableNetworkWithoutBatch = ctx ? core->LoadNetwork(network, ctx, deviceConfigNoAutoBatch) - : core->LoadNetwork(network, deviceName, deviceConfigNoAutoBatch); - if (deviceName.find("GPU") != std::string::npos) { - batch1_footprint = report_footprint(core, deviceName) - batch1_footprint; - if (batch1_footprint) { - const auto total_mem = - GetCore()->GetMetric(deviceName, GPU_METRIC_KEY(DEVICE_TOTAL_MEM_SIZE)).as(); - const int estimated_batch = static_cast((total_mem - batch1_footprint) / batch1_footprint); - int closest = static_cast(pow(2, floor(log(estimated_batch) / log(2)))); - closest = std::max(1, closest); - metaDevice.batchForDevice = std::min(metaDevice.batchForDevice, closest); - } - } - // auto-batch settings - std::unordered_map networkConfig; - for (const auto& c : fullConfig) { - if (supported_configKeys.end() != std::find(supported_configKeys.begin(), supported_configKeys.end(), c.first)) - networkConfig.insert(c); - } - - InferenceEngine::SoExecutableNetworkInternal executableNetworkWithBatch; - if (metaDevice.batchForDevice > 1 && batched_inputs.size()) { - try { - CNNNetwork reshaped(InferenceEngine::details::cloneNetwork(network)); - ICNNNetwork::InputShapes shapes = reshaped.getInputShapes(); - for (const auto& input : batched_inputs) - shapes[input][0] = metaDevice.batchForDevice; - reshaped.reshape(shapes); - executableNetworkWithBatch = ctx ? core->LoadNetwork(reshaped, ctx, deviceConfigNoAutoBatch) - : core->LoadNetwork(reshaped, deviceName, deviceConfigNoAutoBatch); - } catch (const InferenceEngine::Exception&) { - metaDevice.batchForDevice = 1; - } - } - - return std::make_shared(executableNetworkWithBatch, - executableNetworkWithoutBatch, - metaDevice, - networkConfig, - batched_inputs, - batched_outputs); -} - -InferenceEngine::IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadExeNetworkImpl( - const InferenceEngine::CNNNetwork& network, - const std::shared_ptr& context, - const std::map& user_config) { - return LoadNetworkImpl(network, context, user_config); -} - -InferenceEngine::QueryNetworkResult AutoBatchInferencePlugin::QueryNetwork( - const InferenceEngine::CNNNetwork& network, - const std::map& user_config) const { - auto core = GetCore(); - if (!core) - return InferenceEngine::QueryNetworkResult(); - auto cfg = user_config; - for (const auto& c : cfg) { - if (c.first == CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) || c.first == ov::device::priorities.name()) { - auto val = c.second; - cfg.erase(c.first); - auto metaDevice = ParseMetaDevice(val, cfg); - return core->QueryNetwork(network, metaDevice.deviceName, cfg); - } - } - IE_THROW() << "Value for KEY_AUTO_BATCH_DEVICE_CONFIG is not set"; -} -} // namespace AutoBatchPlugin diff --git a/src/plugins/auto_batch/src/auto_batch.hpp b/src/plugins/auto_batch/src/auto_batch.hpp deleted file mode 100644 index 5978a9f0fe8..00000000000 --- a/src/plugins/auto_batch/src/auto_batch.hpp +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#include "cpp_interfaces/impl/ie_executable_network_thread_safe_default.hpp" -#include "cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "ie_metric_helpers.hpp" -#include "threading/ie_thread_safe_containers.hpp" - -#ifdef AUTOBATCH_UNITTEST -# define AutoBatchPlugin MockAutoBatchPlugin -#endif - -namespace AutoBatchPlugin { - -using DeviceName = std::string; - -struct DeviceInformation { - DeviceName deviceName; - std::map config; - int batchForDevice; -}; - -class AutoBatchAsyncInferRequest; -class AutoBatchExecutableNetwork : public InferenceEngine::ExecutableNetworkThreadSafeDefault { -public: - using Ptr = std::shared_ptr; - struct WorkerInferRequest { - using Ptr = std::shared_ptr; - InferenceEngine::SoIInferRequestInternal _inferRequestBatched; - int _batchSize; - InferenceEngine::ThreadSafeQueueWithSize> _tasks; - std::vector _completionTasks; - std::thread _thread; - std::condition_variable _cond; - std::mutex _mutex; - std::exception_ptr _exceptionPtr; - }; - - explicit AutoBatchExecutableNetwork( - const InferenceEngine::SoExecutableNetworkInternal& networkForDevice, - const InferenceEngine::SoExecutableNetworkInternal& networkForDeviceWithoutBatch, - const DeviceInformation& networkDevices, - const std::unordered_map& config, - const std::set& batchedIntputs, - const std::set& batchedOutputs); - - void SetConfig(const std::map& config) override; - InferenceEngine::Parameter GetConfig(const std::string& name) const override; - InferenceEngine::Parameter GetMetric(const std::string& name) const override; - InferenceEngine::IInferRequestInternal::Ptr CreateInferRequest() override; - InferenceEngine::IInferRequestInternal::Ptr CreateInferRequestImpl( - InferenceEngine::InputsDataMap networkInputs, - InferenceEngine::OutputsDataMap networkOutputs) override; - InferenceEngine::IInferRequestInternal::Ptr CreateInferRequestImpl( - const std::vector>& inputs, - const std::vector>& outputs) override; - std::shared_ptr GetContext() const override; - std::shared_ptr GetExecGraphInfo() override; - virtual ~AutoBatchExecutableNetwork(); - -protected: - static unsigned int ParseTimeoutValue(const std::string&); - std::atomic_bool _terminate = {false}; - DeviceInformation _device; - InferenceEngine::SoExecutableNetworkInternal _network; - InferenceEngine::SoExecutableNetworkInternal _networkWithoutBatch; - - std::pair GetWorkerInferRequest(); - std::vector _workerRequests; - std::mutex _workerRequestsMutex; - - std::unordered_map _config; - bool _needPerfCounters = false; - std::atomic_size_t _numRequestsCreated = {0}; - std::atomic_int _timeOut = {0}; // in ms - - const std::set _batchedInputs; - const std::set _batchedOutputs; -}; - -class AutoBatchInferRequest : public InferenceEngine::IInferRequestInternal { -public: - using Ptr = std::shared_ptr; - explicit AutoBatchInferRequest(const InferenceEngine::InputsDataMap& networkInputs, - const InferenceEngine::OutputsDataMap& networkOutputs, - AutoBatchExecutableNetwork::WorkerInferRequest& workerRequestPtr, - int batch_id, - int num_batch, - const std::set& batchedIntputs, - const std::set& batchedOutputs); - explicit AutoBatchInferRequest(const std::vector>& inputs, - const std::vector>& outputs, - AutoBatchExecutableNetwork::WorkerInferRequest& workerRequestPtr, - int batch_id, - int num_batch, - const std::set& batchedIntputs, - const std::set& batchedOutputs); - - // Batch-Device impl specific: sets the data (blobs from the device request to the batched device request) - void SetBlobsToAnotherRequest(InferenceEngine::SoIInferRequestInternal& req); - void CopyInputsIfNeeded(); - void CopyOutputsIfNeeded(); - AutoBatchExecutableNetwork::WorkerInferRequest& _myBatchedRequestWrapper; - std::exception_ptr _exceptionPtr; - enum eExecutionFlavor : uint8_t { - NOT_EXECUTED, - BATCH_EXECUTED, - TIMEOUT_EXECUTED - } _wasBatchedRequestUsed = eExecutionFlavor::NOT_EXECUTED; - -protected: - void CopyBlobIfNeeded(InferenceEngine::Blob::CPtr src, InferenceEngine::Blob::Ptr dst, bool bInput); - void ShareBlobsWithBatchRequest(const std::set& batchedIntputs, - const std::set& batchedOutputs); - size_t _batchId; - size_t _batchSize; -}; - -class AutoBatchAsyncInferRequest : public InferenceEngine::AsyncInferRequestThreadSafeDefault { -public: - using Ptr = std::shared_ptr; - - explicit AutoBatchAsyncInferRequest(const AutoBatchInferRequest::Ptr& inferRequest, - InferenceEngine::SoIInferRequestInternal& inferRequestWithoutBatch, - const InferenceEngine::ITaskExecutor::Ptr& callbackExecutor); - void Infer_ThreadUnsafe() override; - virtual ~AutoBatchAsyncInferRequest(); - std::map GetPerformanceCounts() const override; - - InferenceEngine::SoIInferRequestInternal _inferRequestWithoutBatch; - AutoBatchInferRequest::Ptr _inferRequest; -}; - -class AutoBatchInferencePlugin : public InferenceEngine::IInferencePlugin { -public: - AutoBatchInferencePlugin(); - virtual ~AutoBatchInferencePlugin() = default; - InferenceEngine::IExecutableNetworkInternal::Ptr LoadExeNetworkImpl( - const InferenceEngine::CNNNetwork& network, - const std::map& config) override; - InferenceEngine::IExecutableNetworkInternal::Ptr LoadExeNetworkImpl( - const InferenceEngine::CNNNetwork& network, - const std::shared_ptr& context, - const std::map& config) override; - - void SetConfig(const std::map& config) override; - void CheckConfig(const std::map& config); - - InferenceEngine::Parameter GetConfig( - const std::string& name, - const std::map& options) const override; - InferenceEngine::QueryNetworkResult QueryNetwork(const InferenceEngine::CNNNetwork& network, - const std::map& config) const override; - InferenceEngine::Parameter GetMetric( - const std::string& name, - const std::map& options) const override; - InferenceEngine::RemoteContext::Ptr CreateContext(const InferenceEngine::ParamMap&) override; -#ifdef AUTOBATCH_UNITTEST - -public: -#else - -protected: -#endif - DeviceInformation ParseMetaDevice(const std::string& devicesBatchCfg, - const std::map& config) const; - - static DeviceInformation ParseBatchDevice(const std::string& deviceWithBatch); - - InferenceEngine::IExecutableNetworkInternal::Ptr LoadNetworkImpl( - const InferenceEngine::CNNNetwork& network, - const std::shared_ptr context, - const std::map& config); -}; - -} // namespace AutoBatchPlugin diff --git a/src/plugins/auto_batch/src/compiled_model.cpp b/src/plugins/auto_batch/src/compiled_model.cpp new file mode 100644 index 00000000000..e08ead91de0 --- /dev/null +++ b/src/plugins/auto_batch/src/compiled_model.cpp @@ -0,0 +1,244 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#include "compiled_model.hpp" + +#include "async_infer_request.hpp" +#include "ie_performance_hints.hpp" +#include "sync_infer_request.hpp" + +namespace AutoBatchPlugin { +using namespace InferenceEngine; +AutoBatchExecutableNetwork::AutoBatchExecutableNetwork( + const InferenceEngine::SoExecutableNetworkInternal& networkWithBatch, + const InferenceEngine::SoExecutableNetworkInternal& networkWithoutBatch, + const DeviceInformation& networkDevice, + const std::unordered_map& config, + const std::set& batchedInputs, + const std::set& batchedOutputs) + : InferenceEngine::ExecutableNetworkThreadSafeDefault(nullptr, + std::make_shared()), + _network{networkWithBatch}, + _networkWithoutBatch{networkWithoutBatch}, + _config{config}, + _batchedInputs(batchedInputs), + _batchedOutputs(batchedOutputs) { + // WA for gcc 4.8 ( fails compilation with member init-list) + _device = networkDevice; + auto time_out = config.find(CONFIG_KEY(AUTO_BATCH_TIMEOUT)); + IE_ASSERT(time_out != config.end()); + _timeOut = ParseTimeoutValue(time_out->second.as()); +} + +AutoBatchExecutableNetwork::~AutoBatchExecutableNetwork() { + _terminate = true; + for (const auto& w : _workerRequests) { + w->_thread.join(); + } + _workerRequests.clear(); +} + +unsigned int AutoBatchExecutableNetwork::ParseTimeoutValue(const std::string& s) { + auto val = std::stoi(s); + if (val < 0) + IE_THROW(ParameterMismatch) << "Value for the " << CONFIG_KEY(AUTO_BATCH_TIMEOUT) << " should be unsigned int"; + return val; +} + +std::shared_ptr AutoBatchExecutableNetwork::GetContext() const { + return _networkWithoutBatch->GetContext(); +} + +InferenceEngine::IInferRequestInternal::Ptr AutoBatchExecutableNetwork::CreateInferRequestImpl( + InferenceEngine::InputsDataMap networkInputs, + InferenceEngine::OutputsDataMap networkOutputs) { + auto workerRequestPtrAndId = GetWorkerInferRequest(); + return std::make_shared(networkInputs, + networkOutputs, + workerRequestPtrAndId.first, + workerRequestPtrAndId.second, + _device.batchForDevice, + _batchedInputs, + _batchedOutputs); +} + +InferenceEngine::IInferRequestInternal::Ptr AutoBatchExecutableNetwork::CreateInferRequestImpl( + const std::vector>& inputs, + const std::vector>& outputs) { + if (!this->_plugin || !_plugin->IsNewAPI()) + return nullptr; + auto workerRequestPtrAndId = GetWorkerInferRequest(); + return std::make_shared(inputs, + outputs, + workerRequestPtrAndId.first, + workerRequestPtrAndId.second, + _device.batchForDevice, + _batchedInputs, + _batchedOutputs); +} + +std::pair AutoBatchExecutableNetwork::GetWorkerInferRequest() { + auto num = _numRequestsCreated++; + std::lock_guard lock(_workerRequestsMutex); + auto batch_id = num % _device.batchForDevice; + if (!batch_id) { // need new request + _workerRequests.push_back(std::make_shared()); + auto workerRequestPtr = _workerRequests.back().get(); + workerRequestPtr->_inferRequestBatched = {_network->CreateInferRequest(), _network._so}; + workerRequestPtr->_batchSize = _device.batchForDevice; + workerRequestPtr->_completionTasks.resize(workerRequestPtr->_batchSize); + workerRequestPtr->_inferRequestBatched->SetCallback( + [workerRequestPtr](std::exception_ptr exceptionPtr) mutable { + if (exceptionPtr) + workerRequestPtr->_exceptionPtr = exceptionPtr; + IE_ASSERT(workerRequestPtr->_completionTasks.size() == (size_t)workerRequestPtr->_batchSize); + // notify the individual requests on the completion + for (int c = 0; c < workerRequestPtr->_batchSize; c++) { + workerRequestPtr->_completionTasks[c](); + } + // reset the timeout + workerRequestPtr->_cond.notify_one(); + }); + + workerRequestPtr->_thread = std::thread([workerRequestPtr, this] { + while (1) { + std::cv_status status; + { + std::unique_lock lock(workerRequestPtr->_mutex); + status = workerRequestPtr->_cond.wait_for(lock, std::chrono::milliseconds(_timeOut)); + } + if (_terminate) { + break; + } else { + // as we pop the tasks from the queue only here + // it is ok to call size() (as the _tasks can only grow in parallel) + const int sz = static_cast(workerRequestPtr->_tasks.size()); + if (sz == workerRequestPtr->_batchSize) { + std::pair t; + for (int n = 0; n < sz; n++) { + IE_ASSERT(workerRequestPtr->_tasks.try_pop(t)); + workerRequestPtr->_completionTasks[n] = std::move(t.second); + t.first->_inferRequest->CopyInputsIfNeeded(); + t.first->_inferRequest->_wasBatchedRequestUsed = + AutoBatchInferRequest::eExecutionFlavor::BATCH_EXECUTED; + } + workerRequestPtr->_inferRequestBatched->StartAsync(); + } else if ((status == std::cv_status::timeout) && sz) { + // timeout to collect the batch is over, have to execute the requests in the batch1 mode + std::pair t; + // popping all tasks collected by the moment of the time-out and execute each with batch1 + std::atomic arrived = {0}; + std::promise all_completed; + auto all_completed_future = all_completed.get_future(); + for (int n = 0; n < sz; n++) { + IE_ASSERT(workerRequestPtr->_tasks.try_pop(t)); + t.first->_inferRequestWithoutBatch->SetCallback( + [t, sz, &arrived, &all_completed](std::exception_ptr p) { + if (p) + t.first->_inferRequest->_exceptionPtr = p; + t.second(); + if (sz == ++arrived) + all_completed.set_value(); + }); + t.first->_inferRequest->_wasBatchedRequestUsed = + AutoBatchInferRequest::eExecutionFlavor::TIMEOUT_EXECUTED; + t.first->_inferRequest->SetBlobsToAnotherRequest(t.first->_inferRequestWithoutBatch); + t.first->_inferRequestWithoutBatch->StartAsync(); + } + all_completed_future.get(); + // now when all the tasks for this batch are completed, start waiting for the timeout again + } + } + } + }); + } + return {*_workerRequests.back(), static_cast(batch_id)}; +} + +InferenceEngine::IInferRequestInternal::Ptr AutoBatchExecutableNetwork::CreateInferRequest() { + if (!_network) { + auto res = _networkWithoutBatch->CreateInferRequest(); + res->setPointerToExecutableNetworkInternal(shared_from_this()); + res->setPointerToSo(_networkWithoutBatch._so); + _so = _networkWithoutBatch._so; + return res; + } + // trying to create the new API request first + IInferRequestInternal::Ptr syncRequestImpl = CreateInferRequestImpl(_parameters, _results); + if (!syncRequestImpl) + syncRequestImpl = CreateInferRequestImpl(_networkInputs, _networkOutputs); + syncRequestImpl->setPointerToExecutableNetworkInternal(shared_from_this()); + InferenceEngine::SoIInferRequestInternal inferRequestWithoutBatch = {_networkWithoutBatch->CreateInferRequest(), + _networkWithoutBatch._so}; + return std::make_shared( + std::static_pointer_cast(syncRequestImpl), + inferRequestWithoutBatch, + _callbackExecutor); +} + +std::shared_ptr AutoBatchExecutableNetwork::GetExecGraphInfo() { + return _network && _network->GetExecGraphInfo() ? _network->GetExecGraphInfo() + : _networkWithoutBatch->GetExecGraphInfo(); +} + +void AutoBatchExecutableNetwork::SetConfig(const std::map& user_config) { + auto timeout = user_config.find(CONFIG_KEY(AUTO_BATCH_TIMEOUT)); + if (timeout == user_config.end() || user_config.size() > 1) { + IE_THROW() << "The only config that can be changed on the fly for the AutoBatching the is the " + << CONFIG_KEY(AUTO_BATCH_TIMEOUT); + } else { + _timeOut = ParseTimeoutValue(timeout->second.as()); + } +} + +InferenceEngine::Parameter AutoBatchExecutableNetwork::GetConfig(const std::string& name) const { + auto it = _config.find(name); + if (it != _config.end()) { + return it->second; + } else { + // find config key among networks config keys + auto param = _networkWithoutBatch->GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS)); + for (auto&& configKey : param.as>()) { + if (configKey == name) { + return _networkWithoutBatch->GetConfig(configKey); + } + } + IE_THROW(NotFound) << name << " not found in the ExecutableNetwork config"; + } +} + +InferenceEngine::Parameter AutoBatchExecutableNetwork::GetMetric(const std::string& name) const { + if (name == METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)) { + auto reqs = 0; + try { + auto hint = _networkWithoutBatch->GetConfig(CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)).as(); + reqs = InferenceEngine::PerfHintsConfig::CheckPerformanceHintRequestValue(hint); + if (!reqs) // no limitations from user, let's deduce the full blown #requests + // (multiplied by the devices capabilities to run multiple requests for further perf) + reqs = _device.batchForDevice * + _networkWithoutBatch->GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)).as(); + } catch (const InferenceEngine::Exception&) { + } + reqs = std::max(reqs, _device.batchForDevice); // round up to the possible user's value + IE_SET_METRIC_RETURN(OPTIMAL_NUMBER_OF_INFER_REQUESTS, reqs); + } else if (name == METRIC_KEY(NETWORK_NAME)) { + IE_SET_METRIC_RETURN(NETWORK_NAME, _networkWithoutBatch->GetMetric(METRIC_KEY(NETWORK_NAME)).as()); + } else if (name == METRIC_KEY(SUPPORTED_METRICS)) { + IE_SET_METRIC_RETURN(SUPPORTED_METRICS, + {METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS), + METRIC_KEY(SUPPORTED_METRICS), + METRIC_KEY(NETWORK_NAME), + METRIC_KEY(SUPPORTED_CONFIG_KEYS), + ov::execution_devices.name()}); + } else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) { + IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, + {CONFIG_KEY(AUTO_BATCH_TIMEOUT)}); // only timeout can be changed on the fly + } else if (name == ov::execution_devices) { + return _networkWithoutBatch->GetMetric(name); + } else { + IE_THROW() << "Unsupported Network metric: " << name; + } +} +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/src/compiled_model.hpp b/src/plugins/auto_batch/src/compiled_model.hpp new file mode 100644 index 00000000000..eeaaed5d8d8 --- /dev/null +++ b/src/plugins/auto_batch/src/compiled_model.hpp @@ -0,0 +1,75 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include + +#include "cpp_interfaces/impl/ie_executable_network_thread_safe_default.hpp" +#include "ie_metric_helpers.hpp" +#include "plugin.hpp" +#include "threading/ie_thread_safe_containers.hpp" + +namespace AutoBatchPlugin { + +class AutoBatchAsyncInferRequest; + +class AutoBatchExecutableNetwork : public InferenceEngine::ExecutableNetworkThreadSafeDefault { +public: + using Ptr = std::shared_ptr; + struct WorkerInferRequest { + using Ptr = std::shared_ptr; + InferenceEngine::SoIInferRequestInternal _inferRequestBatched; + int _batchSize; + InferenceEngine::ThreadSafeQueueWithSize> _tasks; + std::vector _completionTasks; + std::thread _thread; + std::condition_variable _cond; + std::mutex _mutex; + std::exception_ptr _exceptionPtr; + }; + + explicit AutoBatchExecutableNetwork( + const InferenceEngine::SoExecutableNetworkInternal& networkForDevice, + const InferenceEngine::SoExecutableNetworkInternal& networkForDeviceWithoutBatch, + const DeviceInformation& networkDevices, + const std::unordered_map& config, + const std::set& batchedIntputs, + const std::set& batchedOutputs); + + void SetConfig(const std::map& config) override; + InferenceEngine::Parameter GetConfig(const std::string& name) const override; + InferenceEngine::Parameter GetMetric(const std::string& name) const override; + InferenceEngine::IInferRequestInternal::Ptr CreateInferRequest() override; + InferenceEngine::IInferRequestInternal::Ptr CreateInferRequestImpl( + InferenceEngine::InputsDataMap networkInputs, + InferenceEngine::OutputsDataMap networkOutputs) override; + InferenceEngine::IInferRequestInternal::Ptr CreateInferRequestImpl( + const std::vector>& inputs, + const std::vector>& outputs) override; + std::shared_ptr GetContext() const override; + std::shared_ptr GetExecGraphInfo() override; + virtual ~AutoBatchExecutableNetwork(); + +protected: + static unsigned int ParseTimeoutValue(const std::string&); + std::atomic_bool _terminate = {false}; + DeviceInformation _device; + InferenceEngine::SoExecutableNetworkInternal _network; + InferenceEngine::SoExecutableNetworkInternal _networkWithoutBatch; + + std::pair GetWorkerInferRequest(); + std::vector _workerRequests; + std::mutex _workerRequestsMutex; + + std::unordered_map _config; + bool _needPerfCounters = false; + std::atomic_size_t _numRequestsCreated = {0}; + std::atomic_int _timeOut = {0}; // in ms + + const std::set _batchedInputs; + const std::set _batchedOutputs; +}; +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/src/plugin.cpp b/src/plugins/auto_batch/src/plugin.cpp new file mode 100644 index 00000000000..c2709fca2d9 --- /dev/null +++ b/src/plugins/auto_batch/src/plugin.cpp @@ -0,0 +1,358 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "plugin.hpp" + +#include "compiled_model.hpp" +#include "dimension_tracker.hpp" +#include "ie_icore.hpp" +#include "ie_metric_helpers.hpp" +#include "ie_ngraph_utils.hpp" +#include "ie_performance_hints.hpp" +#include "openvino/pass/manager.hpp" +#include "openvino/runtime/intel_gpu/properties.hpp" +#include "openvino/util/common_util.hpp" +#include "transformations/common_optimizations/dimension_tracking.hpp" +#include "transformations/init_node_info.hpp" +#include "transformations/utils/utils.hpp" + +namespace AutoBatchPlugin { +using namespace InferenceEngine; + +std::vector supported_configKeys = {CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG), + ov::device::priorities.name(), + CONFIG_KEY(AUTO_BATCH_TIMEOUT), + CONFIG_KEY(CACHE_DIR)}; +namespace { + +std::map mergeConfigs(std::map config, + const std::map& user_config) { + for (auto&& kvp : user_config) { + config[kvp.first] = kvp.second; + } + return config; +} + +} // namespace + +DeviceInformation AutoBatchInferencePlugin::ParseBatchDevice(const std::string& deviceWithBatch) { + auto&& d = deviceWithBatch; + auto openingBracket = d.find_first_of('('); + auto closingBracket = d.find_first_of(')', openingBracket); + auto deviceName = d.substr(0, openingBracket); + + int batch = 0; + if (closingBracket != std::string::npos && openingBracket < closingBracket) { + batch = std::stol(d.substr(openingBracket + 1, closingBracket - 1)); + + if (batch <= 0) { + IE_THROW() << "Batch value for '" << deviceName << "' must be > 0, while " << batch << "is passed"; + } + } + return {deviceName, {{}}, batch}; +} + +DeviceInformation AutoBatchInferencePlugin::ParseMetaDevice( + const std::string& devicesBatchCfg, + const std::map& user_config) const { + auto metaDevice = ParseBatchDevice(devicesBatchCfg); + metaDevice.config = GetCore()->GetSupportedConfig(metaDevice.deviceName, user_config); + + // check that no irrelevant config-keys left + for (const auto& k : user_config) { + const auto& name = k.first; + if (metaDevice.config.find(name) == metaDevice.config.end() && + !ov::util::contains(supported_configKeys, name)) { + IE_THROW() << "Unsupported config key: " << name; + } + } + return metaDevice; +} + +RemoteContext::Ptr AutoBatchInferencePlugin::CreateContext(const InferenceEngine::ParamMap& remote_properties) { + auto cfg = remote_properties; + auto it = cfg.find(CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG)); + if (it == cfg.end()) + it = cfg.find(ov::device::priorities.name()); + if (it == cfg.end()) + IE_THROW() << "Value for KEY_AUTO_BATCH_DEVICE_CONFIG is not set"; + + auto val = it->second.as(); + auto core = GetCore(); + if (!core) + return nullptr; + auto metaDevice = ParseMetaDevice(val, std::map()); + cfg.erase(it); + return core->CreateContext(metaDevice.deviceName, cfg); +} + +Parameter AutoBatchInferencePlugin::GetConfig(const std::string& name, + const std::map& user_options) const { + if (supported_configKeys.end() != std::find(supported_configKeys.begin(), supported_configKeys.end(), name)) { + auto it = _config.find(name); + if (it == _config.end()) { + IE_THROW() << "Value for " << name << " is not set"; + } else { + return {it->second}; + } + } else { + IE_THROW() << "Unsupported config key: " << name; + } +} + +void AutoBatchInferencePlugin::CheckConfig(const std::map& user_config) { + for (auto&& kvp : user_config) { + const auto name = kvp.first; + const auto val = kvp.second; + if (supported_configKeys.end() == std::find(supported_configKeys.begin(), supported_configKeys.end(), name)) + IE_THROW() << "Unsupported config key: " << name; + if (name == CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) || name == ov::device::priorities.name()) { + ParseBatchDevice(val); + } else if (name == CONFIG_KEY(AUTO_BATCH_TIMEOUT)) { + try { + auto t = std::stoi(val); + if (t < 0) + IE_THROW(ParameterMismatch); + } catch (const std::exception&) { + IE_THROW(ParameterMismatch) + << " Expecting unsigned int value for " << CONFIG_KEY(AUTO_BATCH_TIMEOUT) << " got " << val; + } + } + } +} + +void AutoBatchInferencePlugin::SetConfig(const std::map& user_config) { + CheckConfig(user_config); + for (auto&& kvp : user_config) { + _config[kvp.first] = kvp.second; + } +} + +static const Version version = {{2, 1}, CI_BUILD_NUMBER, "AutoBatchPlugin"}; +IE_DEFINE_PLUGIN_CREATE_FUNCTION(AutoBatchInferencePlugin, version) + +AutoBatchInferencePlugin::AutoBatchInferencePlugin() { + _pluginName = "BATCH"; + _config[CONFIG_KEY(AUTO_BATCH_TIMEOUT)] = "1000"; // default value, in ms +} + +InferenceEngine::Parameter AutoBatchInferencePlugin::GetMetric( + const std::string& name, + const std::map& user_options) const { + if (name == METRIC_KEY(SUPPORTED_METRICS)) { + std::vector metrics; + metrics.push_back(METRIC_KEY(SUPPORTED_METRICS)); + metrics.push_back(METRIC_KEY(FULL_DEVICE_NAME)); + metrics.push_back(METRIC_KEY(SUPPORTED_CONFIG_KEYS)); + IE_SET_METRIC_RETURN(SUPPORTED_METRICS, metrics); + } else if (name == METRIC_KEY(FULL_DEVICE_NAME)) { + IE_SET_METRIC_RETURN(FULL_DEVICE_NAME, _pluginName); + } else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) { + IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, supported_configKeys); + } else { + IE_THROW(NotFound) << "Unsupported metric key " << name; + } +} + +IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadExeNetworkImpl( + const InferenceEngine::CNNNetwork& network, + const std::map& user_config) { + return LoadNetworkImpl(network, nullptr, user_config); +} + +InferenceEngine::IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadNetworkImpl( + const InferenceEngine::CNNNetwork& network, + const std::shared_ptr ctx, + const std::map& user_config) { + auto core = GetCore(); + if (core == nullptr) { + IE_THROW() << "Please, work with Auto-Batching device via InferencEngine::Core object"; + } + auto fullConfig = mergeConfigs(_config, user_config); + auto device_batch = fullConfig.find(CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG)); + if (device_batch == fullConfig.end()) + device_batch = fullConfig.find(ov::device::priorities.name()); + if (device_batch == fullConfig.end()) { + IE_THROW() << "KEY_AUTO_BATCH key is not set for BATCH device"; + } + auto metaDevice = ParseMetaDevice(device_batch->second, user_config); + const auto& deviceName = metaDevice.deviceName; + const auto& deviceConfig = metaDevice.config; + auto deviceConfigNoAutoBatch = deviceConfig; + // avoid recursive auto-batching + deviceConfigNoAutoBatch[CONFIG_KEY(ALLOW_AUTO_BATCHING)] = CONFIG_VALUE(NO); + + std::set batched_inputs; + std::set batched_outputs; + // check that the auto-batching is applicable in general + try { + // if applicable, the Auto-Batching is implicitly enabled via the performance hints + const auto tput = CONFIG_VALUE(THROUGHPUT); + const bool bTputInPlg = core->GetConfig(deviceName, CONFIG_KEY(PERFORMANCE_HINT)).as() == tput; + const auto& mode = deviceConfig.find(CONFIG_KEY(PERFORMANCE_HINT)); + const bool bTputInLoadCfg = (mode != deviceConfig.end() && mode->second == tput); + // if the auto-batching is enabled implicitly, check the dims carefully, to avoid outstanding failures + const bool check_dims = (bTputInPlg || bTputInLoadCfg); + CNNNetwork clonedNetwork(InferenceEngine::details::cloneNetwork(network)); + auto function = clonedNetwork.getFunction(); + // find the batch dim + ov::pass::Manager m; + m.register_pass(); + m.register_pass(false, check_dims); + m.run_passes(function); + // do not reshape/re-batch originally batched networks and when there are no inputs with the N* layouts + // input(s) should have the batch dim as the first dim (current limitation of the auto-batching impl) + const auto& params = function->get_parameters(); + for (size_t input_id = 0; input_id < params.size(); input_id++) { + const auto& input = params[input_id]; + const auto& shape = input->get_partial_shape(); + // currently no plugin support batched execution for dynamic networks + if (shape.is_dynamic()) + IE_THROW(NotImplemented) << "Auto-batching does not support dynamic networks!"; + // check the batch dim: either 0th (and the original batch size of 1) or none + if (shape.size() && ov::DimensionTracker::get_label(shape[0])) { + const auto& static_shape = input->get_shape(); + if (static_shape[0] != 1) + IE_THROW(NotImplemented) << "Auto-batching does not reshape/re-batch originally batched networks!"; + batched_inputs.insert( + ov::op::util::get_ie_output_name(params[input_id]->output(0))); // batched dim for the input + } else { + // if the 0-th dim is not for the batch, then we support only the case when NONE dimension is batch + for (size_t s = 1; s < shape.size(); s++) + if (ov::DimensionTracker::get_label(shape[s])) + IE_THROW(NotImplemented) + << "Auto-batching operates only networks with inputs/outputs batched by 0th dimension"; + } + } + const auto& results = function->get_results(); + for (size_t output_id = 0; output_id < results.size(); output_id++) { + const auto& output = results[output_id]; + const auto& shape = output->get_output_partial_shape(0); + if (shape.is_dynamic()) + IE_THROW(NotImplemented) << "Auto-batching does not support dynamic networks!"; + // check the batch dim: either 0th (and the original batch size of 1) or none + if (shape.size() && ov::DimensionTracker::get_label(shape[0])) { + if (shape[0] != 1) + IE_THROW(NotImplemented) << "Auto-batching does not reshape/re-batch originally batched networks!"; + const auto& node = output->input_value(0); + batched_outputs.insert( + ov::op::util::get_ie_output_name(ov::Output(node.get_node(), node.get_index()))); + } else { + // if the 0-th dim is not for the batch, then we support only the case when NONE dimension is batch + for (size_t s = 1; s < shape.size(); s++) + if (ov::DimensionTracker::get_label(shape[s])) + IE_THROW(NotImplemented) + << "Auto-batching operates only networks with outputs batched by 0th dimension"; + } + } + if (!batched_inputs.size() || !batched_outputs.size()) + IE_THROW(NotImplemented) + << "Auto-batching supports only networks with inputs/outputs featuring batched dim!"; + } catch (const InferenceEngine::Exception&) { + metaDevice.batchForDevice = 1; + } + + if (!metaDevice.batchForDevice) { + unsigned int requests = 0; + // batch size is not set explicitly via device name e.g. BATCH:GPU(4) + // let's query the optimal batch size + std::map options; + options["MODEL_PTR"] = std::const_pointer_cast(network.getFunction()); + auto optBatchSize = core->GetMetric(deviceName, METRIC_KEY(OPTIMAL_BATCH_SIZE), options).as(); + auto res = core->GetConfig(deviceName, CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)).as(); + requests = PerfHintsConfig::CheckPerformanceHintRequestValue(res); + const auto& reqs = user_config.find(CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)); + if (reqs != user_config.end()) + requests = static_cast(PerfHintsConfig::CheckPerformanceHintRequestValue(reqs->second)); + if (requests) + optBatchSize = std::max(1u, std::min(requests, optBatchSize)); + if (optBatchSize > 2) // batching is usually in-efficient for batch<4 (as batch1 kernels are heavily optimized) + metaDevice.batchForDevice = optBatchSize; + else + metaDevice.batchForDevice = 1; + } + + auto report_footprint = [](std::shared_ptr pCore, std::string device) -> size_t { + size_t footprint = 0; + // TODO: use the per-network metric (22.2) rather than plugin-level + auto stats = + pCore->GetMetric(device, ov::intel_gpu::memory_statistics.name()).as>(); + for (const auto& s : stats) + footprint += s.second; + return footprint; + }; + + size_t batch1_footprint = 0; + if (deviceName.find("GPU") != std::string::npos) + batch1_footprint = report_footprint(core, deviceName); + auto executableNetworkWithoutBatch = ctx ? core->LoadNetwork(network, ctx, deviceConfigNoAutoBatch) + : core->LoadNetwork(network, deviceName, deviceConfigNoAutoBatch); + if (deviceName.find("GPU") != std::string::npos) { + batch1_footprint = report_footprint(core, deviceName) - batch1_footprint; + if (batch1_footprint) { + const auto total_mem = + GetCore()->GetMetric(deviceName, GPU_METRIC_KEY(DEVICE_TOTAL_MEM_SIZE)).as(); + const int estimated_batch = static_cast((total_mem - batch1_footprint) / batch1_footprint); + int closest = static_cast(pow(2, floor(log(estimated_batch) / log(2)))); + closest = std::max(1, closest); + metaDevice.batchForDevice = std::min(metaDevice.batchForDevice, closest); + } + } + // auto-batch settings + std::unordered_map networkConfig; + for (const auto& c : fullConfig) { + if (supported_configKeys.end() != std::find(supported_configKeys.begin(), supported_configKeys.end(), c.first)) + networkConfig.insert(c); + } + + InferenceEngine::SoExecutableNetworkInternal executableNetworkWithBatch; + if (metaDevice.batchForDevice > 1 && batched_inputs.size()) { + try { + CNNNetwork reshaped(InferenceEngine::details::cloneNetwork(network)); + ICNNNetwork::InputShapes shapes = reshaped.getInputShapes(); + for (const auto& input : batched_inputs) + shapes[input][0] = metaDevice.batchForDevice; + reshaped.reshape(shapes); + executableNetworkWithBatch = ctx ? core->LoadNetwork(reshaped, ctx, deviceConfigNoAutoBatch) + : core->LoadNetwork(reshaped, deviceName, deviceConfigNoAutoBatch); + } catch (const InferenceEngine::Exception&) { + metaDevice.batchForDevice = 1; + } + } + + return std::make_shared(executableNetworkWithBatch, + executableNetworkWithoutBatch, + metaDevice, + networkConfig, + batched_inputs, + batched_outputs); +} + +InferenceEngine::IExecutableNetworkInternal::Ptr AutoBatchInferencePlugin::LoadExeNetworkImpl( + const InferenceEngine::CNNNetwork& network, + const std::shared_ptr& context, + const std::map& user_config) { + return LoadNetworkImpl(network, context, user_config); +} + +InferenceEngine::QueryNetworkResult AutoBatchInferencePlugin::QueryNetwork( + const InferenceEngine::CNNNetwork& network, + const std::map& user_config) const { + auto core = GetCore(); + if (!core) + return InferenceEngine::QueryNetworkResult(); + auto cfg = user_config; + for (const auto& c : cfg) { + if (c.first == CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) || c.first == ov::device::priorities.name()) { + auto val = c.second; + cfg.erase(c.first); + auto metaDevice = ParseMetaDevice(val, cfg); + return core->QueryNetwork(network, metaDevice.deviceName, cfg); + } + } + IE_THROW() << "Value for KEY_AUTO_BATCH_DEVICE_CONFIG is not set"; +} +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/src/plugin.hpp b/src/plugins/auto_batch/src/plugin.hpp new file mode 100644 index 00000000000..637d5476690 --- /dev/null +++ b/src/plugins/auto_batch/src/plugin.hpp @@ -0,0 +1,68 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include + +#include "cpp_interfaces/impl/ie_executable_network_thread_safe_default.hpp" +#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" + +#ifdef AUTOBATCH_UNITTEST +# define AutoBatchPlugin MockAutoBatchPlugin +#endif + +namespace AutoBatchPlugin { + +using DeviceName = std::string; + +struct DeviceInformation { + DeviceName deviceName; + std::map config; + int batchForDevice; +}; + +class AutoBatchInferencePlugin : public InferenceEngine::IInferencePlugin { +public: + AutoBatchInferencePlugin(); + virtual ~AutoBatchInferencePlugin() = default; + InferenceEngine::IExecutableNetworkInternal::Ptr LoadExeNetworkImpl( + const InferenceEngine::CNNNetwork& network, + const std::map& config) override; + InferenceEngine::IExecutableNetworkInternal::Ptr LoadExeNetworkImpl( + const InferenceEngine::CNNNetwork& network, + const std::shared_ptr& context, + const std::map& config) override; + + void SetConfig(const std::map& config) override; + void CheckConfig(const std::map& config); + + InferenceEngine::Parameter GetConfig( + const std::string& name, + const std::map& options) const override; + InferenceEngine::QueryNetworkResult QueryNetwork(const InferenceEngine::CNNNetwork& network, + const std::map& config) const override; + InferenceEngine::Parameter GetMetric( + const std::string& name, + const std::map& options) const override; + InferenceEngine::RemoteContext::Ptr CreateContext(const InferenceEngine::ParamMap&) override; +#ifdef AUTOBATCH_UNITTEST + +public: +#else + +protected: +#endif + DeviceInformation ParseMetaDevice(const std::string& devicesBatchCfg, + const std::map& config) const; + + static DeviceInformation ParseBatchDevice(const std::string& deviceWithBatch); + + InferenceEngine::IExecutableNetworkInternal::Ptr LoadNetworkImpl( + const InferenceEngine::CNNNetwork& network, + const std::shared_ptr context, + const std::map& config); +}; +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/src/sync_infer_request.cpp b/src/plugins/auto_batch/src/sync_infer_request.cpp new file mode 100644 index 00000000000..6e133228441 --- /dev/null +++ b/src/plugins/auto_batch/src/sync_infer_request.cpp @@ -0,0 +1,349 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#include "sync_infer_request.hpp" + +namespace AutoBatchPlugin { +using namespace InferenceEngine; + +template +Blob::Ptr create_shared_blob_on_top_of_batched_blob(Blob::Ptr batched_blob, + std::string name, + const std::set& batched_names, + size_t batch_id, + size_t batch_num) { + typedef typename PrecisionTrait::value_type TYPE; + typedef typename std::add_pointer::type TYPEPTR; + auto ptr = batched_blob->buffer().as(); + auto sizePerBatch = batched_blob->size() / batch_num; + SizeVector dims = batched_blob->getTensorDesc().getDims(); + // for performance reason (copy avoidance) current impl of the auto-batching supports only batching by 0th dim + if (batched_names.count(name)) { + dims[0] = 1; + return make_shared_blob({precision, dims, batched_blob->getTensorDesc().getLayout()}, + ptr + sizePerBatch * batch_id, + sizePerBatch); + } else { + // same blob for all requests (e.g. constants) + return make_shared_blob({precision, dims, batched_blob->getTensorDesc().getLayout()}, ptr); + } +} + +AutoBatchInferRequest::AutoBatchInferRequest(const std::vector>& inputs, + const std::vector>& outputs, + AutoBatchExecutableNetwork::WorkerInferRequest& workerRequest, + int batch_id, + int num_batch, + const std::set& batchedInputs, + const std::set& batchedOutputs) + : IInferRequestInternal(inputs, outputs), + _myBatchedRequestWrapper(workerRequest), + _batchId(batch_id), + _batchSize(num_batch) { + ShareBlobsWithBatchRequest(batchedInputs, batchedOutputs); +} + +AutoBatchInferRequest::AutoBatchInferRequest(const InputsDataMap& networkInputs, + const OutputsDataMap& networkOutputs, + AutoBatchExecutableNetwork::WorkerInferRequest& workerRequest, + int batch_id, + int num_batch, + const std::set& batchedInputs, + const std::set& batchedOutputs) + : IInferRequestInternal(networkInputs, networkOutputs), + _myBatchedRequestWrapper(workerRequest), + _batchId(batch_id), + _batchSize(num_batch) { + ShareBlobsWithBatchRequest(batchedInputs, batchedOutputs); +} + +void AutoBatchInferRequest::ShareBlobsWithBatchRequest(const std::set& batchedInputs, + const std::set& batchedOutputs) { + // Allocate all input blobs + for (const auto& it : _networkInputs) { + auto blob = _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first); + Blob::Ptr res; + switch (it.second->getTensorDesc().getPrecision()) { + case InferenceEngine::Precision::FP32: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I32: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I8: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U32: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::FP64: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::FP16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::BF16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U64: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I64: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U8: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::BOOL: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedInputs, + _batchId, + _batchSize); + break; + default: + IE_THROW() << "Unsupported input precision " << it.second->getTensorDesc().getPrecision(); + } + _inputs[it.first] = res; + } + // Allocate all output blobs + for (const auto& it : _networkOutputs) { + auto blob = _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first); + Blob::Ptr res; + switch (it.second->getTensorDesc().getPrecision()) { + case InferenceEngine::Precision::FP32: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I32: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I8: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U32: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::FP64: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::FP16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::BF16: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U64: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::I64: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::U8: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + case InferenceEngine::Precision::BOOL: + res = create_shared_blob_on_top_of_batched_blob( + _myBatchedRequestWrapper._inferRequestBatched->GetBlob(it.first), + it.first, + batchedOutputs, + _batchId, + _batchSize); + break; + default: + IE_THROW(NotImplemented) << "Unsupported input precision " << it.second->getTensorDesc().getPrecision(); + } + _outputs[it.first] = res; + } +} +void AutoBatchInferRequest::SetBlobsToAnotherRequest(SoIInferRequestInternal& req) { + for (const auto& it : _networkInputs) { + auto& name = it.first; + // this request is already in BUSY state, so using the internal functions safely + auto blob = GetBlob(name); + if (req->GetBlob(name) != blob) + req->SetBlob(name, blob); + } + for (const auto& it : _networkOutputs) { + auto& name = it.first; + // this request is already in BUSY state, so using the internal functions safely + auto blob = GetBlob(name); + if (req->GetBlob(name) != blob) + req->SetBlob(name, blob); + } +} + +void AutoBatchInferRequest::CopyInputsIfNeeded() { + for (const auto& it : _networkInputs) { + auto& name = it.first; + // this request is already in BUSY state, so using the internal functions safely + CopyBlobIfNeeded(GetBlob(name), _myBatchedRequestWrapper._inferRequestBatched->GetBlob(name), true); + } +} + +void AutoBatchInferRequest::CopyBlobIfNeeded(InferenceEngine::Blob::CPtr src, + InferenceEngine::Blob::Ptr dst, + bool bInput) { + auto bufferDst = dst->buffer(); + auto ptrDst = bufferDst.as(); + auto bufferSrc = src->cbuffer(); + auto ptrSrc = bufferSrc.as(); + ptrdiff_t szDst = dst->byteSize(); + ptrdiff_t szSrc = src->byteSize(); + if (bInput) { + ptrdiff_t offset = szSrc != szDst ? _batchId * szDst / _batchSize : 0; + if ((ptrDst + offset) == ptrSrc) + return; + else + memcpy(ptrDst + offset, ptrSrc, szSrc); + } else { + ptrdiff_t offset = szSrc != szDst ? _batchId * szSrc / _batchSize : 0; + if ((ptrSrc + offset) == ptrDst) + return; + else + memcpy(ptrDst, ptrSrc + offset, szDst); + } +} + +void AutoBatchInferRequest::CopyOutputsIfNeeded() { + for (const auto& it : _networkOutputs) { + auto& name = it.first; + // this request is already in BUSY state, so using the internal functions safely + CopyBlobIfNeeded(_myBatchedRequestWrapper._inferRequestBatched->GetBlob(name), GetBlob(name), false); + } +} +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/src/sync_infer_request.hpp b/src/plugins/auto_batch/src/sync_infer_request.hpp new file mode 100644 index 00000000000..f0b9832e52a --- /dev/null +++ b/src/plugins/auto_batch/src/sync_infer_request.hpp @@ -0,0 +1,49 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "compiled_model.hpp" +#include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp" + +namespace AutoBatchPlugin { +class AutoBatchInferRequest : public InferenceEngine::IInferRequestInternal { +public: + using Ptr = std::shared_ptr; + explicit AutoBatchInferRequest(const InferenceEngine::InputsDataMap& networkInputs, + const InferenceEngine::OutputsDataMap& networkOutputs, + AutoBatchExecutableNetwork::WorkerInferRequest& workerRequestPtr, + int batch_id, + int num_batch, + const std::set& batchedIntputs, + const std::set& batchedOutputs); + explicit AutoBatchInferRequest(const std::vector>& inputs, + const std::vector>& outputs, + AutoBatchExecutableNetwork::WorkerInferRequest& workerRequestPtr, + int batch_id, + int num_batch, + const std::set& batchedIntputs, + const std::set& batchedOutputs); + + // Batch-Device impl specific: sets the data (blobs from the device request to the batched device request) + void SetBlobsToAnotherRequest(InferenceEngine::SoIInferRequestInternal& req); + void CopyInputsIfNeeded(); + void CopyOutputsIfNeeded(); + AutoBatchExecutableNetwork::WorkerInferRequest& _myBatchedRequestWrapper; + std::exception_ptr _exceptionPtr; + enum eExecutionFlavor : uint8_t { + NOT_EXECUTED, + BATCH_EXECUTED, + TIMEOUT_EXECUTED + } _wasBatchedRequestUsed = eExecutionFlavor::NOT_EXECUTED; + +protected: + void CopyBlobIfNeeded(InferenceEngine::Blob::CPtr src, InferenceEngine::Blob::Ptr dst, bool bInput); + void ShareBlobsWithBatchRequest(const std::set& batchedIntputs, + const std::set& batchedOutputs); + size_t _batchId; + size_t _batchSize; +}; +} // namespace AutoBatchPlugin \ No newline at end of file diff --git a/src/plugins/auto_batch/tests/unit/CMakeLists.txt b/src/plugins/auto_batch/tests/unit/CMakeLists.txt index e47efc53d61..2e200a59e6a 100644 --- a/src/plugins/auto_batch/tests/unit/CMakeLists.txt +++ b/src/plugins/auto_batch/tests/unit/CMakeLists.txt @@ -29,6 +29,6 @@ addIeTargetTest( LABELS Auto_Batch ) -ov_add_version_defines(${OpenVINO_SOURCE_DIR}/src/plugins/auto_batch/src/auto_batch.cpp ${TARGET_NAME}) +ov_add_version_defines(${OpenVINO_SOURCE_DIR}/src/plugins/auto_batch/src/plugin.cpp ${TARGET_NAME}) set_ie_threading_interface_for(${TARGET_NAME}) diff --git a/src/plugins/auto_batch/tests/unit/mock_auto_batch_plugin.hpp b/src/plugins/auto_batch/tests/unit/mock_auto_batch_plugin.hpp index 968563ee1f4..a896b465fb9 100644 --- a/src/plugins/auto_batch/tests/unit/mock_auto_batch_plugin.hpp +++ b/src/plugins/auto_batch/tests/unit/mock_auto_batch_plugin.hpp @@ -7,8 +7,11 @@ #include -#include "auto_batch.hpp" +#include "async_infer_request.hpp" +#include "compiled_model.hpp" #include "ie_icore.hpp" +#include "plugin.hpp" +#include "sync_infer_request.hpp" using namespace MockAutoBatchPlugin; namespace MockAutoBatchDevice { From 3c619d83396d6c6bc1cdac7b50dfcce914ae6164 Mon Sep 17 00:00:00 2001 From: Haiqi Pan Date: Mon, 19 Jun 2023 16:58:14 +0800 Subject: [PATCH 10/44] ov_remote_context -> Remote Context (#18132) --- src/bindings/c/include/openvino/c/ov_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/c/include/openvino/c/ov_common.h b/src/bindings/c/include/openvino/c/ov_common.h index b588abc58ed..e37448e6582 100644 --- a/src/bindings/c/include/openvino/c/ov_common.h +++ b/src/bindings/c/include/openvino/c/ov_common.h @@ -122,7 +122,7 @@ * @ingroup ov_c_api * @brief The definitions & operations about tensor * - * @defgroup ov_remote_context_c_api ov_remote_context + * @defgroup ov_remote_context_c_api Remote Context * @ingroup ov_c_api * @brief Set of functions representing of RemoteContext */ From e54bd6ab1b368012e5a815cf23d4929e0d70a030 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 14:46:06 +0400 Subject: [PATCH 11/44] Update numpy requirement in /tests (#18134) Updates the requirements on [numpy](https://github.com/numpy/numpy) to permit the latest version. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v1.16.6...v1.25.0) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/constraints.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/constraints.txt b/tests/constraints.txt index 67c0c97effd..91d49247cce 100644 --- a/tests/constraints.txt +++ b/tests/constraints.txt @@ -1,4 +1,4 @@ -numpy>=1.16.6,<1.25.0 +numpy>=1.16.6,<1.26.0 attrs==23.1.0 distro==1.8.0 h5py>=3.1.0 From 6143a4fa42f3df2ff17847b5d8471c0ec358918d Mon Sep 17 00:00:00 2001 From: Egor Duplenskii Date: Mon, 19 Jun 2023 14:16:02 +0200 Subject: [PATCH 12/44] [CPU] Add early throw for filtering primitive descriptors (#17065) Otherwise the plugin will throw later when trying to init optimal primitive descriptor (when there is actually no descriptors at all) --- src/plugins/intel_cpu/src/node.cpp | 8 +++-- src/plugins/intel_cpu/src/node.h | 2 +- src/plugins/intel_cpu/src/nodes/conv.cpp | 37 ------------------- src/plugins/intel_cpu/src/nodes/conv.h | 1 - src/plugins/intel_cpu/src/nodes/deconv.cpp | 42 ---------------------- src/plugins/intel_cpu/src/nodes/deconv.h | 2 -- 6 files changed, 7 insertions(+), 85 deletions(-) diff --git a/src/plugins/intel_cpu/src/node.cpp b/src/plugins/intel_cpu/src/node.cpp index 7b87f09007b..c0ecdd46b6b 100644 --- a/src/plugins/intel_cpu/src/node.cpp +++ b/src/plugins/intel_cpu/src/node.cpp @@ -335,8 +335,9 @@ void Node::selectPreferPrimitiveDescriptor(const std::vector& pr } } - if (getSupportedPrimitiveDescriptors().empty()) - IE_THROW() << "Supported primitive descriptors list is empty for node: " << getName(); + IE_ASSERT(!getSupportedPrimitiveDescriptors().empty()) << + "Supported primitive descriptors list is empty for node: " << getName() << " type: " << NameFromType(getType()); + // fallback. If there are no primitives from priority list just select a first selectPrimitiveDescriptorByIndex(0); } @@ -711,6 +712,9 @@ void Node::filterSupportedPrimitiveDescriptors() { supportedPrimitiveDescriptors.erase( std::remove_if(supportedPrimitiveDescriptors.begin(), supportedPrimitiveDescriptors.end(), isNotSuitableDesc), supportedPrimitiveDescriptors.end()); + + IE_ASSERT(!supportedPrimitiveDescriptors.empty()) << getName() << " type: " << NameFromType(getType()) << + " No supported primitive descriptors matched the provided input / output memory format filters."; } void Node::initDescriptor(const NodeConfig& config) { diff --git a/src/plugins/intel_cpu/src/node.h b/src/plugins/intel_cpu/src/node.h index 9e94026de8d..bb7eabdd115 100644 --- a/src/plugins/intel_cpu/src/node.h +++ b/src/plugins/intel_cpu/src/node.h @@ -369,7 +369,7 @@ public: * @brief Filters supportedPrimitiveDescriptors according to the input layouts specified in inputMemoryFormatsFilter * and output layouts specified in outputMemoryFormatsFilter */ - virtual void filterSupportedPrimitiveDescriptors(); + void filterSupportedPrimitiveDescriptors(); virtual void createPrimitive(); diff --git a/src/plugins/intel_cpu/src/nodes/conv.cpp b/src/plugins/intel_cpu/src/nodes/conv.cpp index 635b0e6825c..cd1e05670a4 100644 --- a/src/plugins/intel_cpu/src/nodes/conv.cpp +++ b/src/plugins/intel_cpu/src/nodes/conv.cpp @@ -1051,43 +1051,6 @@ void Convolution::initDescriptor(const NodeConfig& config) { selectedPD->setConfig(updatedConfig); } -void Convolution::filterSupportedPrimitiveDescriptors() { - Node::filterSupportedPrimitiveDescriptors(); - // We also need to filter descs in Convolution node - filterSupportedDescriptors(); -} - -void Convolution::filterSupportedDescriptors() { - if (inputMemoryFormatsFilter.empty() && outputMemoryFormatsFilter.empty()) - return; - - if (inputMemoryFormatsFilter.size() > 1 || outputMemoryFormatsFilter.size() > 1) - IE_THROW() << "Incorrect number of input or output memory formats for Convolution node"; - - auto isNotSuitableDesc = [&](const dnnl::primitive_desc& desc) { - if (!inputMemoryFormatsFilter.empty()) { - auto src_tdesc = DnnlExtensionUtils::makeDescriptor(desc.src_desc()); - if (src_tdesc->isSame(inputMemoryFormatsFilter[0])) { - DEBUG_LOG(getName(), " input memory format filter: ", inputMemoryFormatsFilter[0], - " not matched. Erase desc from the list of dnnl primitive descriptors: ", desc); - return true; - } - } - if (!outputMemoryFormatsFilter.empty()) { - auto dst_tdesc = DnnlExtensionUtils::makeDescriptor(desc.dst_desc()); - if (dst_tdesc->isSame(outputMemoryFormatsFilter[0])) { - DEBUG_LOG(getName(), " Output memory format filter: ", outputMemoryFormatsFilter[0], - " not matched. Erase desc from the list of dnnl primitive descriptors: ", desc); - return true; - } - } - - return false; - }; - - descs.erase(std::remove_if(descs.begin(), descs.end(), isNotSuitableDesc), descs.end()); -} - std::shared_ptr Convolution::getSrcMemDesc(const dnnl::primitive_desc &prim_desc, size_t idx) const { if (idx == 1) { // report original plain layout for weight since it needs to be reordered dynamically at runtime diff --git a/src/plugins/intel_cpu/src/nodes/conv.h b/src/plugins/intel_cpu/src/nodes/conv.h index 4b87d13c4e9..70c73f9b61c 100644 --- a/src/plugins/intel_cpu/src/nodes/conv.h +++ b/src/plugins/intel_cpu/src/nodes/conv.h @@ -28,7 +28,6 @@ public: void initDescriptor(const NodeConfig& config) override; void selectOptimalPrimitiveDescriptor() override; void initSupportedPrimitiveDescriptors() override; - void filterSupportedPrimitiveDescriptors() override; bool created() const override; bool canBeInPlace() const override { return false; diff --git a/src/plugins/intel_cpu/src/nodes/deconv.cpp b/src/plugins/intel_cpu/src/nodes/deconv.cpp index 684c01dd0fc..15946ce0398 100644 --- a/src/plugins/intel_cpu/src/nodes/deconv.cpp +++ b/src/plugins/intel_cpu/src/nodes/deconv.cpp @@ -543,48 +543,6 @@ void Deconvolution::setPostOps(dnnl::primitive_attr& attr, const VectorDims& dim attr.set_post_ops(ops); } -void Deconvolution::filterSupportedPrimitiveDescriptors() { - Node::filterSupportedPrimitiveDescriptors(); - filterSupportedDescriptors(); -} - -void Deconvolution::filterSupportedDescriptors() { - if (inputMemoryFormatsFilter.empty() && outputMemoryFormatsFilter.empty()) - return; - - if (inputMemoryFormatsFilter.size() > 1 || outputMemoryFormatsFilter.size() > 1) - IE_THROW() << "Incorrect number of input or output memory formats for Deconvolution node"; - - auto isNotSuitableDesc = [&](const dnnl::primitive_desc& desc) { - if (!inputMemoryFormatsFilter.empty()) { - auto src_tdesc = isInt8 ? DnnlExtensionUtils::makeDescriptor(desc.src_desc()) : - DnnlExtensionUtils::makeDescriptor(desc.diff_src_desc()); - - if (!src_tdesc->isSame(inputMemoryFormatsFilter[0])) { - DEBUG_LOG(getName(), " input memory format filter: ", inputMemoryFormatsFilter[0], - "not matched. Erase desc from the list of dnnl primitive descriptors: ", desc); - return true; - } - } - - if (!outputMemoryFormatsFilter.empty()) { - auto dst_tdesc = isInt8 ? DnnlExtensionUtils::makeDescriptor(desc.dst_desc()) : - DnnlExtensionUtils::makeDescriptor(desc.diff_dst_desc()); - - if (!dst_tdesc->isSame(outputMemoryFormatsFilter[0])) { - DEBUG_LOG(getName(), " Output memory format filter: ", outputMemoryFormatsFilter[0], - " not matched. Erase desc from the list of dnnl primitive descriptors: ", desc); - - return true; - } - } - - return false; - }; - - descs.erase(std::remove_if(descs.begin(), descs.end(), isNotSuitableDesc), descs.end()); -} - bool Deconvolution::created() const { return getType() == Type::Deconvolution; } diff --git a/src/plugins/intel_cpu/src/nodes/deconv.h b/src/plugins/intel_cpu/src/nodes/deconv.h index 0c24c966b49..6e593a1cab2 100644 --- a/src/plugins/intel_cpu/src/nodes/deconv.h +++ b/src/plugins/intel_cpu/src/nodes/deconv.h @@ -23,8 +23,6 @@ public: void createDescriptor(const std::vector& inputDesc, const std::vector& outputDesc) override; void createPrimitive() override; - void filterSupportedPrimitiveDescriptors() override; - void filterSupportedDescriptors(); bool created() const override; bool canBeInPlace() const override { return false; From b9575d9586c307d08de81c238b481f113b7e6b00 Mon Sep 17 00:00:00 2001 From: Patman11 Date: Mon, 19 Jun 2023 09:55:47 -0400 Subject: [PATCH 13/44] [GPU] Disable threaded kernel compilation when running in Windows Store app (#18062) --- .../intel_gpu/src/runtime/kernels_cache.cpp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/plugins/intel_gpu/src/runtime/kernels_cache.cpp b/src/plugins/intel_gpu/src/runtime/kernels_cache.cpp index a6769887163..ef2f46bc31a 100644 --- a/src/plugins/intel_gpu/src/runtime/kernels_cache.cpp +++ b/src/plugins/intel_gpu/src/runtime/kernels_cache.cpp @@ -15,6 +15,13 @@ #include "intel_gpu/runtime/itt.hpp" #include "openvino/util/file_util.hpp" +#ifdef WIN32 +#include +#ifdef NTDDI_WIN10_RS5 +#include +#endif +#endif + #include #include #include @@ -407,7 +414,17 @@ void kernels_cache::build_all() { get_program_source(_kernels_code, &batches); } - if (_task_executor) { + // build_batch crashes randomly when threaded while running from a Microsoft Store app + // it seems to be a bug in Intel's graphics driver, disabling threading is a work around + auto use_threads{true}; +#if defined(WIN32) && defined(NTDDI_WIN10_RS5) + UINT32 length{0}; + auto error_code{GetCurrentPackageFullName(&length, nullptr)}; + // If we get this error, it means we're a regular desktop application, and we can use threads + use_threads = error_code == APPMODEL_ERROR_NO_PACKAGE; +#endif + + if (_task_executor && use_threads) { std::exception_ptr exception; std::vector tasks; for (size_t idx = 0; idx < batches.size(); idx++) { @@ -415,7 +432,7 @@ void kernels_cache::build_all() { tasks.push_back([this, &_build_engine, &batch, &exception] { try { build_batch(_build_engine, batch, _kernels); - } catch(...) { + } catch (...) { exception = std::current_exception(); } }); From b63e8433b05236c8bcc3c11dfce322d72966ef54 Mon Sep 17 00:00:00 2001 From: Przemyslaw Wysocki Date: Mon, 19 Jun 2023 16:21:10 +0200 Subject: [PATCH 14/44] Update labeler and numpy (#18136) --- .github/labeler.yml | 1 + src/bindings/python/constraints.txt | 2 +- tests/constraints.txt | 2 +- tools/mo/requirements_caffe.txt | 2 +- tools/mo/requirements_kaldi.txt | 2 +- tools/mo/requirements_mxnet.txt | 2 +- tools/mo/requirements_onnx.txt | 2 +- tools/mo/requirements_tf.txt | 2 +- tools/mo/requirements_tf2.txt | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index c4512c375e7..a32a730b3c2 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -41,6 +41,7 @@ 'category: dependency_changes': - '**/requirement*.txt' +- '**/constraints*.txt' - 'scripts/**/*' - '.gitmodules' - '**/setup.py' diff --git a/src/bindings/python/constraints.txt b/src/bindings/python/constraints.txt index 43b2770832d..48c94a4cdab 100644 --- a/src/bindings/python/constraints.txt +++ b/src/bindings/python/constraints.txt @@ -1,6 +1,6 @@ # used in multiple components onnx==1.13.1 # Python bindings, ONNX Frontend -numpy>=1.16.6,<1.25 # Python bindings, frontends +numpy>=1.16.6,<1.26 # Python bindings, frontends protobuf>=3.18.1,<4.0.0 # Python bindings, frontends # pytest diff --git a/tests/constraints.txt b/tests/constraints.txt index 91d49247cce..36b75c219b6 100644 --- a/tests/constraints.txt +++ b/tests/constraints.txt @@ -1,4 +1,4 @@ -numpy>=1.16.6,<1.26.0 +numpy>=1.16.6,<1.26 attrs==23.1.0 distro==1.8.0 h5py>=3.1.0 diff --git a/tools/mo/requirements_caffe.txt b/tools/mo/requirements_caffe.txt index 3d8b0480a43..a8932f1873d 100644 --- a/tools/mo/requirements_caffe.txt +++ b/tools/mo/requirements_caffe.txt @@ -1,5 +1,5 @@ -c ../constraints.txt -numpy>=1.16.6,<1.25.0 +numpy>=1.16.6,<1.26 networkx protobuf defusedxml diff --git a/tools/mo/requirements_kaldi.txt b/tools/mo/requirements_kaldi.txt index 6ef5aeaf13f..b31121df7bf 100644 --- a/tools/mo/requirements_kaldi.txt +++ b/tools/mo/requirements_kaldi.txt @@ -1,5 +1,5 @@ -c ../constraints.txt -numpy>=1.16.6,<1.25.0 +numpy>=1.16.6,<1.26 networkx defusedxml requests diff --git a/tools/mo/requirements_mxnet.txt b/tools/mo/requirements_mxnet.txt index 8df37622cc2..339a09689c7 100644 --- a/tools/mo/requirements_mxnet.txt +++ b/tools/mo/requirements_mxnet.txt @@ -1,5 +1,5 @@ -c ../constraints.txt -numpy>=1.16.6,<1.25.0 +numpy>=1.16.6,<1.26 mxnet networkx defusedxml diff --git a/tools/mo/requirements_onnx.txt b/tools/mo/requirements_onnx.txt index 178e18ac85e..f1f52bb03c2 100644 --- a/tools/mo/requirements_onnx.txt +++ b/tools/mo/requirements_onnx.txt @@ -1,5 +1,5 @@ -c ../constraints.txt -numpy>=1.16.6,<1.25.0 +numpy>=1.16.6,<1.26 onnx networkx defusedxml diff --git a/tools/mo/requirements_tf.txt b/tools/mo/requirements_tf.txt index a6ab68f6564..548f3080808 100644 --- a/tools/mo/requirements_tf.txt +++ b/tools/mo/requirements_tf.txt @@ -1,6 +1,6 @@ -c ../constraints.txt tensorflow>=1.15.5,<2.13.0 -numpy>=1.16.6,<1.25.0 +numpy>=1.16.6,<1.26 networkx defusedxml requests diff --git a/tools/mo/requirements_tf2.txt b/tools/mo/requirements_tf2.txt index 562e77e06f2..a96ed84004f 100644 --- a/tools/mo/requirements_tf2.txt +++ b/tools/mo/requirements_tf2.txt @@ -1,6 +1,6 @@ -c ../constraints.txt tensorflow>=2.5,<2.13.0 -numpy>=1.16.6,<1.25.0 +numpy>=1.16.6,<1.26 networkx defusedxml requests From 429af27b8652f3390556cdc872f320645488f6e0 Mon Sep 17 00:00:00 2001 From: Sofya Balandina Date: Mon, 19 Jun 2023 15:40:26 +0100 Subject: [PATCH 15/44] Add full summary for apiConformance (#17818) * Add full summary for apiConformance * Move to summarize.py, split mandatory and opt scope --- .../layer_tests_summary/summarize.py | 104 +++++++++- .../template/filters_api.js | 188 ++++++++++++++++++ .../template/report_api_template.html | 161 +++++++++++++++ .../layer_tests_summary/template/style.css | 109 +++++++++- 4 files changed, 551 insertions(+), 11 deletions(-) create mode 100644 src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/filters_api.js create mode 100644 src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/report_api_template.html diff --git a/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/summarize.py b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/summarize.py index 67bcee34061..3776e27e05e 100644 --- a/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/summarize.py +++ b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/summarize.py @@ -4,6 +4,7 @@ import argparse import os import csv +from pathlib import Path import defusedxml.ElementTree as ET from defusedxml import defuse_stdlib @@ -44,6 +45,7 @@ def parse_arguments(): csv_help = "Allow to serialize report as csv file" expected_devices_help = "List of expected devices" rel_weights_help = "Path to dir/file with rel weights" + report_type_help = "Report type: OP or API" parser.add_argument("--xml", help=xml_help, nargs="*", required=True) parser.add_argument("--out", help=out_help, default="") @@ -54,6 +56,7 @@ def parse_arguments(): parser.add_argument("--csv", help=csv_help, default=False) parser.add_argument("--expected_devices", help=expected_devices_help, nargs="*", required=False) parser.add_argument("--rel_weights", help=rel_weights_help, type=str, required=False) + parser.add_argument("-t", "--report_type", help=report_type_help, default="OP") return parser.parse_args() @@ -330,15 +333,96 @@ def create_summary(summary_root: Element, output_folder: os.path, expected_devic if is_serialize_to_csv: serialize_to_csv(output_filename, output_folder, op_list, device_list, results) +def create_api_summary(xml_paths: list, output_folder: str, expected_devices:list, report_tag: str, report_version: str, + output_filename='report'): + timestamp = None + + api_info = {} + sw_plugins = set() + api_devices = set(expected_devices) if expected_devices else set() + + logger.info("Statistic collecting is started") + for xml_path in xml_paths: + if not Path(xml_path).exists(): + logger.error(f'File is not exists: {xml_path}') + continue + try: + xml_root = ET.parse(xml_path).getroot() + if timestamp is None or timestamp < xml_root.attrib["timestamp"]: + timestamp = xml_root.attrib["timestamp"] + + for device in xml_root.findall("results/*"): + if expected_devices and device.tag not in expected_devices: + continue + + api_devices.add(device.tag) + for test_type in xml_root.findall(f"results/{device.tag}/*"): + api_info.setdefault(test_type.tag, {}) + for sw_plugin in xml_root.findall(f"results/{device.tag}/{test_type.tag}/*"): + sw_plugin_name = 'HW_PLUGIN' if str(sw_plugin.tag).upper() == str(device.tag).upper() else sw_plugin.tag + sw_plugins.add(sw_plugin_name) + api_info[test_type.tag].setdefault(sw_plugin_name, {device.tag: {}}) + api_info[test_type.tag][sw_plugin_name][device.tag] = {'passrate': float(sw_plugin.get('passrate', 0)), + 'relative_passrate': float(sw_plugin.get('relative_passrate', 0)), + 'relative_all': float(sw_plugin.get('relative_all', 0)), + 'relative_passed': float(sw_plugin.get('relative_passed', 0)), + 'passed': int(sw_plugin.get('passed', 0)), + 'failed': int(sw_plugin.get('failed', 0)), + 'crashed': int(sw_plugin.get('crashed', 0)), + 'skipped': int(sw_plugin.get('skipped', 0)), + 'hanged': int(sw_plugin.get('hanged', 0)), + 'test_amout': int(sw_plugin.get('passed', 0)) +\ + int(sw_plugin.get('failed', 0)) +\ + int(sw_plugin.get('passed', 0)) +\ + int(sw_plugin.get('crashed', 0)) +\ + int(sw_plugin.get('hanged', 0))} + + except ET.ParseError: + logger.error(f'Error parsing {xml_path}') + logger.info("Statistic collecting is completed") + + sw_plugins = list(sw_plugins) + sw_plugins.sort() + if 'HW_PLUGIN' in sw_plugins: + sw_plugins.remove('HW_PLUGIN') + sw_plugins.insert(0, 'HW_PLUGIN') + + logger.info("File with report creating is started") + script_dir = Path(__file__).parent.absolute() + file_loader = FileSystemLoader(script_dir.joinpath('template').as_posix()) + env = Environment(loader=file_loader) + template = env.get_template('report_api_template.html') + + res_summary = template.render(devices=api_devices, + api_info=api_info, + sw_plugins=sw_plugins, + timestamp=timestamp, + report_tag=report_tag, + report_version=report_version) + + report_path = Path() + if output_folder and Path(output_folder).is_dir(): + report_path = Path(output_folder) + + report_path = report_path.joinpath(f'{output_filename}.html') + + with open(report_path.as_posix(), "w") as f: + logger.info(f'Final report is saved to {report_path}') + f.write(res_summary) + if __name__ == "__main__": args = parse_arguments() - summary_root = merge_xmls(args.xml) - create_summary(summary_root, args.out, - [] if args.expected_devices is None else args.expected_devices, - args.report_tag, - args.report_version, - args.conformance_mode, - args.csv, - args.rel_weights, - args.output_filename) - + if args.report_type == 'OP': + summary_root = merge_xmls(args.xml) + create_summary(summary_root, args.out, + [] if args.expected_devices is None else args.expected_devices, + args.report_tag, + args.report_version, + args.conformance_mode, + args.csv, + args.rel_weights, + args.output_filename) + else: + create_api_summary(args.xml, args.out, args.expected_devices, + args.report_tag, args.report_version, args.output_filename) + diff --git a/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/filters_api.js b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/filters_api.js new file mode 100644 index 00000000000..07ba6320404 --- /dev/null +++ b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/filters_api.js @@ -0,0 +1,188 @@ +FILTERS = { + TEST_TYPE: "_test_type_", + DEVICE: "_DEVICE_" +} + +DATA_ATTRIBUTES = { + FILTER: "data-filter", + SW_PLUGIN: 'data-sw_plugin', + DEVICE: 'data-device', + PASSED: 'data-passed_tests', + FAILED: 'data-failed', + SKIPPED: 'data-skipped', + CRASHED: 'data-crashed', + HANGED: 'data-hanged', + TESTS_AMOUNT: 'data-all_tests', + PASSRATE: 'data-passrate', + REL_PASSED: 'data-rel_passed_tests', + REL_TESTS_AMOUNT: 'data-rel_all_tests', + REL_PASSRATE: 'data-relative_passrate' +} + +SCOPE_TYPE = { + MANDATORY: 'Mandatory', + OPTIONAL: 'Optional' +} + +allDevices = [] +swPlugins = [] + +$(document).ready(function () { + $("#devices").chosen({max_selected_options: 6}); + Array.from($("#devices")[0].options).map((element) => allDevices.push(element.value)) + + $("#report #statistic td").filter(function () { + sw_plugin = $(this).attr(DATA_ATTRIBUTES.SW_PLUGIN) + if (sw_plugin && !swPlugins.includes(sw_plugin)) { + swPlugins.push(sw_plugin) + } + }); + + update_statistic(); +}); + +function apply_filters_on_report_table() { + $("#report td").filter(function () { + let data_filter = $(this).attr(DATA_ATTRIBUTES.FILTER) + + if (data_filter && data_filter.length > 0) { + $(this).hide(); + } else { + $(this).show() + } + }); + + update_statistic() +} + +function get_background_color(float_passrate) { + background_color = "hsl(" + Math.floor(float_passrate) +", 80%, 60%)" + return background_color +} + +function update_statistic() { + for (device of allDevices) { + for (sw_plugin of swPlugins) { + let passed = 0 + let amount = 0 + let scope = $('#scope_toggle').text() + + $("#report #data td:not(:hidden)").filter(function () { + if ($(this).attr(DATA_ATTRIBUTES.DEVICE) === device && $(this).attr(DATA_ATTRIBUTES.SW_PLUGIN) === sw_plugin) { + if ($(this).attr(DATA_ATTRIBUTES.PASSED) && $(this).attr(DATA_ATTRIBUTES.TESTS_AMOUNT) && + $(this).attr(DATA_ATTRIBUTES.REL_PASSED) && $(this).attr(DATA_ATTRIBUTES.REL_TESTS_AMOUNT)) { + if (scope == SCOPE_TYPE.MANDATORY) { + passed += parseInt($(this).attr(DATA_ATTRIBUTES.PASSED)) + amount += parseInt($(this).attr(DATA_ATTRIBUTES.TESTS_AMOUNT)) + } else { + passed += parseInt($(this).attr(DATA_ATTRIBUTES.REL_PASSED)) + amount += parseInt($(this).attr(DATA_ATTRIBUTES.REL_TESTS_AMOUNT)) + } + } + } + }); + + let passrate = '' + let background_color = "rgba(255, 255, 255, 0.2)" + if (!amount) { + passrate = "---"; + } else { + let float_passrate = passed * 100 / amount + passrate = (float_passrate).toFixed(2) + ' %'; + background_color = get_background_color(float_passrate) + } + let id_general = '#' + device + '_' + sw_plugin + '_statistic' + if ($(id_general).length) { + $(id_general).text(passrate) + $(id_general).css("background-color", background_color) + } + } + } +} + +function update_data() { + if ($('#scope_toggle').text() == SCOPE_TYPE.MANDATORY) { + $('#scope_toggle').text(SCOPE_TYPE.OPTIONAL) + } else { + $('#scope_toggle').text(SCOPE_TYPE.MANDATORY) + } + + let scope_toggle = $('#scope_toggle').text() + + if (scope_toggle == SCOPE_TYPE.OPTIONAL) { + $('#scope_legend').text('Optinal - includes information and passrate about all apiConformance tests.') + } else { + $('#scope_legend').text('Mandatory - includes information about tests from mandatory tests.\ + This tests should be passed to determine the plugin is conformance by API.\ + For mandatory scope only passed and failed statuses are applicable.') + } + + $("#report #data td").filter(function () { + if (scope_toggle == SCOPE_TYPE.OPTIONAL && $(this).attr(DATA_ATTRIBUTES.PASSRATE)) { + $(this).children('span').text($(this).attr(DATA_ATTRIBUTES.PASSRATE) + ' %') + + $($(this).find('.green')[0]).text('P:' + $(this).attr(DATA_ATTRIBUTES.PASSED)) + $($(this).find('.red')[0]).text('F:' + $(this).attr(DATA_ATTRIBUTES.FAILED)) + $($(this).find('.grey')[0]).show() + $($(this).find('.grey')[0]).text('S:' + $(this).attr(DATA_ATTRIBUTES.SKIPPED)) + $($(this).find('.dark')[0]).show() + $($(this).find('.dark')[0]).text('C:' + $(this).attr(DATA_ATTRIBUTES.CRASHED)) + $($(this).find('.grey-red')[0]).show() + $($(this).find('.grey-red')[0]).text('H:' + $(this).attr(DATA_ATTRIBUTES.HANGED)) + } else if (scope_toggle == SCOPE_TYPE.MANDATORY && $(this).attr(DATA_ATTRIBUTES.REL_PASSRATE)) { + if (parseInt($(this).attr(DATA_ATTRIBUTES.REL_TESTS_AMOUNT)) > 0) { + $(this).children('span').text($(this).attr(DATA_ATTRIBUTES.REL_PASSRATE) + ' %') + } else { + $(this).children('span').text('-- %') + } + + $($(this).find('.green')[0]).text('P:' + $(this).attr(DATA_ATTRIBUTES.REL_PASSED)) + $($(this).find('.red')[0]).text('F:' + (parseInt($(this).attr(DATA_ATTRIBUTES.REL_TESTS_AMOUNT)) - parseInt($(this).attr(DATA_ATTRIBUTES.REL_PASSED)))) + $($(this).find('.grey')[0]).hide() + $($(this).find('.dark')[0]).hide() + $($(this).find('.grey-red')[0]).hide() + } + }); + + update_statistic() +} + +function filter_by_test_type() { + testTypeName = $('#testTypeName').val().trim(); + + $("#report #data td").filter(function () { + let test_type = $(this).attr('data-test-type') + let data_filter = $(this).attr(DATA_ATTRIBUTES.FILTER) || ""; + if (!testTypeName || test_type.toLowerCase().indexOf(testTypeName.toLowerCase()) > -1) { + data_filter = data_filter.replace(FILTERS.TEST_TYPE, "") + $(this).attr(DATA_ATTRIBUTES.FILTER, data_filter) + } else { + if (data_filter.indexOf(FILTERS.TEST_TYPE) == -1) { + data_filter += FILTERS.TEST_TYPE + $(this).attr(DATA_ATTRIBUTES.FILTER, data_filter) + } + } + }); + + apply_filters_on_report_table() +} + +function change_device(value) { + let selected_devices = $(value).val() + $("#report td").filter(function () { + let device = $(this).attr(DATA_ATTRIBUTES.DEVICE) + let data_filter = $(this).attr(DATA_ATTRIBUTES.FILTER) || ""; + + if (!selected_devices || selected_devices.length == 0 || !device || selected_devices.includes(device)) { + data_filter = data_filter.replace(FILTERS.DEVICE, "") + $(this).attr(DATA_ATTRIBUTES.FILTER, data_filter) + } else { + if (data_filter.indexOf(FILTERS.DEVICE) == -1) { + data_filter += FILTERS.DEVICE + $(this).attr(DATA_ATTRIBUTES.FILTER, data_filter) + } + } + }); + + apply_filters_on_report_table() +} diff --git a/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/report_api_template.html b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/report_api_template.html new file mode 100644 index 00000000000..8bb2d4c005e --- /dev/null +++ b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/report_api_template.html @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + Report + + + +
+

API coverage summary.

+

+ {% if report_tag != "" %} + Tag: {{report_tag}} + {% endif %} + {% if report_version != "" %} + Version: {{report_version}} + {% endif %} + Time: {{ timestamp }} +

+
+
+ Collected statistic info + 100%General or relative passrate more 95% + 50%General or relative passrate less 80% +
+
+ Scope: + Mandatory - includes information about tests from mandatory scope. For mandatory scope only passed and failed statuses are applicable. +
+
+ Status: + P:85Passed + F:0Failed + S:2Skipped + C:0Crashed + H:0Hanged +
+
+
+ + +
+
+
+ + +
+
+ + +
+
+
Scope
+ +
+
+
+ +
+ + + + + + {% for device in devices %} + + {% endfor %} + + + + + {% for sw_plugin in sw_plugins %} + + + {% for device in devices %} + + {% endfor %} + + {% endfor %} + + + {% for test_type in api_info %} + + {% for sw_plugin in sw_plugins %} + + + {% for device in devices %} + {% if device in api_info[test_type][sw_plugin] %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} + {% endfor %} + +
EntityDevicesPlugins{{ device }}
Passrate
{{sw_plugin}} + ↺ +
{{ test_type }}
{{sw_plugin}} + {{api_info[test_type][sw_plugin][device]['passrate']}} % +
+ P:{{api_info[test_type][sw_plugin][device]['passed']}} + F:{{api_info[test_type][sw_plugin][device]['failed']}} + S:{{api_info[test_type][sw_plugin][device]['skipped']}} + C:{{api_info[test_type][sw_plugin][device]['crashed']}} + H:{{api_info[test_type][sw_plugin][device]['hanged']}} +
+
+ NOT RUN
+
+ + + + \ No newline at end of file diff --git a/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/style.css b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/style.css index 678c76bf401..9485cc15355 100644 --- a/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/style.css +++ b/src/tests/ie_test_utils/functional_test_utils/layer_tests_summary/template/style.css @@ -616,4 +616,111 @@ h2 { .not_run:hover { background: #8b000040; - } \ No newline at end of file + } + + .scope_stable { + display: flex !important; + align-items: center; + width: 270px; + height: 100px; + } + + .switch { + position: relative; + display: inline-block; + width: 200px; + height: 38px; + background-color: #ccc; + border-radius: 20px; + } + + /* hide HTML checkbox */ + .switch input { + opacity: 0; + width: 0; + height: 0; + } + + .slider { + border-radius: 20px; + position: absolute; + height: 30px; + width: 80px; + left: 5px; + bottom: 4px; + background-color: white; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + -webkit-transition: .4s; + transition: .4s; + } + + input:checked + .slider { + -webkit-transform: translateX(110px); + -ms-transform: translateX(110px); + transform: translateX(110px); + } + + .mandatory { + border-radius: 20px; + position: absolute; + height: 30px; + width: 80px; + left: 5px; + bottom: 4px; + background-color: rgb(173, 166, 166); + opacity: 0.5; + display: flex; + align-items: center; + justify-content: center; + } + + .optional { + border-radius: 20px; + position: absolute; + height: 30px; + width: 80px; + left: 115px; + bottom: 4px; + background-color: rgb(173, 166, 166); + opacity: 0.5; + display: flex; + align-items: center; + justify-content: center; + } + + .toggle_arrow { + display: flex; + font-size: 20px; + justify-content: center; + opacity: 0.5; + } + + .diagonal { + position: relative; + background: linear-gradient(to right top, #000000 0%,#000000 46.9%,#ffffff 47%,#ffffff 51%,#000000 51.1%,#000000 100%) !important; + background-color: transparent; + background-color: none !important; + } + + .th-sw-plugin { + color: white; + } + + .th-devices { + color: white; + display: block; + text-align: end; + } + + .device { + vertical-align: middle !important; + font-weight: bold; + } + + .entity { + vertical-align: middle !important; + width: 20%; + } \ No newline at end of file From 3519050ef04857a1ea5e1442758bfad0575a5a91 Mon Sep 17 00:00:00 2001 From: Wilson Seok Date: Tue, 20 Jun 2023 10:52:58 +0900 Subject: [PATCH 16/44] skip all user format check when dynamic shape in get_preferred_format() to avoid endless recursive call (#18096) --- src/plugins/intel_gpu/src/graph/layout_optimizer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp b/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp index 2680623efce..5af1228e012 100644 --- a/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp +++ b/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp @@ -1688,7 +1688,8 @@ format layout_optimizer::get_preferred_format(program_node& node) { } else if (node.is_type()) { // if the resample is in the last part of the network and there are no users using blocked format, // it is better to reorder to bfyx before resample is done. - if (all_users_simple_format_until_output(node, node, 0, 10)) { + // Skip all user format check when node is dynamic. It could cause endless recursive call in get_preferred_foramt() + if (!node.is_dynamic() && all_users_simple_format_until_output(node, node, 0, 10)) { const auto& dim = format::dimension(node.get_output_layout().format); expected = format::get_default_format(dim, false, false); } else { From a9c4e4ab56549b647a035566e0a2cd6791ea7ed0 Mon Sep 17 00:00:00 2001 From: Wanglei Shen Date: Tue, 20 Jun 2023 10:04:42 +0800 Subject: [PATCH 17/44] enable node support (#17943) * enable node support on Linux * fix code style issue * enable node support on Windows * fix merge conflict * update for comments * update for comments * enable numa node id and socket id in proc_type_table and udpate inference unit test * update get_streams_info_table() and smoke test cases in CPU unit test * fix code style issue * update numa node id and socket id in proc_type_table on windows * update for comments * update for comments * update for comments --- .../dev_api/openvino/runtime/system_conf.hpp | 53 +- .../cpu_map_info.hpp} | 38 +- src/inference/src/os/lin/lin_system_conf.cpp | 213 +- src/inference/src/os/mac/mac_system_conf.cpp | 2 +- src/inference/src/os/win/win_system_conf.cpp | 17 +- src/inference/src/system_conf.cpp | 8 +- .../cpu_map_parser/cache_parser_linux.cpp | 1121 ++++++++++ .../unit/cpu_map_parser/freq_parser_linux.cpp | 992 +++++++++ .../parser_windows.cpp} | 1945 +++-------------- .../unit/cpu_map_parser/valid_proc_check.cpp | 492 ++--- src/plugins/intel_cpu/src/config.h | 10 +- .../intel_cpu/src/cpu_streams_calculation.cpp | 48 +- .../intel_cpu/src/cpu_streams_calculation.hpp | 15 +- .../tests/unit/streams_info_table_test.cpp | 1126 ++++++++-- 14 files changed, 3954 insertions(+), 2126 deletions(-) rename src/inference/src/{streams_executor.hpp => os/cpu_map_info.hpp} (75%) create mode 100644 src/inference/tests/unit/cpu_map_parser/cache_parser_linux.cpp create mode 100644 src/inference/tests/unit/cpu_map_parser/freq_parser_linux.cpp rename src/inference/tests/unit/{cpu_map_parser.cpp => cpu_map_parser/parser_windows.cpp} (62%) diff --git a/src/inference/dev_api/openvino/runtime/system_conf.hpp b/src/inference/dev_api/openvino/runtime/system_conf.hpp index ad007a4f6ee..53fdb7a3b78 100644 --- a/src/inference/dev_api/openvino/runtime/system_conf.hpp +++ b/src/inference/dev_api/openvino/runtime/system_conf.hpp @@ -168,24 +168,28 @@ OPENVINO_RUNTIME_API std::vector> get_proc_type_table(); * extend to support other CPU core type like ARM. * * The following are two example of processor type table. - * 1. Processor table of two socket CPUs XEON server + * 1. Processor table of 4 numa nodes and 2 socket server * - * ALL_PROC | MAIN_CORE_PROC | EFFICIENT_CORE_PROC | HYPER_THREADING_PROC - * 96 48 0 48 // Total number of two sockets - * 48 24 0 24 // Number of socket one - * 48 24 0 24 // Number of socket two + * ALL_PROC | MAIN_CORE_PROC | EFFICIENT_CORE_PROC | HYPER_THREADING_PROC | PROC_NUMA_NODE_ID | PROC_SOCKET_ID + * 96 48 0 48 -1 -1 + * 24 12 0 12 0 0 + * 24 12 0 12 1 0 + * 24 12 0 12 2 1 + * 24 12 0 12 3 1 * - * 2. Processor table of one socket CPU desktop + * 2. Processor table of 1 numa node desktop * - * ALL_PROC | MAIN_CORE_PROC | EFFICIENT_CORE_PROC | HYPER_THREADING_PROC - * 32 8 16 8 // Total number of one socket + * ALL_PROC | MAIN_CORE_PROC | EFFICIENT_CORE_PROC | HYPER_THREADING_PROC | PROC_NUMA_NODE_ID | PROC_SOCKET_ID + * 32 8 16 8 -1 -1 */ enum ColumnOfProcessorTypeTable { ALL_PROC = 0, //!< All processors, regardless of backend cpu MAIN_CORE_PROC = 1, //!< Processor based on physical core of Intel Performance-cores EFFICIENT_CORE_PROC = 2, //!< Processor based on Intel Efficient-cores HYPER_THREADING_PROC = 3, //!< Processor based on logical core of Intel Performance-cores - PROC_TYPE_TABLE_SIZE = 4 //!< Size of processor type table + PROC_NUMA_NODE_ID = 4, //!< Numa node id of processors in this row + PROC_SOCKET_ID = 5, //!< Socket id of processors in this row + PROC_TYPE_TABLE_SIZE = 6 //!< Size of processor type table }; /** @@ -229,24 +233,25 @@ OPENVINO_RUNTIME_API void set_cpu_used(const std::vector& cpu_ids, const in * 1. Four processors of two Pcore * 2. Four processors of four Ecores shared L2 cache * - * PROCESSOR_ID | SOCKET_ID | CORE_ID | CORE_TYPE | GROUP_ID | Used - * 0 0 0 3 0 0 - * 1 0 0 1 0 0 - * 2 0 1 3 1 0 - * 3 0 1 1 1 0 - * 4 0 2 2 2 0 - * 5 0 3 2 2 0 - * 6 0 4 2 2 0 - * 7 0 5 2 2 0 + * PROCESSOR_ID | NUMA_NODE_ID | SOCKET_ID | CORE_ID | CORE_TYPE | GROUP_ID | Used + * 0 0 0 0 3 0 0 + * 1 0 0 0 1 0 0 + * 2 0 0 1 3 1 0 + * 3 0 0 1 1 1 0 + * 4 0 0 2 2 2 0 + * 5 0 0 3 2 2 0 + * 6 0 0 4 2 2 0 + * 7 0 0 5 2 2 0 */ enum ColumnOfCPUMappingTable { CPU_MAP_PROCESSOR_ID = 0, //!< column for processor id of the processor - CPU_MAP_SOCKET_ID = 1, //!< column for socket id of the processor - CPU_MAP_CORE_ID = 2, //!< column for hardware core id of the processor - CPU_MAP_CORE_TYPE = 3, //!< column for CPU core type corresponding to the processor - CPU_MAP_GROUP_ID = 4, //!< column for group id to the processor. Processors in one group have dependency. - CPU_MAP_USED_FLAG = 5, //!< column for resource management of the processor - CPU_MAP_TABLE_SIZE = 6 //!< Size of CPU mapping table + CPU_MAP_NUMA_NODE_ID = 1, //!< column for node id of the processor + CPU_MAP_SOCKET_ID = 2, //!< column for socket id of the processor + CPU_MAP_CORE_ID = 3, //!< column for hardware core id of the processor + CPU_MAP_CORE_TYPE = 4, //!< column for CPU core type corresponding to the processor + CPU_MAP_GROUP_ID = 5, //!< column for group id to the processor. Processors in one group have dependency. + CPU_MAP_USED_FLAG = 6, //!< column for resource management of the processor + CPU_MAP_TABLE_SIZE = 7 //!< Size of CPU mapping table }; } // namespace ov diff --git a/src/inference/src/streams_executor.hpp b/src/inference/src/os/cpu_map_info.hpp similarity index 75% rename from src/inference/src/streams_executor.hpp rename to src/inference/src/os/cpu_map_info.hpp index ad9c23813a2..638b77e2904 100644 --- a/src/inference/src/streams_executor.hpp +++ b/src/inference/src/os/cpu_map_info.hpp @@ -3,8 +3,8 @@ // /** - * @brief A header file that provides a set minimal required Streams Executor API. - * @file streams_executor.hpp + * @brief A header file that provides a set of CPU map and parser functions. + * @file cpu_map_info.hpp */ #pragma once @@ -22,6 +22,7 @@ public: ~CPU(){}; int _processors = 0; int _numa_nodes = 0; + int _sockets = 0; int _cores = 0; std::vector> _proc_type_table; std::vector> _cpu_mapping_table; @@ -34,18 +35,37 @@ public: CPU& cpu_info(); #ifdef __linux__ +/** + * @brief Parse nodes information to update _sockets, proc_type_table and cpu_mapping_table on Linux + * @param[in] node_info_table nodes information for this platform. + * @param[in] _numa_nodes total number for nodes in system + * @param[out] _sockets total number for sockets in system + * @param[out] _proc_type_table summary table of number of processors per type + * @param[out] _cpu_mapping_table CPU mapping table for each processor + * @return + */ +void parse_node_info_linux(const std::vector node_info_table, + const int& _numa_nodes, + int& _sockets, + std::vector>& _proc_type_table, + std::vector>& _cpu_mapping_table); + /** * @brief Parse CPU cache infomation on Linux - * @param[in] _system_info_table system information for this platform. + * @param[in] system_info_table cpus information for this platform. + * @param[in] node_info_table nodes information for this platform. * @param[out] _processors total number for processors in system. + * @param[out] _numa_nodes total number for nodes in system * @param[out] _sockets total number for sockets in system * @param[out] _cores total number for physical CPU cores in system * @param[out] _proc_type_table summary table of number of processors per type * @param[out] _cpu_mapping_table CPU mapping table for each processor * @return */ -void parse_cache_info_linux(const std::vector> _system_info_table, +void parse_cache_info_linux(const std::vector> system_info_table, + const std::vector node_info_table, int& _processors, + int& _numa_nodes, int& _sockets, int& _cores, std::vector>& _proc_type_table, @@ -53,16 +73,20 @@ void parse_cache_info_linux(const std::vector> _system_ /** * @brief Parse CPU frequency infomation on Linux - * @param[in] _system_info_table system information for this platform. + * @param[in] system_info_table cpus information for this platform. + * @param[in] node_info_table nodes information for this platform. * @param[out] _processors total number for processors in system. + * @param[out] _numa_nodes total number for nodes in system * @param[out] _sockets total number for sockets in system * @param[out] _cores total number for physical CPU cores in system * @param[out] _proc_type_table summary table of number of processors per type * @param[out] _cpu_mapping_table CPU mapping table for each processor * @return */ -void parse_freq_info_linux(const std::vector> _system_info_table, +void parse_freq_info_linux(const std::vector> system_info_table, + const std::vector node_info_table, int& _processors, + int& _numa_nodes, int& _sockets, int& _cores, std::vector>& _proc_type_table, @@ -106,6 +130,7 @@ void get_cpu_mapping_from_cores(const int _processors, * @param[in] base_ptr buffer object pointer of Windows system infomation * @param[in] len buffer object length of Windows system infomation * @param[out] _processors total number for processors in system. + * @param[out] _numa_nodes total number for nodes in system * @param[out] _sockets total number for sockets in system * @param[out] _cores total number for physical CPU cores in system * @param[out] _proc_type_table summary table of number of processors per type @@ -115,6 +140,7 @@ void get_cpu_mapping_from_cores(const int _processors, void parse_processor_info_win(const char* base_ptr, const unsigned long len, int& _processors, + int& _numa_nodes, int& _sockets, int& _cores, std::vector>& _proc_type_table, diff --git a/src/inference/src/os/lin/lin_system_conf.cpp b/src/inference/src/os/lin/lin_system_conf.cpp index 58dc50da084..d1934867b70 100644 --- a/src/inference/src/os/lin/lin_system_conf.cpp +++ b/src/inference/src/os/lin/lin_system_conf.cpp @@ -15,12 +15,13 @@ #include "ie_common.h" #include "openvino/core/except.hpp" #include "openvino/runtime/system_conf.hpp" -#include "streams_executor.hpp" +#include "os/cpu_map_info.hpp" namespace ov { CPU::CPU() { std::vector> system_info_table; + std::vector node_info_table; _num_threads = parallel_get_max_threads(); auto get_cache_info_linux = [&]() { @@ -99,6 +100,21 @@ CPU::CPU() { return 0; }; + auto get_node_info_linux = [&]() { + int node_index = 0; + + while (1) { + std::ifstream cache_file("/sys/devices/system/node/node" + std::to_string(node_index) + "/cpulist"); + if (!cache_file.is_open()) { + break; + } + std::string cache_info; + std::getline(cache_file, cache_info); + node_info_table.push_back(cache_info); + node_index++; + } + }; + auto check_valid_cpu = [&]() { cpu_set_t mask; CPU_ZERO(&mask); @@ -131,10 +147,14 @@ CPU::CPU() { } }; + get_node_info_linux(); + if (!get_cache_info_linux()) { parse_cache_info_linux(system_info_table, + node_info_table, _processors, _numa_nodes, + _sockets, _cores, _proc_type_table, _cpu_mapping_table); @@ -143,8 +163,10 @@ CPU::CPU() { if ((_proc_type_table.size() == 0) || (_proc_type_table[0][MAIN_CORE_PROC] == 0)) { if (!get_freq_info_linux()) { parse_freq_info_linux(system_info_table, + node_info_table, _processors, _numa_nodes, + _sockets, _cores, _proc_type_table, _cpu_mapping_table); @@ -177,7 +199,10 @@ CPU::CPU() { } } _processors = processors.size(); + _numa_nodes = sockets.size() == 0 ? 1 : sockets.size(); + _sockets = _numa_nodes; + for (auto&& socket : sockets) { _cores += socket.second; } @@ -203,8 +228,77 @@ CPU::CPU() { }; } +void parse_node_info_linux(const std::vector node_info_table, + const int& _numa_nodes, + int& _sockets, + std::vector>& _proc_type_table, + std::vector>& _cpu_mapping_table) { + std::vector> nodes_table; + int node_index = 0; + + for (auto& one_info : node_info_table) { + int core_1 = 0; + int core_2 = 0; + std::string::size_type pos = 0; + std::string::size_type endpos = 0; + std::string sub_str = ""; + + if (((endpos = one_info.find('-', pos)) == std::string::npos) && + ((endpos = one_info.find(',', pos)) != std::string::npos)) { + while (endpos != std::string::npos) { + sub_str = one_info.substr(pos); + core_1 = std::stoi(sub_str); + nodes_table.push_back({core_1, core_1, node_index}); + endpos = one_info.find(',', pos); + pos = endpos + 1; + } + } else { + while (endpos != std::string::npos) { + if ((endpos = one_info.find('-', pos)) != std::string::npos) { + sub_str = one_info.substr(pos, endpos - pos); + core_1 = std::stoi(sub_str); + sub_str = one_info.substr(endpos + 1); + core_2 = std::stoi(sub_str); + nodes_table.push_back({core_1, core_2, node_index}); + pos = one_info.find(',', endpos); + if (pos == std::string::npos) { + break; + } else { + pos = pos + 1; + } + } + } + } + node_index++; + } + + _proc_type_table.assign((node_info_table.size() == 1) ? 1 : node_info_table.size() + 1, + std::vector({0, 0, 0, 0, -1, -1})); + + for (auto& row : nodes_table) { + for (int i = row[0]; i <= row[1]; i++) { + _cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID] = row[2]; + if (_sockets > _numa_nodes) { + _cpu_mapping_table[i][CPU_MAP_SOCKET_ID] = row[2]; + } + _proc_type_table[0][ALL_PROC]++; + _proc_type_table[0][_cpu_mapping_table[i][CPU_MAP_CORE_TYPE]]++; + if (node_info_table.size() != 1) { + _proc_type_table[row[2] + 1][ALL_PROC]++; + _proc_type_table[row[2] + 1][_cpu_mapping_table[i][CPU_MAP_CORE_TYPE]]++; + } + } + node_index = (node_info_table.size() != 1) ? row[2] + 1 : 0; + _proc_type_table[node_index][PROC_NUMA_NODE_ID] = _cpu_mapping_table[row[0]][CPU_MAP_NUMA_NODE_ID]; + _proc_type_table[node_index][PROC_SOCKET_ID] = _cpu_mapping_table[row[0]][CPU_MAP_SOCKET_ID]; + } + _sockets = (_sockets > _numa_nodes) ? _numa_nodes : _sockets; +} + void parse_cache_info_linux(const std::vector> system_info_table, + const std::vector node_info_table, int& _processors, + int& _numa_nodes, int& _sockets, int& _cores, std::vector>& _proc_type_table, @@ -224,7 +318,7 @@ void parse_cache_info_linux(const std::vector> system_i if (((endpos = system_info_table[nproc][0].find(',', pos)) != std::string::npos) || ((endpos = system_info_table[nproc][0].find('-', pos)) != std::string::npos)) { - sub_str = system_info_table[nproc][0].substr(pos, endpos); + sub_str = system_info_table[nproc][0].substr(pos, endpos - pos); core_1 = std::stoi(sub_str); sub_str = system_info_table[nproc][0].substr(endpos + 1); core_2 = std::stoi(sub_str); @@ -246,13 +340,12 @@ void parse_cache_info_linux(const std::vector> system_i _cpu_mapping_table[core_2][CPU_MAP_GROUP_ID] = n_group; _cores++; - n_group++; _proc_type_table[0][ALL_PROC] += 2; _proc_type_table[0][MAIN_CORE_PROC]++; _proc_type_table[0][HYPER_THREADING_PROC]++; } else if ((endpos = system_info_table[nproc][1].find('-', pos)) != std::string::npos) { - sub_str = system_info_table[nproc][1].substr(pos, endpos); + sub_str = system_info_table[nproc][1].substr(pos, endpos - pos); core_1 = std::stoi(sub_str); sub_str = system_info_table[nproc][1].substr(endpos + 1); core_2 = std::stoi(sub_str); @@ -268,8 +361,6 @@ void parse_cache_info_linux(const std::vector> system_i _proc_type_table[0][ALL_PROC]++; _proc_type_table[0][EFFICIENT_CORE_PROC]++; } - - n_group++; } else { core_1 = std::stoi(system_info_table[nproc][0]); @@ -279,16 +370,23 @@ void parse_cache_info_linux(const std::vector> system_i _cpu_mapping_table[core_1][CPU_MAP_GROUP_ID] = n_group; _cores++; - n_group++; _proc_type_table[0][ALL_PROC]++; _proc_type_table[0][MAIN_CORE_PROC]++; } + + n_group++; + _proc_type_table[0][PROC_NUMA_NODE_ID] = (_proc_type_table[0][PROC_NUMA_NODE_ID] == -1) + ? _cpu_mapping_table[core_1][CPU_MAP_NUMA_NODE_ID] + : _proc_type_table[0][PROC_NUMA_NODE_ID]; + _proc_type_table[0][PROC_SOCKET_ID] = (_proc_type_table[0][PROC_SOCKET_ID] == -1) + ? _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID] + : _proc_type_table[0][PROC_SOCKET_ID]; } return; }; - std::vector line_value_0(PROC_TYPE_TABLE_SIZE, 0); + std::vector line_value_0({0, 0, 0, 0, -1, -1}); for (int n = 0; n < _processors; n++) { if (-1 == _cpu_mapping_table[n][CPU_MAP_SOCKET_ID]) { @@ -308,19 +406,21 @@ void parse_cache_info_linux(const std::vector> system_i while (1) { if ((endpos = system_info_table[n][2].find('-', pos)) != std::string::npos) { - sub_str = system_info_table[n][2].substr(pos, endpos); + sub_str = system_info_table[n][2].substr(pos, endpos - pos); core_1 = std::stoi(sub_str); sub_str = system_info_table[n][2].substr(endpos + 1); core_2 = std::stoi(sub_str); for (int m = core_1; m <= core_2; m++) { _cpu_mapping_table[m][CPU_MAP_SOCKET_ID] = _sockets; + _cpu_mapping_table[m][CPU_MAP_NUMA_NODE_ID] = _cpu_mapping_table[m][CPU_MAP_SOCKET_ID]; update_proc_map_info(m); } } else if (pos != std::string::npos) { sub_str = system_info_table[n][2].substr(pos); core_1 = std::stoi(sub_str); _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID] = _sockets; + _cpu_mapping_table[core_1][CPU_MAP_NUMA_NODE_ID] = _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID]; update_proc_map_info(core_1); endpos = pos; } @@ -334,15 +434,22 @@ void parse_cache_info_linux(const std::vector> system_i _sockets++; } } - if (_sockets > 1) { - _proc_type_table.push_back(_proc_type_table[0]); - _proc_type_table[0] = line_value_0; - for (int m = 1; m <= _sockets; m++) { - for (int n = 0; n < PROC_TYPE_TABLE_SIZE; n++) { - _proc_type_table[0][n] += _proc_type_table[m][n]; + if ((node_info_table.size() == 0) || (node_info_table.size() == (unsigned)_sockets)) { + if (_sockets > 1) { + _proc_type_table.push_back(_proc_type_table[0]); + _proc_type_table[0] = line_value_0; + + for (int m = 1; m <= _sockets; m++) { + for (int n = 0; n < PROC_NUMA_NODE_ID; n++) { + _proc_type_table[0][n] += _proc_type_table[m][n]; + } } } + _numa_nodes = _sockets; + } else { + _numa_nodes = node_info_table.size(); + parse_node_info_linux(node_info_table, _numa_nodes, _sockets, _proc_type_table, _cpu_mapping_table); } }; @@ -358,11 +465,10 @@ void get_cpu_mapping_from_cores(const int _processors, const auto socket_offset = big_phys_cores / _numa_nodes; const auto threads_per_core = hyper_thread ? 2 : 1; const auto step = num_small_cores_phys > 0 ? 2 : 1; - std::vector pro_all_table; + std::vector pro_all_table = {0, 0, 0, 0, -1, -1}; _cpu_mapping_table.resize(_processors, std::vector(CPU_MAP_TABLE_SIZE, -1)); - _proc_type_table.assign(_numa_nodes, std::vector(PROC_TYPE_TABLE_SIZE, 0)); - pro_all_table.resize(PROC_TYPE_TABLE_SIZE, 0); + _proc_type_table.assign(_numa_nodes, std::vector({0, 0, 0, 0, -1, -1})); for (int t = 0; t < threads_per_core; t++) { int start = t == 0 ? 0 : (num_small_cores_phys > 0 ? 1 : big_phys_cores); @@ -374,10 +480,17 @@ void get_cpu_mapping_from_cores(const int _processors, _cpu_mapping_table[cur_id][CPU_MAP_CORE_TYPE] = hyper_thread ? (t == 0 ? HYPER_THREADING_PROC : MAIN_CORE_PROC) : MAIN_CORE_PROC; _cpu_mapping_table[cur_id][CPU_MAP_GROUP_ID] = i; + _cpu_mapping_table[cur_id][CPU_MAP_NUMA_NODE_ID] = socket_id; _cpu_mapping_table[cur_id][CPU_MAP_SOCKET_ID] = socket_id; _proc_type_table[socket_id][_cpu_mapping_table[cur_id][CPU_MAP_CORE_TYPE]]++; _proc_type_table[socket_id][ALL_PROC]++; + _proc_type_table[socket_id][PROC_NUMA_NODE_ID] = (_proc_type_table[socket_id][PROC_NUMA_NODE_ID] == -1) + ? socket_id + : _proc_type_table[socket_id][PROC_NUMA_NODE_ID]; + _proc_type_table[socket_id][PROC_SOCKET_ID] = (_proc_type_table[socket_id][PROC_SOCKET_ID] == -1) + ? socket_id + : _proc_type_table[socket_id][PROC_SOCKET_ID]; pro_all_table[_cpu_mapping_table[cur_id][CPU_MAP_CORE_TYPE]]++; pro_all_table[ALL_PROC]++; } @@ -389,6 +502,7 @@ void get_cpu_mapping_from_cores(const int _processors, _cpu_mapping_table[cur_id][CPU_MAP_CORE_ID] = big_phys_cores + j; _cpu_mapping_table[cur_id][CPU_MAP_CORE_TYPE] = EFFICIENT_CORE_PROC; _cpu_mapping_table[cur_id][CPU_MAP_GROUP_ID] = big_phys_cores + j / 4; + _cpu_mapping_table[cur_id][CPU_MAP_NUMA_NODE_ID] = 0; _cpu_mapping_table[cur_id][CPU_MAP_SOCKET_ID] = 0; _proc_type_table[0][_cpu_mapping_table[cur_id][CPU_MAP_CORE_TYPE]]++; @@ -403,7 +517,9 @@ void get_cpu_mapping_from_cores(const int _processors, } void parse_freq_info_linux(const std::vector> system_info_table, + const std::vector node_info_table, int& _processors, + int& _numa_nodes, int& _sockets, int& _cores, std::vector>& _proc_type_table, @@ -413,6 +529,7 @@ void parse_freq_info_linux(const std::vector> system_in bool ht_enabled = false; _processors = system_info_table.size(); + _numa_nodes = 0; _sockets = 0; _cores = 0; _cpu_mapping_table.resize(_processors, std::vector(CPU_MAP_TABLE_SIZE, -1)); @@ -432,19 +549,21 @@ void parse_freq_info_linux(const std::vector> system_in if (((endpos1 = system_info_table[n][0].find(',', pos)) != std::string::npos) || ((endpos2 = system_info_table[n][0].find('-', pos)) != std::string::npos)) { endpos1 = (endpos1 != std::string::npos) ? endpos1 : endpos2; - sub_str = system_info_table[n][0].substr(pos, endpos1); + sub_str = system_info_table[n][0].substr(pos, endpos1 - pos); core_1 = std::stoi(sub_str); sub_str = system_info_table[n][0].substr(endpos1 + 1); core_2 = std::stoi(sub_str); _cpu_mapping_table[core_1][CPU_MAP_PROCESSOR_ID] = core_1; _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID] = std::stoi(system_info_table[core_1][1]); + _cpu_mapping_table[core_1][CPU_MAP_NUMA_NODE_ID] = _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID]; _cpu_mapping_table[core_1][CPU_MAP_CORE_ID] = _cores; _cpu_mapping_table[core_1][CPU_MAP_CORE_TYPE] = HYPER_THREADING_PROC; _cpu_mapping_table[core_1][CPU_MAP_GROUP_ID] = _cores; _cpu_mapping_table[core_2][CPU_MAP_PROCESSOR_ID] = core_2; _cpu_mapping_table[core_2][CPU_MAP_SOCKET_ID] = _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID]; + _cpu_mapping_table[core_2][CPU_MAP_NUMA_NODE_ID] = _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID]; _cpu_mapping_table[core_2][CPU_MAP_CORE_ID] = _cpu_mapping_table[core_1][CPU_MAP_CORE_ID]; _cpu_mapping_table[core_2][CPU_MAP_CORE_TYPE] = MAIN_CORE_PROC; _cpu_mapping_table[core_2][CPU_MAP_GROUP_ID] = _cpu_mapping_table[core_1][CPU_MAP_GROUP_ID]; @@ -452,12 +571,12 @@ void parse_freq_info_linux(const std::vector> system_in ht_enabled = true; int core_freq = std::stoi(system_info_table[core_1][2]); freq_max = std::max(core_freq, freq_max); - } else if (system_info_table[n][0].size() > 0) { core_1 = std::stoi(system_info_table[n][0]); _cpu_mapping_table[core_1][CPU_MAP_PROCESSOR_ID] = core_1; _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID] = std::stoi(system_info_table[core_1][1]); + _cpu_mapping_table[core_1][CPU_MAP_NUMA_NODE_ID] = _cpu_mapping_table[core_1][CPU_MAP_SOCKET_ID]; _cpu_mapping_table[core_1][CPU_MAP_CORE_ID] = _cores; int core_freq = std::stoi(system_info_table[core_1][2]); @@ -476,28 +595,40 @@ void parse_freq_info_linux(const std::vector> system_in } } - if ((_sockets >= 1) && (ecore_enabled)) { - _sockets = 0; - } + _sockets = (_sockets > 0) ? _sockets + 1 : 1; - if (_sockets >= 1) { - _proc_type_table.resize(_sockets + 2, std::vector(PROC_TYPE_TABLE_SIZE, 0)); - for (int n = 0; n < _processors; n++) { - _proc_type_table[0][ALL_PROC]++; - _proc_type_table[_cpu_mapping_table[n][CPU_MAP_SOCKET_ID] + 1][ALL_PROC]++; - - _proc_type_table[0][_cpu_mapping_table[n][CPU_MAP_CORE_TYPE]]++; - _proc_type_table[_cpu_mapping_table[n][CPU_MAP_SOCKET_ID] + 1][_cpu_mapping_table[n][CPU_MAP_CORE_TYPE]]++; + if (node_info_table.size() == 0) { + if ((_sockets > 1) && (ecore_enabled)) { + _sockets = 1; // This is the WA of the developing platform without CPU cache and numa node information. + // Wrong socket information creates each socket ID per CPU core. } - _sockets++; + if (_sockets > 1) { + _proc_type_table.resize(_sockets + 1, std::vector({0, 0, 0, 0, -1, -1})); + for (int n = 0; n < _processors; n++) { + _proc_type_table[0][ALL_PROC]++; + _proc_type_table[_cpu_mapping_table[n][CPU_MAP_SOCKET_ID] + 1][ALL_PROC]++; + + _proc_type_table[0][_cpu_mapping_table[n][CPU_MAP_CORE_TYPE]]++; + _proc_type_table[_cpu_mapping_table[n][CPU_MAP_SOCKET_ID] + 1] + [_cpu_mapping_table[n][CPU_MAP_CORE_TYPE]]++; + } + for (int n = 0; n < _sockets; n++) { + _proc_type_table[n + 1][PROC_NUMA_NODE_ID] = n; + _proc_type_table[n + 1][PROC_SOCKET_ID] = n; + }; + } else { + _proc_type_table.resize(1, std::vector({0, 0, 0, 0, 0, 0})); + for (int n = 0; n < _processors; n++) { + _proc_type_table[0][ALL_PROC]++; + _proc_type_table[0][_cpu_mapping_table[n][CPU_MAP_CORE_TYPE]]++; + _cpu_mapping_table[n][CPU_MAP_NUMA_NODE_ID] = 0; + _cpu_mapping_table[n][CPU_MAP_SOCKET_ID] = 0; + } + } + _numa_nodes = _sockets; } else { - _proc_type_table.resize(1, std::vector(PROC_TYPE_TABLE_SIZE, 0)); - for (int n = 0; n < _processors; n++) { - _proc_type_table[0][ALL_PROC]++; - _proc_type_table[0][_cpu_mapping_table[n][CPU_MAP_CORE_TYPE]]++; - _cpu_mapping_table[n][CPU_MAP_SOCKET_ID] = 0; - } - _sockets = 1; + _numa_nodes = node_info_table.size(); + parse_node_info_linux(node_info_table, _numa_nodes, _sockets, _proc_type_table, _cpu_mapping_table); } }; @@ -507,7 +638,7 @@ void update_valid_processor_linux(const std::vector phy_core_list, std::vector>& _proc_type_table, std::vector>& _cpu_mapping_table) { for (auto& row : _proc_type_table) { - std::fill(row.begin(), row.end(), 0); + std::fill(row.begin(), row.begin() + PROC_NUMA_NODE_ID, 0); } _cores = 0; for (auto& row : _cpu_mapping_table) { @@ -540,7 +671,7 @@ void update_valid_processor_linux(const std::vector phy_core_list, } if ((_proc_type_table.size() > 1) && (_proc_type_table[0][ALL_PROC] == _proc_type_table[1][ALL_PROC])) { - _proc_type_table.pop_back(); + _proc_type_table.erase(_proc_type_table.begin()); } } _sockets = _proc_type_table.size() == 1 ? 1 : _proc_type_table.size() - 1; diff --git a/src/inference/src/os/mac/mac_system_conf.cpp b/src/inference/src/os/mac/mac_system_conf.cpp index 174168fe702..f0fad3434f0 100644 --- a/src/inference/src/os/mac/mac_system_conf.cpp +++ b/src/inference/src/os/mac/mac_system_conf.cpp @@ -8,7 +8,7 @@ #include "dev/threading/parallel_custom_arena.hpp" #include "openvino/runtime/system_conf.hpp" -#include "streams_executor.hpp" +#include "os/cpu_map_info.hpp" namespace ov { diff --git a/src/inference/src/os/win/win_system_conf.cpp b/src/inference/src/os/win/win_system_conf.cpp index fd19b4d16c8..2c7aaec3366 100644 --- a/src/inference/src/os/win/win_system_conf.cpp +++ b/src/inference/src/os/win/win_system_conf.cpp @@ -13,7 +13,7 @@ #include "dev/threading/parallel_custom_arena.hpp" #include "openvino/runtime/system_conf.hpp" -#include "streams_executor.hpp" +#include "os/cpu_map_info.hpp" namespace ov { @@ -34,6 +34,7 @@ CPU::CPU() { len, _processors, _numa_nodes, + _sockets, _cores, _proc_type_table, _cpu_mapping_table); @@ -42,6 +43,7 @@ CPU::CPU() { void parse_processor_info_win(const char* base_ptr, const unsigned long len, int& _processors, + int& _numa_nodes, int& _sockets, int& _cores, std::vector>& _proc_type_table, @@ -49,7 +51,7 @@ void parse_processor_info_win(const char* base_ptr, std::vector list; std::vector proc_info; - std::vector proc_init_line(PROC_TYPE_TABLE_SIZE, 0); + std::vector proc_init_line({0, 0, 0, 0, -1, -1}); std::vector cpu_init_line(CPU_MAP_TABLE_SIZE, -1); char* info_ptr = (char*)base_ptr; @@ -107,6 +109,7 @@ void parse_processor_info_win(const char* base_ptr, if (2 == list_len) { proc_info = cpu_init_line; proc_info[CPU_MAP_PROCESSOR_ID] = list[0] + base_proc; + proc_info[CPU_MAP_NUMA_NODE_ID] = _sockets; proc_info[CPU_MAP_SOCKET_ID] = _sockets; proc_info[CPU_MAP_CORE_ID] = _cores; proc_info[CPU_MAP_CORE_TYPE] = HYPER_THREADING_PROC; @@ -115,6 +118,7 @@ void parse_processor_info_win(const char* base_ptr, proc_info = cpu_init_line; proc_info[CPU_MAP_PROCESSOR_ID] = list[1] + base_proc; + proc_info[CPU_MAP_NUMA_NODE_ID] = _sockets; proc_info[CPU_MAP_SOCKET_ID] = _sockets; proc_info[CPU_MAP_CORE_ID] = _cores; proc_info[CPU_MAP_CORE_TYPE] = MAIN_CORE_PROC; @@ -128,6 +132,7 @@ void parse_processor_info_win(const char* base_ptr, } else { proc_info = cpu_init_line; proc_info[CPU_MAP_PROCESSOR_ID] = list[0] + base_proc; + proc_info[CPU_MAP_NUMA_NODE_ID] = _sockets; proc_info[CPU_MAP_SOCKET_ID] = _sockets; proc_info[CPU_MAP_CORE_ID] = _cores; if ((_processors > group_start) && (_processors <= group_end)) { @@ -185,11 +190,17 @@ void parse_processor_info_win(const char* base_ptr, _proc_type_table[0] = proc_init_line; for (int m = 1; m <= _sockets; m++) { - for (int n = 0; n < PROC_TYPE_TABLE_SIZE; n++) { + for (int n = 0; n <= HYPER_THREADING_PROC; n++) { _proc_type_table[0][n] += _proc_type_table[m][n]; } + _proc_type_table[m][PROC_SOCKET_ID] = m - 1; + _proc_type_table[m][PROC_NUMA_NODE_ID] = m - 1; } + } else { + _proc_type_table[0][PROC_SOCKET_ID] = 0; + _proc_type_table[0][PROC_NUMA_NODE_ID] = 0; } + _numa_nodes = _sockets; } int get_number_of_cpu_cores(bool bigCoresOnly) { diff --git a/src/inference/src/system_conf.cpp b/src/inference/src/system_conf.cpp index d7ecff24e07..d05ab35cf44 100644 --- a/src/inference/src/system_conf.cpp +++ b/src/inference/src/system_conf.cpp @@ -16,7 +16,7 @@ #include "dev/threading/parallel_custom_arena.hpp" #include "ie_common.h" #include "openvino/core/visibility.hpp" -#include "streams_executor.hpp" +#include "os/cpu_map_info.hpp" #include "threading/ie_cpu_streams_info.hpp" #ifdef __APPLE__ @@ -341,11 +341,11 @@ void set_cpu_used(const std::vector& cpu_ids, const int used) { all_table.resize(PROC_TYPE_TABLE_SIZE, 0); for (int i = 0; i < cpu._processors; i++) { if (cpu._cpu_mapping_table[i][CPU_MAP_USED_FLAG] < PLUGIN_USED_START && - cpu._cpu_mapping_table[i][CPU_MAP_SOCKET_ID] >= 0 && + cpu._cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID] >= 0 && cpu._cpu_mapping_table[i][CPU_MAP_CORE_TYPE] >= ALL_PROC) { - cpu._proc_type_table[cpu._cpu_mapping_table[i][CPU_MAP_SOCKET_ID] + start] + cpu._proc_type_table[cpu._cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID] + start] [cpu._cpu_mapping_table[i][CPU_MAP_CORE_TYPE]]++; - cpu._proc_type_table[cpu._cpu_mapping_table[i][CPU_MAP_SOCKET_ID] + start][ALL_PROC]++; + cpu._proc_type_table[cpu._cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID] + start][ALL_PROC]++; all_table[cpu._cpu_mapping_table[i][CPU_MAP_CORE_TYPE]]++; all_table[ALL_PROC]++; } diff --git a/src/inference/tests/unit/cpu_map_parser/cache_parser_linux.cpp b/src/inference/tests/unit/cpu_map_parser/cache_parser_linux.cpp new file mode 100644 index 00000000000..ed9a19a37fc --- /dev/null +++ b/src/inference/tests/unit/cpu_map_parser/cache_parser_linux.cpp @@ -0,0 +1,1121 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include + +#include "ie_system_conf.h" +#include "os/cpu_map_info.hpp" + +using namespace testing; +using namespace ov; + +namespace { + +#ifdef __linux__ + +struct LinuxCpuMapTestCase { + int _processors; + int _numa_nodes; + int _sockets; + int _cores; + std::vector> _proc_type_table; + std::vector> _cpu_mapping_table; + std::vector> system_info_table; + std::vector node_info_table; +}; + +class LinuxCpuMapCacheParserTests : public CommonTestUtils::TestsCommon, + public testing::WithParamInterface> { +public: + void SetUp() override { + const auto& test_data = std::get<0>(GetParam()); + + int test_processors = 0; + int test_numa_nodes = 0; + int test_sockets = 0; + int test_cores = 0; + std::vector> test_proc_type_table; + std::vector> test_cpu_mapping_table; + + ov::parse_cache_info_linux(test_data.system_info_table, + test_data.node_info_table, + test_processors, + test_numa_nodes, + test_sockets, + test_cores, + test_proc_type_table, + test_cpu_mapping_table); + + ASSERT_EQ(test_data._processors, test_processors); + ASSERT_EQ(test_data._numa_nodes, test_numa_nodes); + ASSERT_EQ(test_data._sockets, test_sockets); + ASSERT_EQ(test_data._cores, test_cores); + ASSERT_EQ(test_data._proc_type_table, test_proc_type_table); + ASSERT_EQ(test_data._cpu_mapping_table, test_cpu_mapping_table); + } +}; + +class LinuxGetCpuMapFromCoresTests : public CommonTestUtils::TestsCommon, + public testing::WithParamInterface> { +public: + void SetUp() override { + const auto& test_data = std::get<0>(GetParam()); + + std::vector> test_proc_type_table; + std::vector> test_cpu_mapping_table; + + ov::get_cpu_mapping_from_cores(test_data._processors, + test_data._sockets, + test_data._cores, + test_proc_type_table, + test_cpu_mapping_table); + + ASSERT_EQ(test_data._proc_type_table, test_proc_type_table); + ASSERT_EQ(test_data._cpu_mapping_table, test_cpu_mapping_table); + } +}; + +LinuxCpuMapTestCase cache_2sockets_104cores_hyperthreading = { + 208, // param[expected out]: total 208 logcial processors on this simulated platform + 2, // param[expected out]: total 2 numa nodes on this simulated platform + 2, // param[expected out]: total 2 sockets on this simulated platform + 104, // param[expected out]: total 104 CPU cores on this simulated platform + {{208, 104, 0, 104, -1, -1}, + {104, 52, 0, 52, 0, 0}, + {104, 52, 0, 52, 1, 1}}, // param[expected out]: The proc_type_table of this simulated platform + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 0, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 0, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 0, 0, 24, HYPER_THREADING_PROC, 24, -1}, {25, 0, 0, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 0, 0, 26, HYPER_THREADING_PROC, 26, -1}, {27, 0, 0, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 0, 0, 28, HYPER_THREADING_PROC, 28, -1}, {29, 0, 0, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 0, 0, 30, HYPER_THREADING_PROC, 30, -1}, {31, 0, 0, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 0, 0, 32, HYPER_THREADING_PROC, 32, -1}, {33, 0, 0, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 0, 0, 34, HYPER_THREADING_PROC, 34, -1}, {35, 0, 0, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 0, 0, 36, HYPER_THREADING_PROC, 36, -1}, {37, 0, 0, 37, HYPER_THREADING_PROC, 37, -1}, + {38, 0, 0, 38, HYPER_THREADING_PROC, 38, -1}, {39, 0, 0, 39, HYPER_THREADING_PROC, 39, -1}, + {40, 0, 0, 40, HYPER_THREADING_PROC, 40, -1}, {41, 0, 0, 41, HYPER_THREADING_PROC, 41, -1}, + {42, 0, 0, 42, HYPER_THREADING_PROC, 42, -1}, {43, 0, 0, 43, HYPER_THREADING_PROC, 43, -1}, + {44, 0, 0, 44, HYPER_THREADING_PROC, 44, -1}, {45, 0, 0, 45, HYPER_THREADING_PROC, 45, -1}, + {46, 0, 0, 46, HYPER_THREADING_PROC, 46, -1}, {47, 0, 0, 47, HYPER_THREADING_PROC, 47, -1}, + {48, 0, 0, 48, HYPER_THREADING_PROC, 48, -1}, {49, 0, 0, 49, HYPER_THREADING_PROC, 49, -1}, + {50, 0, 0, 50, HYPER_THREADING_PROC, 50, -1}, {51, 0, 0, 51, HYPER_THREADING_PROC, 51, -1}, + {52, 1, 1, 52, HYPER_THREADING_PROC, 52, -1}, {53, 1, 1, 53, HYPER_THREADING_PROC, 53, -1}, + {54, 1, 1, 54, HYPER_THREADING_PROC, 54, -1}, {55, 1, 1, 55, HYPER_THREADING_PROC, 55, -1}, + {56, 1, 1, 56, HYPER_THREADING_PROC, 56, -1}, {57, 1, 1, 57, HYPER_THREADING_PROC, 57, -1}, + {58, 1, 1, 58, HYPER_THREADING_PROC, 58, -1}, {59, 1, 1, 59, HYPER_THREADING_PROC, 59, -1}, + {60, 1, 1, 60, HYPER_THREADING_PROC, 60, -1}, {61, 1, 1, 61, HYPER_THREADING_PROC, 61, -1}, + {62, 1, 1, 62, HYPER_THREADING_PROC, 62, -1}, {63, 1, 1, 63, HYPER_THREADING_PROC, 63, -1}, + {64, 1, 1, 64, HYPER_THREADING_PROC, 64, -1}, {65, 1, 1, 65, HYPER_THREADING_PROC, 65, -1}, + {66, 1, 1, 66, HYPER_THREADING_PROC, 66, -1}, {67, 1, 1, 67, HYPER_THREADING_PROC, 67, -1}, + {68, 1, 1, 68, HYPER_THREADING_PROC, 68, -1}, {69, 1, 1, 69, HYPER_THREADING_PROC, 69, -1}, + {70, 1, 1, 70, HYPER_THREADING_PROC, 70, -1}, {71, 1, 1, 71, HYPER_THREADING_PROC, 71, -1}, + {72, 1, 1, 72, HYPER_THREADING_PROC, 72, -1}, {73, 1, 1, 73, HYPER_THREADING_PROC, 73, -1}, + {74, 1, 1, 74, HYPER_THREADING_PROC, 74, -1}, {75, 1, 1, 75, HYPER_THREADING_PROC, 75, -1}, + {76, 1, 1, 76, HYPER_THREADING_PROC, 76, -1}, {77, 1, 1, 77, HYPER_THREADING_PROC, 77, -1}, + {78, 1, 1, 78, HYPER_THREADING_PROC, 78, -1}, {79, 1, 1, 79, HYPER_THREADING_PROC, 79, -1}, + {80, 1, 1, 80, HYPER_THREADING_PROC, 80, -1}, {81, 1, 1, 81, HYPER_THREADING_PROC, 81, -1}, + {82, 1, 1, 82, HYPER_THREADING_PROC, 82, -1}, {83, 1, 1, 83, HYPER_THREADING_PROC, 83, -1}, + {84, 1, 1, 84, HYPER_THREADING_PROC, 84, -1}, {85, 1, 1, 85, HYPER_THREADING_PROC, 85, -1}, + {86, 1, 1, 86, HYPER_THREADING_PROC, 86, -1}, {87, 1, 1, 87, HYPER_THREADING_PROC, 87, -1}, + {88, 1, 1, 88, HYPER_THREADING_PROC, 88, -1}, {89, 1, 1, 89, HYPER_THREADING_PROC, 89, -1}, + {90, 1, 1, 90, HYPER_THREADING_PROC, 90, -1}, {91, 1, 1, 91, HYPER_THREADING_PROC, 91, -1}, + {92, 1, 1, 92, HYPER_THREADING_PROC, 92, -1}, {93, 1, 1, 93, HYPER_THREADING_PROC, 93, -1}, + {94, 1, 1, 94, HYPER_THREADING_PROC, 94, -1}, {95, 1, 1, 95, HYPER_THREADING_PROC, 95, -1}, + {96, 1, 1, 96, HYPER_THREADING_PROC, 96, -1}, {97, 1, 1, 97, HYPER_THREADING_PROC, 97, -1}, + {98, 1, 1, 98, HYPER_THREADING_PROC, 98, -1}, {99, 1, 1, 99, HYPER_THREADING_PROC, 99, -1}, + {100, 1, 1, 100, HYPER_THREADING_PROC, 100, -1}, {101, 1, 1, 101, HYPER_THREADING_PROC, 101, -1}, + {102, 1, 1, 102, HYPER_THREADING_PROC, 102, -1}, {103, 1, 1, 103, HYPER_THREADING_PROC, 103, -1}, + {104, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {105, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {106, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {107, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {108, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {109, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {110, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {111, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {112, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {113, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {114, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {115, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {116, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {117, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {118, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {119, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {120, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {121, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {122, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {123, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {124, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {125, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {126, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {127, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {128, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {129, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {130, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {131, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {132, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {133, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {134, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {135, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {136, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {137, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {138, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {139, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {140, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {141, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {142, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {143, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + {144, 0, 0, 40, MAIN_CORE_PROC, 40, -1}, {145, 0, 0, 41, MAIN_CORE_PROC, 41, -1}, + {146, 0, 0, 42, MAIN_CORE_PROC, 42, -1}, {147, 0, 0, 43, MAIN_CORE_PROC, 43, -1}, + {148, 0, 0, 44, MAIN_CORE_PROC, 44, -1}, {149, 0, 0, 45, MAIN_CORE_PROC, 45, -1}, + {150, 0, 0, 46, MAIN_CORE_PROC, 46, -1}, {151, 0, 0, 47, MAIN_CORE_PROC, 47, -1}, + {152, 0, 0, 48, MAIN_CORE_PROC, 48, -1}, {153, 0, 0, 49, MAIN_CORE_PROC, 49, -1}, + {154, 0, 0, 50, MAIN_CORE_PROC, 50, -1}, {155, 0, 0, 51, MAIN_CORE_PROC, 51, -1}, + {156, 1, 1, 52, MAIN_CORE_PROC, 52, -1}, {157, 1, 1, 53, MAIN_CORE_PROC, 53, -1}, + {158, 1, 1, 54, MAIN_CORE_PROC, 54, -1}, {159, 1, 1, 55, MAIN_CORE_PROC, 55, -1}, + {160, 1, 1, 56, MAIN_CORE_PROC, 56, -1}, {161, 1, 1, 57, MAIN_CORE_PROC, 57, -1}, + {162, 1, 1, 58, MAIN_CORE_PROC, 58, -1}, {163, 1, 1, 59, MAIN_CORE_PROC, 59, -1}, + {164, 1, 1, 60, MAIN_CORE_PROC, 60, -1}, {165, 1, 1, 61, MAIN_CORE_PROC, 61, -1}, + {166, 1, 1, 62, MAIN_CORE_PROC, 62, -1}, {167, 1, 1, 63, MAIN_CORE_PROC, 63, -1}, + {168, 1, 1, 64, MAIN_CORE_PROC, 64, -1}, {169, 1, 1, 65, MAIN_CORE_PROC, 65, -1}, + {170, 1, 1, 66, MAIN_CORE_PROC, 66, -1}, {171, 1, 1, 67, MAIN_CORE_PROC, 67, -1}, + {172, 1, 1, 68, MAIN_CORE_PROC, 68, -1}, {173, 1, 1, 69, MAIN_CORE_PROC, 69, -1}, + {174, 1, 1, 70, MAIN_CORE_PROC, 70, -1}, {175, 1, 1, 71, MAIN_CORE_PROC, 71, -1}, + {176, 1, 1, 72, MAIN_CORE_PROC, 72, -1}, {177, 1, 1, 73, MAIN_CORE_PROC, 73, -1}, + {178, 1, 1, 74, MAIN_CORE_PROC, 74, -1}, {179, 1, 1, 75, MAIN_CORE_PROC, 75, -1}, + {180, 1, 1, 76, MAIN_CORE_PROC, 76, -1}, {181, 1, 1, 77, MAIN_CORE_PROC, 77, -1}, + {182, 1, 1, 78, MAIN_CORE_PROC, 78, -1}, {183, 1, 1, 79, MAIN_CORE_PROC, 79, -1}, + {184, 1, 1, 80, MAIN_CORE_PROC, 80, -1}, {185, 1, 1, 81, MAIN_CORE_PROC, 81, -1}, + {186, 1, 1, 82, MAIN_CORE_PROC, 82, -1}, {187, 1, 1, 83, MAIN_CORE_PROC, 83, -1}, + {188, 1, 1, 84, MAIN_CORE_PROC, 84, -1}, {189, 1, 1, 85, MAIN_CORE_PROC, 85, -1}, + {190, 1, 1, 86, MAIN_CORE_PROC, 86, -1}, {191, 1, 1, 87, MAIN_CORE_PROC, 87, -1}, + {192, 1, 1, 88, MAIN_CORE_PROC, 88, -1}, {193, 1, 1, 89, MAIN_CORE_PROC, 89, -1}, + {194, 1, 1, 90, MAIN_CORE_PROC, 90, -1}, {195, 1, 1, 91, MAIN_CORE_PROC, 91, -1}, + {196, 1, 1, 92, MAIN_CORE_PROC, 92, -1}, {197, 1, 1, 93, MAIN_CORE_PROC, 93, -1}, + {198, 1, 1, 94, MAIN_CORE_PROC, 94, -1}, {199, 1, 1, 95, MAIN_CORE_PROC, 95, -1}, + {200, 1, 1, 96, MAIN_CORE_PROC, 96, -1}, {201, 1, 1, 97, MAIN_CORE_PROC, 97, -1}, + {202, 1, 1, 98, MAIN_CORE_PROC, 98, -1}, {203, 1, 1, 99, MAIN_CORE_PROC, 99, -1}, + {204, 1, 1, 100, MAIN_CORE_PROC, 100, -1}, {205, 1, 1, 101, MAIN_CORE_PROC, 101, -1}, + {206, 1, 1, 102, MAIN_CORE_PROC, 102, -1}, {207, 1, 1, 103, MAIN_CORE_PROC, 103, -1}, + }, // param[expected out]: The cpu_mapping_table of this simulated platform + { + {{"0,104"}, {"0,104"}, {"0-51,104-155"}}, {{"1,105"}, {"1,105"}, {"0-51,104-155"}}, + {{"2,106"}, {"2,106"}, {"0-51,104-155"}}, {{"3,107"}, {"3,107"}, {"0-51,104-155"}}, + {{"4,108"}, {"4,108"}, {"0-51,104-155"}}, {{"5,109"}, {"5,109"}, {"0-51,104-155"}}, + {{"6,110"}, {"6,110"}, {"0-51,104-155"}}, {{"7,111"}, {"7,111"}, {"0-51,104-155"}}, + {{"8,112"}, {"8,112"}, {"0-51,104-155"}}, {{"9,113"}, {"9,113"}, {"0-51,104-155"}}, + {{"10,114"}, {"10,114"}, {"0-51,104-155"}}, {{"11,115"}, {"11,115"}, {"0-51,104-155"}}, + {{"12,116"}, {"12,116"}, {"0-51,104-155"}}, {{"13,117"}, {"13,117"}, {"0-51,104-155"}}, + {{"14,118"}, {"14,118"}, {"0-51,104-155"}}, {{"15,119"}, {"15,119"}, {"0-51,104-155"}}, + {{"16,120"}, {"16,120"}, {"0-51,104-155"}}, {{"17,121"}, {"17,121"}, {"0-51,104-155"}}, + {{"18,122"}, {"18,122"}, {"0-51,104-155"}}, {{"19,123"}, {"19,123"}, {"0-51,104-155"}}, + {{"20,124"}, {"20,124"}, {"0-51,104-155"}}, {{"21,125"}, {"21,125"}, {"0-51,104-155"}}, + {{"22,126"}, {"22,126"}, {"0-51,104-155"}}, {{"23,127"}, {"23,127"}, {"0-51,104-155"}}, + {{"24,128"}, {"24,128"}, {"0-51,104-155"}}, {{"25,129"}, {"25,129"}, {"0-51,104-155"}}, + {{"26,130"}, {"26,130"}, {"0-51,104-155"}}, {{"27,131"}, {"27,131"}, {"0-51,104-155"}}, + {{"28,132"}, {"28,132"}, {"0-51,104-155"}}, {{"29,133"}, {"29,133"}, {"0-51,104-155"}}, + {{"30,134"}, {"30,134"}, {"0-51,104-155"}}, {{"31,135"}, {"31,135"}, {"0-51,104-155"}}, + {{"32,136"}, {"32,136"}, {"0-51,104-155"}}, {{"33,137"}, {"33,137"}, {"0-51,104-155"}}, + {{"34,138"}, {"34,138"}, {"0-51,104-155"}}, {{"35,139"}, {"35,139"}, {"0-51,104-155"}}, + {{"36,140"}, {"36,140"}, {"0-51,104-155"}}, {{"37,141"}, {"37,141"}, {"0-51,104-155"}}, + {{"38,142"}, {"38,142"}, {"0-51,104-155"}}, {{"39,143"}, {"39,143"}, {"0-51,104-155"}}, + {{"40,144"}, {"40,144"}, {"0-51,104-155"}}, {{"41,145"}, {"41,145"}, {"0-51,104-155"}}, + {{"42,146"}, {"42,146"}, {"0-51,104-155"}}, {{"43,147"}, {"43,147"}, {"0-51,104-155"}}, + {{"44,148"}, {"44,148"}, {"0-51,104-155"}}, {{"45,149"}, {"45,149"}, {"0-51,104-155"}}, + {{"46,150"}, {"46,150"}, {"0-51,104-155"}}, {{"47,151"}, {"47,151"}, {"0-51,104-155"}}, + {{"48,152"}, {"48,152"}, {"0-51,104-155"}}, {{"49,153"}, {"49,153"}, {"0-51,104-155"}}, + {{"50,154"}, {"50,154"}, {"0-51,104-155"}}, {{"51,155"}, {"51,155"}, {"0-51,104-155"}}, + {{"52,156"}, {"52,156"}, {"52-103,156-207"}}, {{"53,157"}, {"53,157"}, {"52-103,156-207"}}, + {{"54,158"}, {"54,158"}, {"52-103,156-207"}}, {{"55,159"}, {"55,159"}, {"52-103,156-207"}}, + {{"56,160"}, {"56,160"}, {"52-103,156-207"}}, {{"57,161"}, {"57,161"}, {"52-103,156-207"}}, + {{"58,162"}, {"58,162"}, {"52-103,156-207"}}, {{"59,163"}, {"59,163"}, {"52-103,156-207"}}, + {{"60,164"}, {"60,164"}, {"52-103,156-207"}}, {{"61,165"}, {"61,165"}, {"52-103,156-207"}}, + {{"62,166"}, {"62,166"}, {"52-103,156-207"}}, {{"63,167"}, {"63,167"}, {"52-103,156-207"}}, + {{"64,168"}, {"64,168"}, {"52-103,156-207"}}, {{"65,169"}, {"65,169"}, {"52-103,156-207"}}, + {{"66,170"}, {"66,170"}, {"52-103,156-207"}}, {{"67,171"}, {"67,171"}, {"52-103,156-207"}}, + {{"68,172"}, {"68,172"}, {"52-103,156-207"}}, {{"69,173"}, {"69,173"}, {"52-103,156-207"}}, + {{"70,174"}, {"70,174"}, {"52-103,156-207"}}, {{"71,175"}, {"71,175"}, {"52-103,156-207"}}, + {{"72,176"}, {"72,176"}, {"52-103,156-207"}}, {{"73,177"}, {"73,177"}, {"52-103,156-207"}}, + {{"74,178"}, {"74,178"}, {"52-103,156-207"}}, {{"75,179"}, {"75,179"}, {"52-103,156-207"}}, + {{"76,180"}, {"76,180"}, {"52-103,156-207"}}, {{"77,181"}, {"77,181"}, {"52-103,156-207"}}, + {{"78,182"}, {"78,182"}, {"52-103,156-207"}}, {{"79,183"}, {"79,183"}, {"52-103,156-207"}}, + {{"80,184"}, {"80,184"}, {"52-103,156-207"}}, {{"81,185"}, {"81,185"}, {"52-103,156-207"}}, + {{"82,186"}, {"82,186"}, {"52-103,156-207"}}, {{"83,187"}, {"83,187"}, {"52-103,156-207"}}, + {{"84,188"}, {"84,188"}, {"52-103,156-207"}}, {{"85,189"}, {"85,189"}, {"52-103,156-207"}}, + {{"86,190"}, {"86,190"}, {"52-103,156-207"}}, {{"87,191"}, {"87,191"}, {"52-103,156-207"}}, + {{"88,192"}, {"88,192"}, {"52-103,156-207"}}, {{"89,193"}, {"89,193"}, {"52-103,156-207"}}, + {{"90,194"}, {"90,194"}, {"52-103,156-207"}}, {{"91,195"}, {"91,195"}, {"52-103,156-207"}}, + {{"92,196"}, {"92,196"}, {"52-103,156-207"}}, {{"93,197"}, {"93,197"}, {"52-103,156-207"}}, + {{"94,198"}, {"94,198"}, {"52-103,156-207"}}, {{"95,199"}, {"95,199"}, {"52-103,156-207"}}, + {{"96,200"}, {"96,200"}, {"52-103,156-207"}}, {{"97,201"}, {"97,201"}, {"52-103,156-207"}}, + {{"98,202"}, {"98,202"}, {"52-103,156-207"}}, {{"99,203"}, {"99,203"}, {"52-103,156-207"}}, + {{"100,204"}, {"100,204"}, {"52-103,156-207"}}, {{"101,205"}, {"101,205"}, {"52-103,156-207"}}, + {{"102,206"}, {"102,206"}, {"52-103,156-207"}}, {{"103,207"}, {"103,207"}, {"52-103,156-207"}}, + {{"0,104"}, {"0,104"}, {"0-51,104-155"}}, {{"1,105"}, {"1,105"}, {"0-51,104-155"}}, + {{"2,106"}, {"2,106"}, {"0-51,104-155"}}, {{"3,107"}, {"3,107"}, {"0-51,104-155"}}, + {{"4,108"}, {"4,108"}, {"0-51,104-155"}}, {{"5,109"}, {"5,109"}, {"0-51,104-155"}}, + {{"6,110"}, {"6,110"}, {"0-51,104-155"}}, {{"7,111"}, {"7,111"}, {"0-51,104-155"}}, + {{"8,112"}, {"8,112"}, {"0-51,104-155"}}, {{"9,113"}, {"9,113"}, {"0-51,104-155"}}, + {{"10,114"}, {"10,114"}, {"0-51,104-155"}}, {{"11,115"}, {"11,115"}, {"0-51,104-155"}}, + {{"12,116"}, {"12,116"}, {"0-51,104-155"}}, {{"13,117"}, {"13,117"}, {"0-51,104-155"}}, + {{"14,118"}, {"14,118"}, {"0-51,104-155"}}, {{"15,119"}, {"15,119"}, {"0-51,104-155"}}, + {{"16,120"}, {"16,120"}, {"0-51,104-155"}}, {{"17,121"}, {"17,121"}, {"0-51,104-155"}}, + {{"18,122"}, {"18,122"}, {"0-51,104-155"}}, {{"19,123"}, {"19,123"}, {"0-51,104-155"}}, + {{"20,124"}, {"20,124"}, {"0-51,104-155"}}, {{"21,125"}, {"21,125"}, {"0-51,104-155"}}, + {{"22,126"}, {"22,126"}, {"0-51,104-155"}}, {{"23,127"}, {"23,127"}, {"0-51,104-155"}}, + {{"24,128"}, {"24,128"}, {"0-51,104-155"}}, {{"25,129"}, {"25,129"}, {"0-51,104-155"}}, + {{"26,130"}, {"26,130"}, {"0-51,104-155"}}, {{"27,131"}, {"27,131"}, {"0-51,104-155"}}, + {{"28,132"}, {"28,132"}, {"0-51,104-155"}}, {{"29,133"}, {"29,133"}, {"0-51,104-155"}}, + {{"30,134"}, {"30,134"}, {"0-51,104-155"}}, {{"31,135"}, {"31,135"}, {"0-51,104-155"}}, + {{"32,136"}, {"32,136"}, {"0-51,104-155"}}, {{"33,137"}, {"33,137"}, {"0-51,104-155"}}, + {{"34,138"}, {"34,138"}, {"0-51,104-155"}}, {{"35,139"}, {"35,139"}, {"0-51,104-155"}}, + {{"36,140"}, {"36,140"}, {"0-51,104-155"}}, {{"37,141"}, {"37,141"}, {"0-51,104-155"}}, + {{"38,142"}, {"38,142"}, {"0-51,104-155"}}, {{"39,143"}, {"39,143"}, {"0-51,104-155"}}, + {{"40,144"}, {"40,144"}, {"0-51,104-155"}}, {{"41,145"}, {"41,145"}, {"0-51,104-155"}}, + {{"42,146"}, {"42,146"}, {"0-51,104-155"}}, {{"43,147"}, {"43,147"}, {"0-51,104-155"}}, + {{"44,148"}, {"44,148"}, {"0-51,104-155"}}, {{"45,149"}, {"45,149"}, {"0-51,104-155"}}, + {{"46,150"}, {"46,150"}, {"0-51,104-155"}}, {{"47,151"}, {"47,151"}, {"0-51,104-155"}}, + {{"48,152"}, {"48,152"}, {"0-51,104-155"}}, {{"49,153"}, {"49,153"}, {"0-51,104-155"}}, + {{"50,154"}, {"50,154"}, {"0-51,104-155"}}, {{"51,155"}, {"51,155"}, {"0-51,104-155"}}, + {{"52,156"}, {"52,156"}, {"52-103,156-207"}}, {{"53,157"}, {"53,157"}, {"52-103,156-207"}}, + {{"54,158"}, {"54,158"}, {"52-103,156-207"}}, {{"55,159"}, {"55,159"}, {"52-103,156-207"}}, + {{"56,160"}, {"56,160"}, {"52-103,156-207"}}, {{"57,161"}, {"57,161"}, {"52-103,156-207"}}, + {{"58,162"}, {"58,162"}, {"52-103,156-207"}}, {{"59,163"}, {"59,163"}, {"52-103,156-207"}}, + {{"60,164"}, {"60,164"}, {"52-103,156-207"}}, {{"61,165"}, {"61,165"}, {"52-103,156-207"}}, + {{"62,166"}, {"62,166"}, {"52-103,156-207"}}, {{"63,167"}, {"63,167"}, {"52-103,156-207"}}, + {{"64,168"}, {"64,168"}, {"52-103,156-207"}}, {{"65,169"}, {"65,169"}, {"52-103,156-207"}}, + {{"66,170"}, {"66,170"}, {"52-103,156-207"}}, {{"67,171"}, {"67,171"}, {"52-103,156-207"}}, + {{"68,172"}, {"68,172"}, {"52-103,156-207"}}, {{"69,173"}, {"69,173"}, {"52-103,156-207"}}, + {{"70,174"}, {"70,174"}, {"52-103,156-207"}}, {{"71,175"}, {"71,175"}, {"52-103,156-207"}}, + {{"72,176"}, {"72,176"}, {"52-103,156-207"}}, {{"73,177"}, {"73,177"}, {"52-103,156-207"}}, + {{"74,178"}, {"74,178"}, {"52-103,156-207"}}, {{"75,179"}, {"75,179"}, {"52-103,156-207"}}, + {{"76,180"}, {"76,180"}, {"52-103,156-207"}}, {{"77,181"}, {"77,181"}, {"52-103,156-207"}}, + {{"78,182"}, {"78,182"}, {"52-103,156-207"}}, {{"79,183"}, {"79,183"}, {"52-103,156-207"}}, + {{"80,184"}, {"80,184"}, {"52-103,156-207"}}, {{"81,185"}, {"81,185"}, {"52-103,156-207"}}, + {{"82,186"}, {"82,186"}, {"52-103,156-207"}}, {{"83,187"}, {"83,187"}, {"52-103,156-207"}}, + {{"84,188"}, {"84,188"}, {"52-103,156-207"}}, {{"85,189"}, {"85,189"}, {"52-103,156-207"}}, + {{"86,190"}, {"86,190"}, {"52-103,156-207"}}, {{"87,191"}, {"87,191"}, {"52-103,156-207"}}, + {{"88,192"}, {"88,192"}, {"52-103,156-207"}}, {{"89,193"}, {"89,193"}, {"52-103,156-207"}}, + {{"90,194"}, {"90,194"}, {"52-103,156-207"}}, {{"91,195"}, {"91,195"}, {"52-103,156-207"}}, + {{"92,196"}, {"92,196"}, {"52-103,156-207"}}, {{"93,197"}, {"93,197"}, {"52-103,156-207"}}, + {{"94,198"}, {"94,198"}, {"52-103,156-207"}}, {{"95,199"}, {"95,199"}, {"52-103,156-207"}}, + {{"96,200"}, {"96,200"}, {"52-103,156-207"}}, {{"97,201"}, {"97,201"}, {"52-103,156-207"}}, + {{"98,202"}, {"98,202"}, {"52-103,156-207"}}, {{"99,203"}, {"99,203"}, {"52-103,156-207"}}, + {{"100,204"}, {"100,204"}, {"52-103,156-207"}}, {{"101,205"}, {"101,205"}, {"52-103,156-207"}}, + {{"102,206"}, {"102,206"}, {"52-103,156-207"}}, {{"103,207"}, {"103,207"}, {"52-103,156-207"}}, + }, // param[in]: The CPU cache information table of this simulated platform + {{"0-51,104-155"}, {"52-103,156-207"}}, // param[in]: The numa node information table of this simulated platform +}; +LinuxCpuMapTestCase cache_2sockets_48cores_hyperthreading = { + 96, + 2, + 2, + 48, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 0, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 0, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 1, 1, 36, HYPER_THREADING_PROC, 36, -1}, {37, 1, 1, 37, HYPER_THREADING_PROC, 37, -1}, + {38, 1, 1, 38, HYPER_THREADING_PROC, 38, -1}, {39, 1, 1, 39, HYPER_THREADING_PROC, 39, -1}, + {40, 1, 1, 40, HYPER_THREADING_PROC, 40, -1}, {41, 1, 1, 41, HYPER_THREADING_PROC, 41, -1}, + {42, 1, 1, 42, HYPER_THREADING_PROC, 42, -1}, {43, 1, 1, 43, HYPER_THREADING_PROC, 43, -1}, + {44, 1, 1, 44, HYPER_THREADING_PROC, 44, -1}, {45, 1, 1, 45, HYPER_THREADING_PROC, 45, -1}, + {46, 1, 1, 46, HYPER_THREADING_PROC, 46, -1}, {47, 1, 1, 47, HYPER_THREADING_PROC, 47, -1}, + {48, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {49, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {50, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {51, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {52, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {53, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {54, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {55, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {56, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {57, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {58, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {59, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {60, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {61, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {62, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {63, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {64, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {65, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {66, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {67, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {68, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {69, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {70, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {71, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {72, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {73, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {74, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {75, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {76, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {77, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {78, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {79, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {80, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {81, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {82, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {83, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {84, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {85, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {86, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {87, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {88, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {89, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {90, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {91, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {92, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {93, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {94, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {95, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, + { + {"0,48", "0,48", "0-23,48-71"}, {"1,49", "1,49", "0-23,48-71"}, {"2,50", "2,50", "0-23,48-71"}, + {"3,51", "3,51", "0-23,48-71"}, {"4,52", "4,52", "0-23,48-71"}, {"5,53", "5,53", "0-23,48-71"}, + {"6,54", "6,54", "0-23,48-71"}, {"7,55", "7,55", "0-23,48-71"}, {"8,56", "8,56", "0-23,48-71"}, + {"9,57", "9,57", "0-23,48-71"}, {"10,58", "10,58", "0-23,48-71"}, {"11,59", "11,59", "0-23,48-71"}, + {"12,60", "12,60", "0-23,48-71"}, {"13,61", "13,61", "0-23,48-71"}, {"14,62", "14,62", "0-23,48-71"}, + {"15,63", "15,63", "0-23,48-71"}, {"16,64", "16,64", "0-23,48-71"}, {"17,65", "17,65", "0-23,48-71"}, + {"18,66", "18,66", "0-23,48-71"}, {"19,67", "19,67", "0-23,48-71"}, {"20,68", "20,68", "0-23,48-71"}, + {"21,69", "21,69", "0-23,48-71"}, {"22,70", "22,70", "0-23,48-71"}, {"23,71", "23,71", "0-23,48-71"}, + {"24,72", "24,72", "24-47,72-95"}, {"25,73", "25,73", "24-47,72-95"}, {"26,74", "26,74", "24-47,72-95"}, + {"27,75", "27,75", "24-47,72-95"}, {"28,76", "28,76", "24-47,72-95"}, {"29,77", "29,77", "24-47,72-95"}, + {"30,78", "30,78", "24-47,72-95"}, {"31,79", "31,79", "24-47,72-95"}, {"32,80", "32,80", "24-47,72-95"}, + {"33,81", "33,81", "24-47,72-95"}, {"34,82", "34,82", "24-47,72-95"}, {"35,83", "35,83", "24-47,72-95"}, + {"36,84", "36,84", "24-47,72-95"}, {"37,85", "37,85", "24-47,72-95"}, {"38,86", "38,86", "24-47,72-95"}, + {"39,87", "39,87", "24-47,72-95"}, {"40,88", "40,88", "24-47,72-95"}, {"41,89", "41,89", "24-47,72-95"}, + {"42,90", "42,90", "24-47,72-95"}, {"43,91", "43,91", "24-47,72-95"}, {"44,92", "44,92", "24-47,72-95"}, + {"45,93", "45,93", "24-47,72-95"}, {"46,94", "46,94", "24-47,72-95"}, {"47,95", "47,95", "24-47,72-95"}, + {"0,48", "0,48", "0-23,48-71"}, {"1,49", "1,49", "0-23,48-71"}, {"2,50", "2,50", "0-23,48-71"}, + {"3,51", "3,51", "0-23,48-71"}, {"4,52", "4,52", "0-23,48-71"}, {"5,53", "5,53", "0-23,48-71"}, + {"6,54", "6,54", "0-23,48-71"}, {"7,55", "7,55", "0-23,48-71"}, {"8,56", "8,56", "0-23,48-71"}, + {"9,57", "9,57", "0-23,48-71"}, {"10,58", "10,58", "0-23,48-71"}, {"11,59", "11,59", "0-23,48-71"}, + {"12,60", "12,60", "0-23,48-71"}, {"13,61", "13,61", "0-23,48-71"}, {"14,62", "14,62", "0-23,48-71"}, + {"15,63", "15,63", "0-23,48-71"}, {"16,64", "16,64", "0-23,48-71"}, {"17,65", "17,65", "0-23,48-71"}, + {"18,66", "18,66", "0-23,48-71"}, {"19,67", "19,67", "0-23,48-71"}, {"20,68", "20,68", "0-23,48-71"}, + {"21,69", "21,69", "0-23,48-71"}, {"22,70", "22,70", "0-23,48-71"}, {"23,71", "23,71", "0-23,48-71"}, + {"24,72", "24,72", "24-47,72-95"}, {"25,73", "25,73", "24-47,72-95"}, {"26,74", "26,74", "24-47,72-95"}, + {"27,75", "27,75", "24-47,72-95"}, {"28,76", "28,76", "24-47,72-95"}, {"29,77", "29,77", "24-47,72-95"}, + {"30,78", "30,78", "24-47,72-95"}, {"31,79", "31,79", "24-47,72-95"}, {"32,80", "32,80", "24-47,72-95"}, + {"33,81", "33,81", "24-47,72-95"}, {"34,82", "34,82", "24-47,72-95"}, {"35,83", "35,83", "24-47,72-95"}, + {"36,84", "36,84", "24-47,72-95"}, {"37,85", "37,85", "24-47,72-95"}, {"38,86", "38,86", "24-47,72-95"}, + {"39,87", "39,87", "24-47,72-95"}, {"40,88", "40,88", "24-47,72-95"}, {"41,89", "41,89", "24-47,72-95"}, + {"42,90", "42,90", "24-47,72-95"}, {"43,91", "43,91", "24-47,72-95"}, {"44,92", "44,92", "24-47,72-95"}, + {"45,93", "45,93", "24-47,72-95"}, {"46,94", "46,94", "24-47,72-95"}, {"47,95", "47,95", "24-47,72-95"}, + }, + {{"0-23,48-71"}, {"24-47,72-95"}}, +}; +LinuxCpuMapTestCase cache_2sockets_48cores_hyperthreading_1 = { + 96, + 4, + 2, + 48, + {{96, 48, 0, 48, -1, -1}, + {24, 12, 0, 12, 0, 0}, + {24, 12, 0, 12, 1, 0}, + {24, 12, 0, 12, 2, 1}, + {24, 12, 0, 12, 3, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 1, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 1, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 1, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 1, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 1, 0, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 1, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 1, 0, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 2, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 2, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 2, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 2, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 2, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 2, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 2, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 2, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 2, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 2, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 2, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 2, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 3, 1, 36, HYPER_THREADING_PROC, 36, -1}, {37, 3, 1, 37, HYPER_THREADING_PROC, 37, -1}, + {38, 3, 1, 38, HYPER_THREADING_PROC, 38, -1}, {39, 3, 1, 39, HYPER_THREADING_PROC, 39, -1}, + {40, 3, 1, 40, HYPER_THREADING_PROC, 40, -1}, {41, 3, 1, 41, HYPER_THREADING_PROC, 41, -1}, + {42, 3, 1, 42, HYPER_THREADING_PROC, 42, -1}, {43, 3, 1, 43, HYPER_THREADING_PROC, 43, -1}, + {44, 3, 1, 44, HYPER_THREADING_PROC, 44, -1}, {45, 3, 1, 45, HYPER_THREADING_PROC, 45, -1}, + {46, 3, 1, 46, HYPER_THREADING_PROC, 46, -1}, {47, 3, 1, 47, HYPER_THREADING_PROC, 47, -1}, + {48, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {49, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {50, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {51, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {52, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {53, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {54, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {55, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {56, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {57, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {58, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {59, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {60, 1, 0, 12, MAIN_CORE_PROC, 12, -1}, {61, 1, 0, 13, MAIN_CORE_PROC, 13, -1}, + {62, 1, 0, 14, MAIN_CORE_PROC, 14, -1}, {63, 1, 0, 15, MAIN_CORE_PROC, 15, -1}, + {64, 1, 0, 16, MAIN_CORE_PROC, 16, -1}, {65, 1, 0, 17, MAIN_CORE_PROC, 17, -1}, + {66, 1, 0, 18, MAIN_CORE_PROC, 18, -1}, {67, 1, 0, 19, MAIN_CORE_PROC, 19, -1}, + {68, 1, 0, 20, MAIN_CORE_PROC, 20, -1}, {69, 1, 0, 21, MAIN_CORE_PROC, 21, -1}, + {70, 1, 0, 22, MAIN_CORE_PROC, 22, -1}, {71, 1, 0, 23, MAIN_CORE_PROC, 23, -1}, + {72, 2, 1, 24, MAIN_CORE_PROC, 24, -1}, {73, 2, 1, 25, MAIN_CORE_PROC, 25, -1}, + {74, 2, 1, 26, MAIN_CORE_PROC, 26, -1}, {75, 2, 1, 27, MAIN_CORE_PROC, 27, -1}, + {76, 2, 1, 28, MAIN_CORE_PROC, 28, -1}, {77, 2, 1, 29, MAIN_CORE_PROC, 29, -1}, + {78, 2, 1, 30, MAIN_CORE_PROC, 30, -1}, {79, 2, 1, 31, MAIN_CORE_PROC, 31, -1}, + {80, 2, 1, 32, MAIN_CORE_PROC, 32, -1}, {81, 2, 1, 33, MAIN_CORE_PROC, 33, -1}, + {82, 2, 1, 34, MAIN_CORE_PROC, 34, -1}, {83, 2, 1, 35, MAIN_CORE_PROC, 35, -1}, + {84, 3, 1, 36, MAIN_CORE_PROC, 36, -1}, {85, 3, 1, 37, MAIN_CORE_PROC, 37, -1}, + {86, 3, 1, 38, MAIN_CORE_PROC, 38, -1}, {87, 3, 1, 39, MAIN_CORE_PROC, 39, -1}, + {88, 3, 1, 40, MAIN_CORE_PROC, 40, -1}, {89, 3, 1, 41, MAIN_CORE_PROC, 41, -1}, + {90, 3, 1, 42, MAIN_CORE_PROC, 42, -1}, {91, 3, 1, 43, MAIN_CORE_PROC, 43, -1}, + {92, 3, 1, 44, MAIN_CORE_PROC, 44, -1}, {93, 3, 1, 45, MAIN_CORE_PROC, 45, -1}, + {94, 3, 1, 46, MAIN_CORE_PROC, 46, -1}, {95, 3, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, + { + {"0,48", "0,48", "0-23,48-71"}, {"1,49", "1,49", "0-23,48-71"}, {"2,50", "2,50", "0-23,48-71"}, + {"3,51", "3,51", "0-23,48-71"}, {"4,52", "4,52", "0-23,48-71"}, {"5,53", "5,53", "0-23,48-71"}, + {"6,54", "6,54", "0-23,48-71"}, {"7,55", "7,55", "0-23,48-71"}, {"8,56", "8,56", "0-23,48-71"}, + {"9,57", "9,57", "0-23,48-71"}, {"10,58", "10,58", "0-23,48-71"}, {"11,59", "11,59", "0-23,48-71"}, + {"12,60", "12,60", "0-23,48-71"}, {"13,61", "13,61", "0-23,48-71"}, {"14,62", "14,62", "0-23,48-71"}, + {"15,63", "15,63", "0-23,48-71"}, {"16,64", "16,64", "0-23,48-71"}, {"17,65", "17,65", "0-23,48-71"}, + {"18,66", "18,66", "0-23,48-71"}, {"19,67", "19,67", "0-23,48-71"}, {"20,68", "20,68", "0-23,48-71"}, + {"21,69", "21,69", "0-23,48-71"}, {"22,70", "22,70", "0-23,48-71"}, {"23,71", "23,71", "0-23,48-71"}, + {"24,72", "24,72", "24-47,72-95"}, {"25,73", "25,73", "24-47,72-95"}, {"26,74", "26,74", "24-47,72-95"}, + {"27,75", "27,75", "24-47,72-95"}, {"28,76", "28,76", "24-47,72-95"}, {"29,77", "29,77", "24-47,72-95"}, + {"30,78", "30,78", "24-47,72-95"}, {"31,79", "31,79", "24-47,72-95"}, {"32,80", "32,80", "24-47,72-95"}, + {"33,81", "33,81", "24-47,72-95"}, {"34,82", "34,82", "24-47,72-95"}, {"35,83", "35,83", "24-47,72-95"}, + {"36,84", "36,84", "24-47,72-95"}, {"37,85", "37,85", "24-47,72-95"}, {"38,86", "38,86", "24-47,72-95"}, + {"39,87", "39,87", "24-47,72-95"}, {"40,88", "40,88", "24-47,72-95"}, {"41,89", "41,89", "24-47,72-95"}, + {"42,90", "42,90", "24-47,72-95"}, {"43,91", "43,91", "24-47,72-95"}, {"44,92", "44,92", "24-47,72-95"}, + {"45,93", "45,93", "24-47,72-95"}, {"46,94", "46,94", "24-47,72-95"}, {"47,95", "47,95", "24-47,72-95"}, + {"0,48", "0,48", "0-23,48-71"}, {"1,49", "1,49", "0-23,48-71"}, {"2,50", "2,50", "0-23,48-71"}, + {"3,51", "3,51", "0-23,48-71"}, {"4,52", "4,52", "0-23,48-71"}, {"5,53", "5,53", "0-23,48-71"}, + {"6,54", "6,54", "0-23,48-71"}, {"7,55", "7,55", "0-23,48-71"}, {"8,56", "8,56", "0-23,48-71"}, + {"9,57", "9,57", "0-23,48-71"}, {"10,58", "10,58", "0-23,48-71"}, {"11,59", "11,59", "0-23,48-71"}, + {"12,60", "12,60", "0-23,48-71"}, {"13,61", "13,61", "0-23,48-71"}, {"14,62", "14,62", "0-23,48-71"}, + {"15,63", "15,63", "0-23,48-71"}, {"16,64", "16,64", "0-23,48-71"}, {"17,65", "17,65", "0-23,48-71"}, + {"18,66", "18,66", "0-23,48-71"}, {"19,67", "19,67", "0-23,48-71"}, {"20,68", "20,68", "0-23,48-71"}, + {"21,69", "21,69", "0-23,48-71"}, {"22,70", "22,70", "0-23,48-71"}, {"23,71", "23,71", "0-23,48-71"}, + {"24,72", "24,72", "24-47,72-95"}, {"25,73", "25,73", "24-47,72-95"}, {"26,74", "26,74", "24-47,72-95"}, + {"27,75", "27,75", "24-47,72-95"}, {"28,76", "28,76", "24-47,72-95"}, {"29,77", "29,77", "24-47,72-95"}, + {"30,78", "30,78", "24-47,72-95"}, {"31,79", "31,79", "24-47,72-95"}, {"32,80", "32,80", "24-47,72-95"}, + {"33,81", "33,81", "24-47,72-95"}, {"34,82", "34,82", "24-47,72-95"}, {"35,83", "35,83", "24-47,72-95"}, + {"36,84", "36,84", "24-47,72-95"}, {"37,85", "37,85", "24-47,72-95"}, {"38,86", "38,86", "24-47,72-95"}, + {"39,87", "39,87", "24-47,72-95"}, {"40,88", "40,88", "24-47,72-95"}, {"41,89", "41,89", "24-47,72-95"}, + {"42,90", "42,90", "24-47,72-95"}, {"43,91", "43,91", "24-47,72-95"}, {"44,92", "44,92", "24-47,72-95"}, + {"45,93", "45,93", "24-47,72-95"}, {"46,94", "46,94", "24-47,72-95"}, {"47,95", "47,95", "24-47,72-95"}, + }, + {{"0-11,48-59"}, {"12-23,60-71"}, {"24-35,72-83"}, {"36-47,84-95"}}, +}; +LinuxCpuMapTestCase cache_2sockets_24cores_hyperthreading = { + 48, + 2, + 2, + 24, + {{48, 24, 0, 24, -1, -1}, {24, 12, 0, 12, 0, 0}, {24, 12, 0, 12, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 1, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 1, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 1, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {16, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 1, 1, 20, HYPER_THREADING_PROC, 20, -1}, + {18, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 1, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {20, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 1, 1, 22, HYPER_THREADING_PROC, 22, -1}, + {22, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 1, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {25, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, + {26, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, {27, 1, 1, 13, MAIN_CORE_PROC, 13, -1}, + {28, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {29, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, + {30, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, {31, 1, 1, 15, MAIN_CORE_PROC, 15, -1}, + {32, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {33, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, + {34, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, {35, 1, 1, 17, MAIN_CORE_PROC, 17, -1}, + {36, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {37, 1, 1, 18, MAIN_CORE_PROC, 18, -1}, + {38, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, {39, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + {40, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {41, 1, 1, 20, MAIN_CORE_PROC, 20, -1}, + {42, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, {43, 1, 1, 21, MAIN_CORE_PROC, 21, -1}, + {44, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {45, 1, 1, 22, MAIN_CORE_PROC, 22, -1}, + {46, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, {47, 1, 1, 23, MAIN_CORE_PROC, 23, -1}, + }, + { + {"0,24", "0,24", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"1,25", "1,25", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"2,26", "2,26", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"3,27", "3,27", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"4,28", "4,28", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"5,29", "5,29", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"6,30", "6,30", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"7,31", "7,31", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"8,32", "8,32", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"9,33", "9,33", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"10,34", "10,34", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"11,35", "11,35", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"12,36", "12,36", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"13,37", "13,37", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"14,38", "14,38", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"15,39", "15,39", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"16,40", "16,40", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"17,41", "17,41", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"18,42", "18,42", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"19,43", "19,43", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"20,44", "20,44", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"21,45", "21,45", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"22,46", "22,46", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"23,47", "23,47", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"0,24", "0,24", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"1,25", "1,25", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"2,26", "2,26", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"3,27", "3,27", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"4,28", "4,28", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"5,29", "5,29", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"6,30", "6,30", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"7,31", "7,31", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"8,32", "8,32", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"9,33", "9,33", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"10,34", "10,34", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"11,35", "11,35", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"12,36", "12,36", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"13,37", "13,37", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"14,38", "14,38", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"15,39", "15,39", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"16,40", "16,40", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"17,41", "17,41", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"18,42", "18,42", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"19,43", "19,43", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"20,44", "20,44", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"21,45", "21,45", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"22,46", "22,46", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"23,47", "23,47", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + }, + {{"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, +}; +LinuxCpuMapTestCase cache_2sockets_24cores_hyperthreading_1 = { + 48, + 4, + 2, + 24, + {{48, 24, 0, 24, -1, -1}, {12, 6, 0, 6, 0, 0}, {12, 6, 0, 6, 1, 0}, {12, 6, 0, 6, 2, 1}, {12, 6, 0, 6, 3, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 2, 1, 12, HYPER_THREADING_PROC, 12, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 2, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 2, 1, 14, HYPER_THREADING_PROC, 14, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 2, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 2, 1, 16, HYPER_THREADING_PROC, 16, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 2, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {12, 1, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 3, 1, 18, HYPER_THREADING_PROC, 18, -1}, + {14, 1, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 3, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {16, 1, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 3, 1, 20, HYPER_THREADING_PROC, 20, -1}, + {18, 1, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 3, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {20, 1, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 3, 1, 22, HYPER_THREADING_PROC, 22, -1}, + {22, 1, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 3, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {25, 2, 1, 12, MAIN_CORE_PROC, 12, -1}, + {26, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, {27, 2, 1, 13, MAIN_CORE_PROC, 13, -1}, + {28, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {29, 2, 1, 14, MAIN_CORE_PROC, 14, -1}, + {30, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, {31, 2, 1, 15, MAIN_CORE_PROC, 15, -1}, + {32, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {33, 2, 1, 16, MAIN_CORE_PROC, 16, -1}, + {34, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, {35, 2, 1, 17, MAIN_CORE_PROC, 17, -1}, + {36, 1, 0, 6, MAIN_CORE_PROC, 6, -1}, {37, 3, 1, 18, MAIN_CORE_PROC, 18, -1}, + {38, 1, 0, 7, MAIN_CORE_PROC, 7, -1}, {39, 3, 1, 19, MAIN_CORE_PROC, 19, -1}, + {40, 1, 0, 8, MAIN_CORE_PROC, 8, -1}, {41, 3, 1, 20, MAIN_CORE_PROC, 20, -1}, + {42, 1, 0, 9, MAIN_CORE_PROC, 9, -1}, {43, 3, 1, 21, MAIN_CORE_PROC, 21, -1}, + {44, 1, 0, 10, MAIN_CORE_PROC, 10, -1}, {45, 3, 1, 22, MAIN_CORE_PROC, 22, -1}, + {46, 1, 0, 11, MAIN_CORE_PROC, 11, -1}, {47, 3, 1, 23, MAIN_CORE_PROC, 23, -1}, + }, + { + {"0,24", "0,24", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"1,25", "1,25", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"2,26", "2,26", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"3,27", "3,27", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"4,28", "4,28", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"5,29", "5,29", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"6,30", "6,30", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"7,31", "7,31", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"8,32", "8,32", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"9,33", "9,33", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"10,34", "10,34", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"11,35", "11,35", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"12,36", "12,36", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"13,37", "13,37", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"14,38", "14,38", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"15,39", "15,39", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"16,40", "16,40", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"17,41", "17,41", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"18,42", "18,42", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"19,43", "19,43", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"20,44", "20,44", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"21,45", "21,45", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"22,46", "22,46", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"23,47", "23,47", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"0,24", "0,24", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"1,25", "1,25", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"2,26", "2,26", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"3,27", "3,27", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"4,28", "4,28", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"5,29", "5,29", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"6,30", "6,30", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"7,31", "7,31", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"8,32", "8,32", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"9,33", "9,33", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"10,34", "10,34", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"11,35", "11,35", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"12,36", "12,36", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"13,37", "13,37", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"14,38", "14,38", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"15,39", "15,39", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"16,40", "16,40", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"17,41", "17,41", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"18,42", "18,42", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"19,43", "19,43", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"20,44", "20,44", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"21,45", "21,45", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + {"22,46", "22,46", "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"23,47", "23,47", "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + }, + {{"0,2,4,6,8,10,24,26,28,30,32,34"}, + {"12,14,16,18,20,22,36,38,40,42,44,46"}, + {"1,3,5,7,9,11,25,27,29,31,33,35"}, + {"13,15,17,19,21,23,37,39,41,43,45,47"}}, +}; +LinuxCpuMapTestCase cache_2sockets_48cores = { + 48, + 2, + 2, + 48, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, + { + {{"0"}, {"0"}, {"0-23"}}, {{"1"}, {"1"}, {"0-23"}}, {{"2"}, {"2"}, {"0-23"}}, + {{"3"}, {"3"}, {"0-23"}}, {{"4"}, {"4"}, {"0-23"}}, {{"5"}, {"5"}, {"0-23"}}, + {{"6"}, {"6"}, {"0-23"}}, {{"7"}, {"7"}, {"0-23"}}, {{"8"}, {"8"}, {"0-23"}}, + {{"9"}, {"9"}, {"0-23"}}, {{"10"}, {"10"}, {"0-23"}}, {{"11"}, {"11"}, {"0-23"}}, + {{"12"}, {"12"}, {"0-23"}}, {{"13"}, {"13"}, {"0-23"}}, {{"14"}, {"14"}, {"0-23"}}, + {{"15"}, {"15"}, {"0-23"}}, {{"16"}, {"16"}, {"0-23"}}, {{"17"}, {"17"}, {"0-23"}}, + {{"18"}, {"18"}, {"0-23"}}, {{"19"}, {"19"}, {"0-23"}}, {{"20"}, {"20"}, {"0-23"}}, + {{"21"}, {"21"}, {"0-23"}}, {{"22"}, {"22"}, {"0-23"}}, {{"23"}, {"23"}, {"0-23"}}, + {{"24"}, {"24"}, {"24-47"}}, {{"25"}, {"25"}, {"24-47"}}, {{"26"}, {"26"}, {"24-47"}}, + {{"27"}, {"27"}, {"24-47"}}, {{"28"}, {"28"}, {"24-47"}}, {{"29"}, {"29"}, {"24-47"}}, + {{"30"}, {"30"}, {"24-47"}}, {{"31"}, {"31"}, {"24-47"}}, {{"32"}, {"32"}, {"24-47"}}, + {{"33"}, {"33"}, {"24-47"}}, {{"34"}, {"34"}, {"24-47"}}, {{"35"}, {"35"}, {"24-47"}}, + {{"36"}, {"36"}, {"24-47"}}, {{"37"}, {"37"}, {"24-47"}}, {{"38"}, {"38"}, {"24-47"}}, + {{"39"}, {"39"}, {"24-47"}}, {{"40"}, {"40"}, {"24-47"}}, {{"41"}, {"41"}, {"24-47"}}, + {{"42"}, {"42"}, {"24-47"}}, {{"43"}, {"43"}, {"24-47"}}, {{"44"}, {"44"}, {"24-47"}}, + {{"45"}, {"45"}, {"24-47"}}, {{"46"}, {"46"}, {"24-47"}}, {{"47"}, {"47"}, {"24-47"}}, + }, + {{"0-23"}, {"24-47"}}, +}; +LinuxCpuMapTestCase cache_2sockets_48cores_1 = { + 48, + 2, + 2, + 48, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, + { + {{"0"}, {"0"}, {"0-23"}}, {{"1"}, {"1"}, {"0-23"}}, {{"2"}, {"2"}, {"0-23"}}, + {{"3"}, {"3"}, {"0-23"}}, {{"4"}, {"4"}, {"0-23"}}, {{"5"}, {"5"}, {"0-23"}}, + {{"6"}, {"6"}, {"0-23"}}, {{"7"}, {"7"}, {"0-23"}}, {{"8"}, {"8"}, {"0-23"}}, + {{"9"}, {"9"}, {"0-23"}}, {{"10"}, {"10"}, {"0-23"}}, {{"11"}, {"11"}, {"0-23"}}, + {{"12"}, {"12"}, {"0-23"}}, {{"13"}, {"13"}, {"0-23"}}, {{"14"}, {"14"}, {"0-23"}}, + {{"15"}, {"15"}, {"0-23"}}, {{"16"}, {"16"}, {"0-23"}}, {{"17"}, {"17"}, {"0-23"}}, + {{"18"}, {"18"}, {"0-23"}}, {{"19"}, {"19"}, {"0-23"}}, {{"20"}, {"20"}, {"0-23"}}, + {{"21"}, {"21"}, {"0-23"}}, {{"22"}, {"22"}, {"0-23"}}, {{"23"}, {"23"}, {"0-23"}}, + {{"24"}, {"24"}, {"24-47"}}, {{"25"}, {"25"}, {"24-47"}}, {{"26"}, {"26"}, {"24-47"}}, + {{"27"}, {"27"}, {"24-47"}}, {{"28"}, {"28"}, {"24-47"}}, {{"29"}, {"29"}, {"24-47"}}, + {{"30"}, {"30"}, {"24-47"}}, {{"31"}, {"31"}, {"24-47"}}, {{"32"}, {"32"}, {"24-47"}}, + {{"33"}, {"33"}, {"24-47"}}, {{"34"}, {"34"}, {"24-47"}}, {{"35"}, {"35"}, {"24-47"}}, + {{"36"}, {"36"}, {"24-47"}}, {{"37"}, {"37"}, {"24-47"}}, {{"38"}, {"38"}, {"24-47"}}, + {{"39"}, {"39"}, {"24-47"}}, {{"40"}, {"40"}, {"24-47"}}, {{"41"}, {"41"}, {"24-47"}}, + {{"42"}, {"42"}, {"24-47"}}, {{"43"}, {"43"}, {"24-47"}}, {{"44"}, {"44"}, {"24-47"}}, + {{"45"}, {"45"}, {"24-47"}}, {{"46"}, {"46"}, {"24-47"}}, {{"47"}, {"47"}, {"24-47"}}, + }, + {}, +}; +LinuxCpuMapTestCase cache_2sockets_48cores_2 = { + 48, + 4, + 2, + 48, + {{48, 48, 0, 0, -1, -1}, {12, 12, 0, 0, 0, 0}, {12, 12, 0, 0, 1, 0}, {12, 12, 0, 0, 2, 1}, {12, 12, 0, 0, 3, 1}}, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 1, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 1, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 1, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 1, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 1, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 1, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 1, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 1, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 1, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 1, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 1, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 1, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 2, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 2, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 2, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 2, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 2, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 2, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 2, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 2, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 2, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 2, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 2, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 2, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 3, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 3, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 3, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 3, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 3, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 3, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 3, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 3, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 3, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 3, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 3, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 3, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, + { + {{"0"}, {"0"}, {"0-23"}}, {{"1"}, {"1"}, {"0-23"}}, {{"2"}, {"2"}, {"0-23"}}, + {{"3"}, {"3"}, {"0-23"}}, {{"4"}, {"4"}, {"0-23"}}, {{"5"}, {"5"}, {"0-23"}}, + {{"6"}, {"6"}, {"0-23"}}, {{"7"}, {"7"}, {"0-23"}}, {{"8"}, {"8"}, {"0-23"}}, + {{"9"}, {"9"}, {"0-23"}}, {{"10"}, {"10"}, {"0-23"}}, {{"11"}, {"11"}, {"0-23"}}, + {{"12"}, {"12"}, {"0-23"}}, {{"13"}, {"13"}, {"0-23"}}, {{"14"}, {"14"}, {"0-23"}}, + {{"15"}, {"15"}, {"0-23"}}, {{"16"}, {"16"}, {"0-23"}}, {{"17"}, {"17"}, {"0-23"}}, + {{"18"}, {"18"}, {"0-23"}}, {{"19"}, {"19"}, {"0-23"}}, {{"20"}, {"20"}, {"0-23"}}, + {{"21"}, {"21"}, {"0-23"}}, {{"22"}, {"22"}, {"0-23"}}, {{"23"}, {"23"}, {"0-23"}}, + {{"24"}, {"24"}, {"24-47"}}, {{"25"}, {"25"}, {"24-47"}}, {{"26"}, {"26"}, {"24-47"}}, + {{"27"}, {"27"}, {"24-47"}}, {{"28"}, {"28"}, {"24-47"}}, {{"29"}, {"29"}, {"24-47"}}, + {{"30"}, {"30"}, {"24-47"}}, {{"31"}, {"31"}, {"24-47"}}, {{"32"}, {"32"}, {"24-47"}}, + {{"33"}, {"33"}, {"24-47"}}, {{"34"}, {"34"}, {"24-47"}}, {{"35"}, {"35"}, {"24-47"}}, + {{"36"}, {"36"}, {"24-47"}}, {{"37"}, {"37"}, {"24-47"}}, {{"38"}, {"38"}, {"24-47"}}, + {{"39"}, {"39"}, {"24-47"}}, {{"40"}, {"40"}, {"24-47"}}, {{"41"}, {"41"}, {"24-47"}}, + {{"42"}, {"42"}, {"24-47"}}, {{"43"}, {"43"}, {"24-47"}}, {{"44"}, {"44"}, {"24-47"}}, + {{"45"}, {"45"}, {"24-47"}}, {{"46"}, {"46"}, {"24-47"}}, {{"47"}, {"47"}, {"24-47"}}, + }, + {{"0-11"}, {"12-23"}, {"24-35"}, {"36-47"}}, +}; +LinuxCpuMapTestCase cache_2sockets_20cores_hyperthreading = { + 40, + 2, + 2, + 20, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, {11, 1, 1, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {28, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {29, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, {31, 1, 1, 11, MAIN_CORE_PROC, 11, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, {33, 1, 1, 13, MAIN_CORE_PROC, 13, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, {35, 1, 1, 15, MAIN_CORE_PROC, 15, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, {37, 1, 1, 17, MAIN_CORE_PROC, 17, -1}, + {38, 1, 1, 18, MAIN_CORE_PROC, 18, -1}, {39, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + }, + { + {{"0,20"}, {"0,20"}, {"0-9,20-29"}}, {{"1,21"}, {"1,21"}, {"0-9,20-29"}}, + {{"2,22"}, {"2,22"}, {"0-9,20-29"}}, {{"3,23"}, {"3,23"}, {"0-9,20-29"}}, + {{"4,24"}, {"4,24"}, {"0-9,20-29"}}, {{"5,25"}, {"5,25"}, {"0-9,20-29"}}, + {{"6,26"}, {"6,26"}, {"0-9,20-29"}}, {{"7,27"}, {"7,27"}, {"0-9,20-29"}}, + {{"8,28"}, {"8,28"}, {"0-9,20-29"}}, {{"9,29"}, {"9,29"}, {"0-9,20-29"}}, + {{"10,30"}, {"10,30"}, {"10-19,30-39"}}, {{"11,31"}, {"11,31"}, {"10-19,30-39"}}, + {{"12,32"}, {"12,32"}, {"10-19,30-39"}}, {{"13,33"}, {"13,33"}, {"10-19,30-39"}}, + {{"14,34"}, {"14,34"}, {"10-19,30-39"}}, {{"15,35"}, {"15,35"}, {"10-19,30-39"}}, + {{"16,36"}, {"16,36"}, {"10-19,30-39"}}, {{"17,37"}, {"17,37"}, {"10-19,30-39"}}, + {{"18,38"}, {"18,38"}, {"10-19,30-39"}}, {{"19,39"}, {"19,39"}, {"10-19,30-39"}}, + {{"0,20"}, {"0,20"}, {"0-9,20-29"}}, {{"1,21"}, {"1,21"}, {"0-9,20-29"}}, + {{"2,22"}, {"2,22"}, {"0-9,20-29"}}, {{"3,23"}, {"3,23"}, {"0-9,20-29"}}, + {{"4,24"}, {"4,24"}, {"0-9,20-29"}}, {{"5,25"}, {"5,25"}, {"0-9,20-29"}}, + {{"6,26"}, {"6,26"}, {"0-9,20-29"}}, {{"7,27"}, {"7,27"}, {"0-9,20-29"}}, + {{"8,28"}, {"8,28"}, {"0-9,20-29"}}, {{"9,29"}, {"9,29"}, {"0-9,20-29"}}, + {{"10,30"}, {"10,30"}, {"10-19,30-39"}}, {{"11,31"}, {"11,31"}, {"10-19,30-39"}}, + {{"12,32"}, {"12,32"}, {"10-19,30-39"}}, {{"13,33"}, {"13,33"}, {"10-19,30-39"}}, + {{"14,34"}, {"14,34"}, {"10-19,30-39"}}, {{"15,35"}, {"15,35"}, {"10-19,30-39"}}, + {{"16,36"}, {"16,36"}, {"10-19,30-39"}}, {{"17,37"}, {"17,37"}, {"10-19,30-39"}}, + {{"18,38"}, {"18,38"}, {"10-19,30-39"}}, {{"19,39"}, {"19,39"}, {"10-19,30-39"}}, + }, + {{"0-9,20-29"}, {"10-19,30-39"}}, +}; +LinuxCpuMapTestCase cache_2sockets_20cores_hyperthreading_1 = { + 40, + 2, + 2, + 20, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, {11, 1, 1, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {28, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {29, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, {31, 1, 1, 11, MAIN_CORE_PROC, 11, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, {33, 1, 1, 13, MAIN_CORE_PROC, 13, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, {35, 1, 1, 15, MAIN_CORE_PROC, 15, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, {37, 1, 1, 17, MAIN_CORE_PROC, 17, -1}, + {38, 1, 1, 18, MAIN_CORE_PROC, 18, -1}, {39, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + }, + { + {{"0,20"}, {"0,20"}, {"0-9,20-29"}}, {{"1,21"}, {"1,21"}, {"0-9,20-29"}}, + {{"2,22"}, {"2,22"}, {"0-9,20-29"}}, {{"3,23"}, {"3,23"}, {"0-9,20-29"}}, + {{"4,24"}, {"4,24"}, {"0-9,20-29"}}, {{"5,25"}, {"5,25"}, {"0-9,20-29"}}, + {{"6,26"}, {"6,26"}, {"0-9,20-29"}}, {{"7,27"}, {"7,27"}, {"0-9,20-29"}}, + {{"8,28"}, {"8,28"}, {"0-9,20-29"}}, {{"9,29"}, {"9,29"}, {"0-9,20-29"}}, + {{"10,30"}, {"10,30"}, {"10-19,30-39"}}, {{"11,31"}, {"11,31"}, {"10-19,30-39"}}, + {{"12,32"}, {"12,32"}, {"10-19,30-39"}}, {{"13,33"}, {"13,33"}, {"10-19,30-39"}}, + {{"14,34"}, {"14,34"}, {"10-19,30-39"}}, {{"15,35"}, {"15,35"}, {"10-19,30-39"}}, + {{"16,36"}, {"16,36"}, {"10-19,30-39"}}, {{"17,37"}, {"17,37"}, {"10-19,30-39"}}, + {{"18,38"}, {"18,38"}, {"10-19,30-39"}}, {{"19,39"}, {"19,39"}, {"10-19,30-39"}}, + {{"0,20"}, {"0,20"}, {"0-9,20-29"}}, {{"1,21"}, {"1,21"}, {"0-9,20-29"}}, + {{"2,22"}, {"2,22"}, {"0-9,20-29"}}, {{"3,23"}, {"3,23"}, {"0-9,20-29"}}, + {{"4,24"}, {"4,24"}, {"0-9,20-29"}}, {{"5,25"}, {"5,25"}, {"0-9,20-29"}}, + {{"6,26"}, {"6,26"}, {"0-9,20-29"}}, {{"7,27"}, {"7,27"}, {"0-9,20-29"}}, + {{"8,28"}, {"8,28"}, {"0-9,20-29"}}, {{"9,29"}, {"9,29"}, {"0-9,20-29"}}, + {{"10,30"}, {"10,30"}, {"10-19,30-39"}}, {{"11,31"}, {"11,31"}, {"10-19,30-39"}}, + {{"12,32"}, {"12,32"}, {"10-19,30-39"}}, {{"13,33"}, {"13,33"}, {"10-19,30-39"}}, + {{"14,34"}, {"14,34"}, {"10-19,30-39"}}, {{"15,35"}, {"15,35"}, {"10-19,30-39"}}, + {{"16,36"}, {"16,36"}, {"10-19,30-39"}}, {{"17,37"}, {"17,37"}, {"10-19,30-39"}}, + {{"18,38"}, {"18,38"}, {"10-19,30-39"}}, {{"19,39"}, {"19,39"}, {"10-19,30-39"}}, + }, + {}, +}; +LinuxCpuMapTestCase cache_1sockets_14cores_hyperthreading = { + 20, + 1, + 1, + 14, + {{20, 6, 8, 6, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 0, 7, EFFICIENT_CORE_PROC, 6, -1}, + {14, 0, 0, 8, EFFICIENT_CORE_PROC, 6, -1}, {15, 0, 0, 9, EFFICIENT_CORE_PROC, 6, -1}, + {16, 0, 0, 10, EFFICIENT_CORE_PROC, 7, -1}, {17, 0, 0, 11, EFFICIENT_CORE_PROC, 7, -1}, + {18, 0, 0, 12, EFFICIENT_CORE_PROC, 7, -1}, {19, 0, 0, 13, EFFICIENT_CORE_PROC, 7, -1}, + }, + { + {{"0-1"}, {"0-1"}, {"0-19"}}, {{"0-1"}, {"0-1"}, {"0-19"}}, {{"2-3"}, {"2-3"}, {"0-19"}}, + {{"2-3"}, {"2-3"}, {"0-19"}}, {{"4-5"}, {"4-5"}, {"0-19"}}, {{"4-5"}, {"4-5"}, {"0-19"}}, + {{"6-7"}, {"6-7"}, {"0-19"}}, {{"6-7"}, {"6-7"}, {"0-19"}}, {{"8-9"}, {"8-9"}, {"0-19"}}, + {{"8-9"}, {"8-9"}, {"0-19"}}, {{"10-11"}, {"10-11"}, {"0-19"}}, {{"10-11"}, {"10-11"}, {"0-19"}}, + {{"12"}, {"12-15"}, {"0-19"}}, {{"13"}, {"12-15"}, {"0-19"}}, {{"14"}, {"12-15"}, {"0-19"}}, + {{"15"}, {"12-15"}, {"0-19"}}, {{"16"}, {"16-19"}, {"0-19"}}, {{"17"}, {"16-19"}, {"0-19"}}, + {{"18"}, {"16-19"}, {"0-19"}}, {{"19"}, {"16-19"}, {"0-19"}}, + }, + {{"0-19"}}, +}; +LinuxCpuMapTestCase cache_1sockets_14cores_hyperthreading_1 = { + 20, + 1, + 1, + 14, + {{20, 6, 8, 6, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 0, 7, EFFICIENT_CORE_PROC, 6, -1}, + {14, 0, 0, 8, EFFICIENT_CORE_PROC, 6, -1}, {15, 0, 0, 9, EFFICIENT_CORE_PROC, 6, -1}, + {16, 0, 0, 10, EFFICIENT_CORE_PROC, 7, -1}, {17, 0, 0, 11, EFFICIENT_CORE_PROC, 7, -1}, + {18, 0, 0, 12, EFFICIENT_CORE_PROC, 7, -1}, {19, 0, 0, 13, EFFICIENT_CORE_PROC, 7, -1}, + }, + { + {{"0-1"}, {"0-1"}, {"0-19"}}, {{"0-1"}, {"0-1"}, {"0-19"}}, {{"2-3"}, {"2-3"}, {"0-19"}}, + {{"2-3"}, {"2-3"}, {"0-19"}}, {{"4-5"}, {"4-5"}, {"0-19"}}, {{"4-5"}, {"4-5"}, {"0-19"}}, + {{"6-7"}, {"6-7"}, {"0-19"}}, {{"6-7"}, {"6-7"}, {"0-19"}}, {{"8-9"}, {"8-9"}, {"0-19"}}, + {{"8-9"}, {"8-9"}, {"0-19"}}, {{"10-11"}, {"10-11"}, {"0-19"}}, {{"10-11"}, {"10-11"}, {"0-19"}}, + {{"12"}, {"12-15"}, {"0-19"}}, {{"13"}, {"12-15"}, {"0-19"}}, {{"14"}, {"12-15"}, {"0-19"}}, + {{"15"}, {"12-15"}, {"0-19"}}, {{"16"}, {"16-19"}, {"0-19"}}, {{"17"}, {"16-19"}, {"0-19"}}, + {{"18"}, {"16-19"}, {"0-19"}}, {{"19"}, {"16-19"}, {"0-19"}}, + }, + {}, +}; +LinuxCpuMapTestCase cache_1sockets_10cores_hyperthreading = { + 12, + 1, + 1, + 10, + {{12, 2, 8, 2, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, EFFICIENT_CORE_PROC, 2, -1}, + {5, 0, 0, 3, EFFICIENT_CORE_PROC, 2, -1}, + {6, 0, 0, 4, EFFICIENT_CORE_PROC, 2, -1}, + {7, 0, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, + {8, 0, 0, 6, EFFICIENT_CORE_PROC, 3, -1}, + {9, 0, 0, 7, EFFICIENT_CORE_PROC, 3, -1}, + {10, 0, 0, 8, EFFICIENT_CORE_PROC, 3, -1}, + {11, 0, 0, 9, EFFICIENT_CORE_PROC, 3, -1}, + }, + { + {{"0-1"}, {"0-1"}, {"0-11"}}, + {{"0-1"}, {"0-1"}, {"0-11"}}, + {{"2-3"}, {"2-3"}, {"0-11"}}, + {{"2-3"}, {"2-3"}, {"0-11"}}, + {{"4"}, {"4-7"}, {"0-11"}}, + {{"5"}, {"4-7"}, {"0-11"}}, + {{"6"}, {"4-7"}, {"0-11"}}, + {{"7"}, {"4-7"}, {"0-11"}}, + {{"8"}, {"8-11"}, {"0-11"}}, + {{"9"}, {"8-11"}, {"0-11"}}, + {{"10"}, {"8-11"}, {"0-11"}}, + {{"11"}, {"8-11"}, {"0-11"}}, + }, + {{"0-11"}}, +}; +LinuxCpuMapTestCase cache_1sockets_8cores_hyperthreading = { + 12, + 1, + 1, + 8, + {{12, 4, 4, 4, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, EFFICIENT_CORE_PROC, 4, -1}, + {9, 0, 0, 5, EFFICIENT_CORE_PROC, 4, -1}, + {10, 0, 0, 6, EFFICIENT_CORE_PROC, 4, -1}, + {11, 0, 0, 7, EFFICIENT_CORE_PROC, 4, -1}, + }, + { + {{"0-1"}, {"0-1"}, {"0-11"}}, + {{"0-1"}, {"0-1"}, {"0-11"}}, + {{"2-3"}, {"2-3"}, {"0-11"}}, + {{"2-3"}, {"2-3"}, {"0-11"}}, + {{"4-5"}, {"4-5"}, {"0-11"}}, + {{"4-5"}, {"4-5"}, {"0-11"}}, + {{"6-7"}, {"6-7"}, {"0-11"}}, + {{"6-7"}, {"6-7"}, {"0-11"}}, + {{"8"}, {"8-11"}, {"0-11"}}, + {{"9"}, {"8-11"}, {"0-11"}}, + {{"10"}, {"8-11"}, {"0-11"}}, + {{"11"}, {"8-11"}, {"0-11"}}, + }, + {{"0-11"}}, +}; +LinuxCpuMapTestCase cache_1sockets_6cores_hyperthreading = { + 12, + 1, + 1, + 6, + {{12, 6, 0, 6, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + }, + { + {{"0-1"}, {"0-1"}, {"0-11"}}, + {{"0-1"}, {"0-1"}, {"0-11"}}, + {{"2-3"}, {"2-3"}, {"0-11"}}, + {{"2-3"}, {"2-3"}, {"0-11"}}, + {{"4-5"}, {"4-5"}, {"0-11"}}, + {{"4-5"}, {"4-5"}, {"0-11"}}, + {{"6-7"}, {"6-7"}, {"0-11"}}, + {{"6-7"}, {"6-7"}, {"0-11"}}, + {{"8-9"}, {"8-9"}, {"0-11"}}, + {{"8-9"}, {"8-9"}, {"0-11"}}, + {{"10-11"}, {"10-11"}, {"0-11"}}, + {{"10-11"}, {"10-11"}, {"0-11"}}, + }, + {}, +}; + +TEST_P(LinuxCpuMapCacheParserTests, LinuxCache) {} + +INSTANTIATE_TEST_SUITE_P(CPUMap, + LinuxCpuMapCacheParserTests, + testing::Values(cache_2sockets_104cores_hyperthreading, + cache_2sockets_48cores_hyperthreading, + cache_2sockets_48cores_hyperthreading_1, + cache_2sockets_24cores_hyperthreading, + cache_2sockets_24cores_hyperthreading_1, + cache_2sockets_48cores, + cache_2sockets_48cores_1, + cache_2sockets_48cores_2, + cache_2sockets_20cores_hyperthreading, + cache_2sockets_20cores_hyperthreading_1, + cache_1sockets_14cores_hyperthreading, + cache_1sockets_14cores_hyperthreading_1, + cache_1sockets_10cores_hyperthreading, + cache_1sockets_8cores_hyperthreading, + cache_1sockets_6cores_hyperthreading)); + +TEST_P(LinuxGetCpuMapFromCoresTests, LinuxCore) {} + +INSTANTIATE_TEST_SUITE_P(CPUMap, + LinuxGetCpuMapFromCoresTests, + testing::Values(cache_2sockets_104cores_hyperthreading, + cache_2sockets_48cores, + cache_2sockets_20cores_hyperthreading, + cache_1sockets_14cores_hyperthreading, + cache_1sockets_10cores_hyperthreading, + cache_1sockets_8cores_hyperthreading)); +#endif +} // namespace diff --git a/src/inference/tests/unit/cpu_map_parser/freq_parser_linux.cpp b/src/inference/tests/unit/cpu_map_parser/freq_parser_linux.cpp new file mode 100644 index 00000000000..2f90193b6ed --- /dev/null +++ b/src/inference/tests/unit/cpu_map_parser/freq_parser_linux.cpp @@ -0,0 +1,992 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include + +#include "ie_system_conf.h" +#include "os/cpu_map_info.hpp" + +using namespace testing; +using namespace ov; + +namespace { + +#ifdef __linux__ + +struct LinuxCpuMapTestCase { + int _processors; + int _numa_nodes; + int _sockets; + int _cores; + std::vector> _proc_type_table; + std::vector> _cpu_mapping_table; + std::vector> system_info_table; + std::vector node_info_table; +}; + +class LinuxCpuMapFreqParserTests : public CommonTestUtils::TestsCommon, + public testing::WithParamInterface> { +public: + void SetUp() override { + const auto& test_data = std::get<0>(GetParam()); + + int test_processors = 0; + int test_numa_nodes = 0; + int test_sockets = 0; + int test_cores = 0; + std::vector> test_proc_type_table; + std::vector> test_cpu_mapping_table; + + ov::parse_freq_info_linux(test_data.system_info_table, + test_data.node_info_table, + test_processors, + test_numa_nodes, + test_sockets, + test_cores, + test_proc_type_table, + test_cpu_mapping_table); + + ASSERT_EQ(test_data._processors, test_processors); + ASSERT_EQ(test_data._numa_nodes, test_numa_nodes); + ASSERT_EQ(test_data._sockets, test_sockets); + ASSERT_EQ(test_data._cores, test_cores); + ASSERT_EQ(test_data._proc_type_table, test_proc_type_table); + ASSERT_EQ(test_data._cpu_mapping_table, test_cpu_mapping_table); + } +}; + +LinuxCpuMapTestCase freq_2sockets_112cores_hyperthreading = { + 224, // param[expected out]: total 224 logcial processors on this simulated platform + 2, // param[expected out]: total 2 numa nodes on this simulated platform + 2, // param[expected out]: total 2 sockets on this simulated platform + 112, // param[expected out]: total 112 CPU cores on this simulated platform + {{224, 112, 0, 112, -1, -1}, + {112, 56, 0, 56, 0, 0}, + {112, 56, 0, 56, 1, 1}}, // param[expected out]: The proc_type_table of this simulated platform + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 0, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 0, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 0, 0, 24, HYPER_THREADING_PROC, 24, -1}, {25, 0, 0, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 0, 0, 26, HYPER_THREADING_PROC, 26, -1}, {27, 0, 0, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 0, 0, 28, HYPER_THREADING_PROC, 28, -1}, {29, 0, 0, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 0, 0, 30, HYPER_THREADING_PROC, 30, -1}, {31, 0, 0, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 0, 0, 32, HYPER_THREADING_PROC, 32, -1}, {33, 0, 0, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 0, 0, 34, HYPER_THREADING_PROC, 34, -1}, {35, 0, 0, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 0, 0, 36, HYPER_THREADING_PROC, 36, -1}, {37, 0, 0, 37, HYPER_THREADING_PROC, 37, -1}, + {38, 0, 0, 38, HYPER_THREADING_PROC, 38, -1}, {39, 0, 0, 39, HYPER_THREADING_PROC, 39, -1}, + {40, 0, 0, 40, HYPER_THREADING_PROC, 40, -1}, {41, 0, 0, 41, HYPER_THREADING_PROC, 41, -1}, + {42, 0, 0, 42, HYPER_THREADING_PROC, 42, -1}, {43, 0, 0, 43, HYPER_THREADING_PROC, 43, -1}, + {44, 0, 0, 44, HYPER_THREADING_PROC, 44, -1}, {45, 0, 0, 45, HYPER_THREADING_PROC, 45, -1}, + {46, 0, 0, 46, HYPER_THREADING_PROC, 46, -1}, {47, 0, 0, 47, HYPER_THREADING_PROC, 47, -1}, + {48, 0, 0, 48, HYPER_THREADING_PROC, 48, -1}, {49, 0, 0, 49, HYPER_THREADING_PROC, 49, -1}, + {50, 0, 0, 50, HYPER_THREADING_PROC, 50, -1}, {51, 0, 0, 51, HYPER_THREADING_PROC, 51, -1}, + {52, 0, 0, 52, HYPER_THREADING_PROC, 52, -1}, {53, 0, 0, 53, HYPER_THREADING_PROC, 53, -1}, + {54, 0, 0, 54, HYPER_THREADING_PROC, 54, -1}, {55, 0, 0, 55, HYPER_THREADING_PROC, 55, -1}, + {56, 1, 1, 56, HYPER_THREADING_PROC, 56, -1}, {57, 1, 1, 57, HYPER_THREADING_PROC, 57, -1}, + {58, 1, 1, 58, HYPER_THREADING_PROC, 58, -1}, {59, 1, 1, 59, HYPER_THREADING_PROC, 59, -1}, + {60, 1, 1, 60, HYPER_THREADING_PROC, 60, -1}, {61, 1, 1, 61, HYPER_THREADING_PROC, 61, -1}, + {62, 1, 1, 62, HYPER_THREADING_PROC, 62, -1}, {63, 1, 1, 63, HYPER_THREADING_PROC, 63, -1}, + {64, 1, 1, 64, HYPER_THREADING_PROC, 64, -1}, {65, 1, 1, 65, HYPER_THREADING_PROC, 65, -1}, + {66, 1, 1, 66, HYPER_THREADING_PROC, 66, -1}, {67, 1, 1, 67, HYPER_THREADING_PROC, 67, -1}, + {68, 1, 1, 68, HYPER_THREADING_PROC, 68, -1}, {69, 1, 1, 69, HYPER_THREADING_PROC, 69, -1}, + {70, 1, 1, 70, HYPER_THREADING_PROC, 70, -1}, {71, 1, 1, 71, HYPER_THREADING_PROC, 71, -1}, + {72, 1, 1, 72, HYPER_THREADING_PROC, 72, -1}, {73, 1, 1, 73, HYPER_THREADING_PROC, 73, -1}, + {74, 1, 1, 74, HYPER_THREADING_PROC, 74, -1}, {75, 1, 1, 75, HYPER_THREADING_PROC, 75, -1}, + {76, 1, 1, 76, HYPER_THREADING_PROC, 76, -1}, {77, 1, 1, 77, HYPER_THREADING_PROC, 77, -1}, + {78, 1, 1, 78, HYPER_THREADING_PROC, 78, -1}, {79, 1, 1, 79, HYPER_THREADING_PROC, 79, -1}, + {80, 1, 1, 80, HYPER_THREADING_PROC, 80, -1}, {81, 1, 1, 81, HYPER_THREADING_PROC, 81, -1}, + {82, 1, 1, 82, HYPER_THREADING_PROC, 82, -1}, {83, 1, 1, 83, HYPER_THREADING_PROC, 83, -1}, + {84, 1, 1, 84, HYPER_THREADING_PROC, 84, -1}, {85, 1, 1, 85, HYPER_THREADING_PROC, 85, -1}, + {86, 1, 1, 86, HYPER_THREADING_PROC, 86, -1}, {87, 1, 1, 87, HYPER_THREADING_PROC, 87, -1}, + {88, 1, 1, 88, HYPER_THREADING_PROC, 88, -1}, {89, 1, 1, 89, HYPER_THREADING_PROC, 89, -1}, + {90, 1, 1, 90, HYPER_THREADING_PROC, 90, -1}, {91, 1, 1, 91, HYPER_THREADING_PROC, 91, -1}, + {92, 1, 1, 92, HYPER_THREADING_PROC, 92, -1}, {93, 1, 1, 93, HYPER_THREADING_PROC, 93, -1}, + {94, 1, 1, 94, HYPER_THREADING_PROC, 94, -1}, {95, 1, 1, 95, HYPER_THREADING_PROC, 95, -1}, + {96, 1, 1, 96, HYPER_THREADING_PROC, 96, -1}, {97, 1, 1, 97, HYPER_THREADING_PROC, 97, -1}, + {98, 1, 1, 98, HYPER_THREADING_PROC, 98, -1}, {99, 1, 1, 99, HYPER_THREADING_PROC, 99, -1}, + {100, 1, 1, 100, HYPER_THREADING_PROC, 100, -1}, {101, 1, 1, 101, HYPER_THREADING_PROC, 101, -1}, + {102, 1, 1, 102, HYPER_THREADING_PROC, 102, -1}, {103, 1, 1, 103, HYPER_THREADING_PROC, 103, -1}, + {104, 1, 1, 104, HYPER_THREADING_PROC, 104, -1}, {105, 1, 1, 105, HYPER_THREADING_PROC, 105, -1}, + {106, 1, 1, 106, HYPER_THREADING_PROC, 106, -1}, {107, 1, 1, 107, HYPER_THREADING_PROC, 107, -1}, + {108, 1, 1, 108, HYPER_THREADING_PROC, 108, -1}, {109, 1, 1, 109, HYPER_THREADING_PROC, 109, -1}, + {110, 1, 1, 110, HYPER_THREADING_PROC, 110, -1}, {111, 1, 1, 111, HYPER_THREADING_PROC, 111, -1}, + {112, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {113, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {114, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {115, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {116, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {117, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {118, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {119, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {120, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {121, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {122, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {123, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {124, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {125, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {126, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {127, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {128, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {129, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {130, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {131, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {132, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {133, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {134, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {135, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {136, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {137, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {138, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {139, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {140, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {141, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {142, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {143, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {144, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, {145, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {146, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, {147, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {148, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {149, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {150, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {151, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + {152, 0, 0, 40, MAIN_CORE_PROC, 40, -1}, {153, 0, 0, 41, MAIN_CORE_PROC, 41, -1}, + {154, 0, 0, 42, MAIN_CORE_PROC, 42, -1}, {155, 0, 0, 43, MAIN_CORE_PROC, 43, -1}, + {156, 0, 0, 44, MAIN_CORE_PROC, 44, -1}, {157, 0, 0, 45, MAIN_CORE_PROC, 45, -1}, + {158, 0, 0, 46, MAIN_CORE_PROC, 46, -1}, {159, 0, 0, 47, MAIN_CORE_PROC, 47, -1}, + {160, 0, 0, 48, MAIN_CORE_PROC, 48, -1}, {161, 0, 0, 49, MAIN_CORE_PROC, 49, -1}, + {162, 0, 0, 50, MAIN_CORE_PROC, 50, -1}, {163, 0, 0, 51, MAIN_CORE_PROC, 51, -1}, + {164, 0, 0, 52, MAIN_CORE_PROC, 52, -1}, {165, 0, 0, 53, MAIN_CORE_PROC, 53, -1}, + {166, 0, 0, 54, MAIN_CORE_PROC, 54, -1}, {167, 0, 0, 55, MAIN_CORE_PROC, 55, -1}, + {168, 1, 1, 56, MAIN_CORE_PROC, 56, -1}, {169, 1, 1, 57, MAIN_CORE_PROC, 57, -1}, + {170, 1, 1, 58, MAIN_CORE_PROC, 58, -1}, {171, 1, 1, 59, MAIN_CORE_PROC, 59, -1}, + {172, 1, 1, 60, MAIN_CORE_PROC, 60, -1}, {173, 1, 1, 61, MAIN_CORE_PROC, 61, -1}, + {174, 1, 1, 62, MAIN_CORE_PROC, 62, -1}, {175, 1, 1, 63, MAIN_CORE_PROC, 63, -1}, + {176, 1, 1, 64, MAIN_CORE_PROC, 64, -1}, {177, 1, 1, 65, MAIN_CORE_PROC, 65, -1}, + {178, 1, 1, 66, MAIN_CORE_PROC, 66, -1}, {179, 1, 1, 67, MAIN_CORE_PROC, 67, -1}, + {180, 1, 1, 68, MAIN_CORE_PROC, 68, -1}, {181, 1, 1, 69, MAIN_CORE_PROC, 69, -1}, + {182, 1, 1, 70, MAIN_CORE_PROC, 70, -1}, {183, 1, 1, 71, MAIN_CORE_PROC, 71, -1}, + {184, 1, 1, 72, MAIN_CORE_PROC, 72, -1}, {185, 1, 1, 73, MAIN_CORE_PROC, 73, -1}, + {186, 1, 1, 74, MAIN_CORE_PROC, 74, -1}, {187, 1, 1, 75, MAIN_CORE_PROC, 75, -1}, + {188, 1, 1, 76, MAIN_CORE_PROC, 76, -1}, {189, 1, 1, 77, MAIN_CORE_PROC, 77, -1}, + {190, 1, 1, 78, MAIN_CORE_PROC, 78, -1}, {191, 1, 1, 79, MAIN_CORE_PROC, 79, -1}, + {192, 1, 1, 80, MAIN_CORE_PROC, 80, -1}, {193, 1, 1, 81, MAIN_CORE_PROC, 81, -1}, + {194, 1, 1, 82, MAIN_CORE_PROC, 82, -1}, {195, 1, 1, 83, MAIN_CORE_PROC, 83, -1}, + {196, 1, 1, 84, MAIN_CORE_PROC, 84, -1}, {197, 1, 1, 85, MAIN_CORE_PROC, 85, -1}, + {198, 1, 1, 86, MAIN_CORE_PROC, 86, -1}, {199, 1, 1, 87, MAIN_CORE_PROC, 87, -1}, + {200, 1, 1, 88, MAIN_CORE_PROC, 88, -1}, {201, 1, 1, 89, MAIN_CORE_PROC, 89, -1}, + {202, 1, 1, 90, MAIN_CORE_PROC, 90, -1}, {203, 1, 1, 91, MAIN_CORE_PROC, 91, -1}, + {204, 1, 1, 92, MAIN_CORE_PROC, 92, -1}, {205, 1, 1, 93, MAIN_CORE_PROC, 93, -1}, + {206, 1, 1, 94, MAIN_CORE_PROC, 94, -1}, {207, 1, 1, 95, MAIN_CORE_PROC, 95, -1}, + {208, 1, 1, 96, MAIN_CORE_PROC, 96, -1}, {209, 1, 1, 97, MAIN_CORE_PROC, 97, -1}, + {210, 1, 1, 98, MAIN_CORE_PROC, 98, -1}, {211, 1, 1, 99, MAIN_CORE_PROC, 99, -1}, + {212, 1, 1, 100, MAIN_CORE_PROC, 100, -1}, {213, 1, 1, 101, MAIN_CORE_PROC, 101, -1}, + {214, 1, 1, 102, MAIN_CORE_PROC, 102, -1}, {215, 1, 1, 103, MAIN_CORE_PROC, 103, -1}, + {216, 1, 1, 104, MAIN_CORE_PROC, 104, -1}, {217, 1, 1, 105, MAIN_CORE_PROC, 105, -1}, + {218, 1, 1, 106, MAIN_CORE_PROC, 106, -1}, {219, 1, 1, 107, MAIN_CORE_PROC, 107, -1}, + {220, 1, 1, 108, MAIN_CORE_PROC, 108, -1}, {221, 1, 1, 109, MAIN_CORE_PROC, 109, -1}, + {222, 1, 1, 110, MAIN_CORE_PROC, 110, -1}, {223, 1, 1, 111, MAIN_CORE_PROC, 111, -1}, + }, // param[expected out]: The cpu_mapping_table of this simulated platform + { + {"0,112", "0", "2001000"}, {"1,113", "0", "2001000"}, {"2,114", "0", "2001000"}, + {"3,115", "0", "2001000"}, {"4,116", "0", "2001000"}, {"5,117", "0", "2001000"}, + {"6,118", "0", "2001000"}, {"7,119", "0", "2001000"}, {"8,120", "0", "2001000"}, + {"9,121", "0", "2001000"}, {"10,122", "0", "2001000"}, {"11,123", "0", "2001000"}, + {"12,124", "0", "2001000"}, {"13,125", "0", "2001000"}, {"14,126", "0", "2001000"}, + {"15,127", "0", "2001000"}, {"16,128", "0", "2001000"}, {"17,129", "0", "2001000"}, + {"18,130", "0", "2001000"}, {"19,131", "0", "2001000"}, {"20,132", "0", "2001000"}, + {"21,133", "0", "2001000"}, {"22,134", "0", "2001000"}, {"23,135", "0", "2001000"}, + {"24,136", "0", "2001000"}, {"25,137", "0", "2001000"}, {"26,138", "0", "2001000"}, + {"27,139", "0", "2001000"}, {"28,140", "0", "2001000"}, {"29,141", "0", "2001000"}, + {"30,142", "0", "2001000"}, {"31,143", "0", "2001000"}, {"32,144", "0", "2001000"}, + {"33,145", "0", "2001000"}, {"34,146", "0", "2001000"}, {"35,147", "0", "2001000"}, + {"36,148", "0", "2001000"}, {"37,149", "0", "2001000"}, {"38,150", "0", "2001000"}, + {"39,151", "0", "2001000"}, {"40,152", "0", "2001000"}, {"41,153", "0", "2001000"}, + {"42,154", "0", "2001000"}, {"43,155", "0", "2001000"}, {"44,156", "0", "2001000"}, + {"45,157", "0", "2001000"}, {"46,158", "0", "2001000"}, {"47,159", "0", "2001000"}, + {"48,160", "0", "2001000"}, {"49,161", "0", "2001000"}, {"50,162", "0", "2001000"}, + {"51,163", "0", "2001000"}, {"52,164", "0", "2001000"}, {"53,165", "0", "2001000"}, + {"54,166", "0", "2001000"}, {"55,167", "0", "2001000"}, {"56,168", "1", "2001000"}, + {"57,169", "1", "2001000"}, {"58,170", "1", "2001000"}, {"59,171", "1", "2001000"}, + {"60,172", "1", "2001000"}, {"61,173", "1", "2001000"}, {"62,174", "1", "2001000"}, + {"63,175", "1", "2001000"}, {"64,176", "1", "2001000"}, {"65,177", "1", "2001000"}, + {"66,178", "1", "2001000"}, {"67,179", "1", "2001000"}, {"68,180", "1", "2001000"}, + {"69,181", "1", "2001000"}, {"70,182", "1", "2001000"}, {"71,183", "1", "2001000"}, + {"72,184", "1", "2001000"}, {"73,185", "1", "2001000"}, {"74,186", "1", "2001000"}, + {"75,187", "1", "2001000"}, {"76,188", "1", "2001000"}, {"77,189", "1", "2001000"}, + {"78,190", "1", "2001000"}, {"79,191", "1", "2001000"}, {"80,192", "1", "2001000"}, + {"81,193", "1", "2001000"}, {"82,194", "1", "2001000"}, {"83,195", "1", "2001000"}, + {"84,196", "1", "2001000"}, {"85,197", "1", "2001000"}, {"86,198", "1", "2001000"}, + {"87,199", "1", "2001000"}, {"88,200", "1", "2001000"}, {"89,201", "1", "2001000"}, + {"90,202", "1", "2001000"}, {"91,203", "1", "2001000"}, {"92,204", "1", "2001000"}, + {"93,205", "1", "2001000"}, {"94,206", "1", "2001000"}, {"95,207", "1", "2001000"}, + {"96,208", "1", "2001000"}, {"97,209", "1", "2001000"}, {"98,210", "1", "2001000"}, + {"99,211", "1", "2001000"}, {"100,212", "1", "2001000"}, {"101,213", "1", "2001000"}, + {"102,214", "1", "2001000"}, {"103,215", "1", "2001000"}, {"104,216", "1", "2001000"}, + {"105,217", "1", "2001000"}, {"106,218", "1", "2001000"}, {"107,219", "1", "2001000"}, + {"108,220", "1", "2001000"}, {"109,221", "1", "2001000"}, {"110,222", "1", "2001000"}, + {"111,223", "1", "2001000"}, {"0,112", "0", "2001000"}, {"1,113", "0", "2001000"}, + {"2,114", "0", "2001000"}, {"3,115", "0", "2001000"}, {"4,116", "0", "2001000"}, + {"5,117", "0", "2001000"}, {"6,118", "0", "2001000"}, {"7,119", "0", "2001000"}, + {"8,120", "0", "2001000"}, {"9,121", "0", "2001000"}, {"10,122", "0", "2001000"}, + {"11,123", "0", "2001000"}, {"12,124", "0", "2001000"}, {"13,125", "0", "2001000"}, + {"14,126", "0", "2001000"}, {"15,127", "0", "2001000"}, {"16,128", "0", "2001000"}, + {"17,129", "0", "2001000"}, {"18,130", "0", "2001000"}, {"19,131", "0", "2001000"}, + {"20,132", "0", "2001000"}, {"21,133", "0", "2001000"}, {"22,134", "0", "2001000"}, + {"23,135", "0", "2001000"}, {"24,136", "0", "2001000"}, {"25,137", "0", "2001000"}, + {"26,138", "0", "2001000"}, {"27,139", "0", "2001000"}, {"28,140", "0", "2001000"}, + {"29,141", "0", "2001000"}, {"30,142", "0", "2001000"}, {"31,143", "0", "2001000"}, + {"32,144", "0", "2001000"}, {"33,145", "0", "2001000"}, {"34,146", "0", "2001000"}, + {"35,147", "0", "2001000"}, {"36,148", "0", "2001000"}, {"37,149", "0", "2001000"}, + {"38,150", "0", "2001000"}, {"39,151", "0", "2001000"}, {"40,152", "0", "2001000"}, + {"41,153", "0", "2001000"}, {"42,154", "0", "2001000"}, {"43,155", "0", "2001000"}, + {"44,156", "0", "2001000"}, {"45,157", "0", "2001000"}, {"46,158", "0", "2001000"}, + {"47,159", "0", "2001000"}, {"48,160", "0", "2001000"}, {"49,161", "0", "2001000"}, + {"50,162", "0", "2001000"}, {"51,163", "0", "2001000"}, {"52,164", "0", "2001000"}, + {"53,165", "0", "2001000"}, {"54,166", "0", "2001000"}, {"55,167", "0", "2001000"}, + {"56,168", "1", "2001000"}, {"57,169", "1", "2001000"}, {"58,170", "1", "2001000"}, + {"59,171", "1", "2001000"}, {"60,172", "1", "2001000"}, {"61,173", "1", "2001000"}, + {"62,174", "1", "2001000"}, {"63,175", "1", "2001000"}, {"64,176", "1", "2001000"}, + {"65,177", "1", "2001000"}, {"66,178", "1", "2001000"}, {"67,179", "1", "2001000"}, + {"68,180", "1", "2001000"}, {"69,181", "1", "2001000"}, {"70,182", "1", "2001000"}, + {"71,183", "1", "2001000"}, {"72,184", "1", "2001000"}, {"73,185", "1", "2001000"}, + {"74,186", "1", "2001000"}, {"75,187", "1", "2001000"}, {"76,188", "1", "2001000"}, + {"77,189", "1", "2001000"}, {"78,190", "1", "2001000"}, {"79,191", "1", "2001000"}, + {"80,192", "1", "2001000"}, {"81,193", "1", "2001000"}, {"82,194", "1", "2001000"}, + {"83,195", "1", "2001000"}, {"84,196", "1", "2001000"}, {"85,197", "1", "2001000"}, + {"86,198", "1", "2001000"}, {"87,199", "1", "2001000"}, {"88,200", "1", "2001000"}, + {"89,201", "1", "2001000"}, {"90,202", "1", "2001000"}, {"91,203", "1", "2001000"}, + {"92,204", "1", "2001000"}, {"93,205", "1", "2001000"}, {"94,206", "1", "2001000"}, + {"95,207", "1", "2001000"}, {"96,208", "1", "2001000"}, {"97,209", "1", "2001000"}, + {"98,210", "1", "2001000"}, {"99,211", "1", "2001000"}, {"100,212", "1", "2001000"}, + {"101,213", "1", "2001000"}, {"102,214", "1", "2001000"}, {"103,215", "1", "2001000"}, + {"104,216", "1", "2001000"}, {"105,217", "1", "2001000"}, {"106,218", "1", "2001000"}, + {"107,219", "1", "2001000"}, {"108,220", "1", "2001000"}, {"109,221", "1", "2001000"}, + {"110,222", "1", "2001000"}, {"111,223", "1", "2001000"}, + }, // param[in]: The CPU frequency information table of this simulated platform + {{"0-55,112-167"}, {"56-111,168-223"}}, // param[in]: The numa node information table of this simulated platform +}; +LinuxCpuMapTestCase freq_2sockets_48cores_hyperthreading = { + 96, + 2, + 2, + 48, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 0, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 0, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 1, 1, 36, HYPER_THREADING_PROC, 36, -1}, {37, 1, 1, 37, HYPER_THREADING_PROC, 37, -1}, + {38, 1, 1, 38, HYPER_THREADING_PROC, 38, -1}, {39, 1, 1, 39, HYPER_THREADING_PROC, 39, -1}, + {40, 1, 1, 40, HYPER_THREADING_PROC, 40, -1}, {41, 1, 1, 41, HYPER_THREADING_PROC, 41, -1}, + {42, 1, 1, 42, HYPER_THREADING_PROC, 42, -1}, {43, 1, 1, 43, HYPER_THREADING_PROC, 43, -1}, + {44, 1, 1, 44, HYPER_THREADING_PROC, 44, -1}, {45, 1, 1, 45, HYPER_THREADING_PROC, 45, -1}, + {46, 1, 1, 46, HYPER_THREADING_PROC, 46, -1}, {47, 1, 1, 47, HYPER_THREADING_PROC, 47, -1}, + {48, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {49, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {50, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {51, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {52, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {53, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {54, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {55, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {56, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {57, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {58, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {59, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {60, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {61, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {62, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {63, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {64, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {65, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {66, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {67, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {68, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {69, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {70, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {71, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {72, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {73, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {74, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {75, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {76, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {77, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {78, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {79, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {80, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {81, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {82, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {83, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {84, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {85, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {86, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {87, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {88, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {89, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {90, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {91, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {92, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {93, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {94, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {95, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, + { + {"0,48", "0", "3600000"}, {"1,49", "0", "3600000"}, {"2,50", "0", "3600000"}, {"3,51", "0", "3600000"}, + {"4,52", "0", "3600000"}, {"5,53", "0", "3600000"}, {"6,54", "0", "3600000"}, {"7,55", "0", "3600000"}, + {"8,56", "0", "3600000"}, {"9,57", "0", "3600000"}, {"10,58", "0", "3600000"}, {"11,59", "0", "3600000"}, + {"12,60", "0", "3600000"}, {"13,61", "0", "3600000"}, {"14,62", "0", "3600000"}, {"15,63", "0", "3600000"}, + {"16,64", "0", "3600000"}, {"17,65", "0", "3600000"}, {"18,66", "0", "3600000"}, {"19,67", "0", "3600000"}, + {"20,68", "0", "3600000"}, {"21,69", "0", "3600000"}, {"22,70", "0", "3600000"}, {"23,71", "0", "3600000"}, + {"24,72", "1", "3600000"}, {"25,73", "1", "3600000"}, {"26,74", "1", "3600000"}, {"27,75", "1", "3600000"}, + {"28,76", "1", "3600000"}, {"29,77", "1", "3600000"}, {"30,78", "1", "3600000"}, {"31,79", "1", "3600000"}, + {"32,80", "1", "3600000"}, {"33,81", "1", "3600000"}, {"34,82", "1", "3600000"}, {"35,83", "1", "3600000"}, + {"36,84", "1", "3600000"}, {"37,85", "1", "3600000"}, {"38,86", "1", "3600000"}, {"39,87", "1", "3600000"}, + {"40,88", "1", "3600000"}, {"41,89", "1", "3600000"}, {"42,90", "1", "3600000"}, {"43,91", "1", "3600000"}, + {"44,92", "1", "3600000"}, {"45,93", "1", "3600000"}, {"46,94", "1", "3600000"}, {"47,95", "1", "3600000"}, + {"0,48", "0", "3600000"}, {"1,49", "0", "3600000"}, {"2,50", "0", "3600000"}, {"3,51", "0", "3600000"}, + {"4,52", "0", "3600000"}, {"5,53", "0", "3600000"}, {"6,54", "0", "3600000"}, {"7,55", "0", "3600000"}, + {"8,56", "0", "3600000"}, {"9,57", "0", "3600000"}, {"10,58", "0", "3600000"}, {"11,59", "0", "3600000"}, + {"12,60", "0", "3600000"}, {"13,61", "0", "3600000"}, {"14,62", "0", "3600000"}, {"15,63", "0", "3600000"}, + {"16,64", "0", "3600000"}, {"17,65", "0", "3600000"}, {"18,66", "0", "3600000"}, {"19,67", "0", "3600000"}, + {"20,68", "0", "3600000"}, {"21,69", "0", "3600000"}, {"22,70", "0", "3600000"}, {"23,71", "0", "3600000"}, + {"24,72", "1", "3600000"}, {"25,73", "1", "3600000"}, {"26,74", "1", "3600000"}, {"27,75", "1", "3600000"}, + {"28,76", "1", "3600000"}, {"29,77", "1", "3600000"}, {"30,78", "1", "3600000"}, {"31,79", "1", "3600000"}, + {"32,80", "1", "3600000"}, {"33,81", "1", "3600000"}, {"34,82", "1", "3600000"}, {"35,83", "1", "3600000"}, + {"36,84", "1", "3600000"}, {"37,85", "1", "3600000"}, {"38,86", "1", "3600000"}, {"39,87", "1", "3600000"}, + {"40,88", "1", "3600000"}, {"41,89", "1", "3600000"}, {"42,90", "1", "3600000"}, {"43,91", "1", "3600000"}, + {"44,92", "1", "3600000"}, {"45,93", "1", "3600000"}, {"46,94", "1", "3600000"}, {"47,95", "1", "3600000"}, + }, + { + {"0-23,48-71"}, + {"24-47,72-95"}, + }, + +}; +LinuxCpuMapTestCase freq_2sockets_48cores_hyperthreading_1 = { + 96, + 4, + 2, + 48, + {{96, 48, 0, 48, -1, -1}, + {24, 12, 0, 12, 0, 0}, + {24, 12, 0, 12, 1, 0}, + {24, 12, 0, 12, 2, 1}, + {24, 12, 0, 12, 3, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 1, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 1, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 1, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 1, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 1, 0, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 1, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 1, 0, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 2, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 2, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 2, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 2, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 2, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 2, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 2, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 2, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 2, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 2, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 2, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 2, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 3, 1, 36, HYPER_THREADING_PROC, 36, -1}, {37, 3, 1, 37, HYPER_THREADING_PROC, 37, -1}, + {38, 3, 1, 38, HYPER_THREADING_PROC, 38, -1}, {39, 3, 1, 39, HYPER_THREADING_PROC, 39, -1}, + {40, 3, 1, 40, HYPER_THREADING_PROC, 40, -1}, {41, 3, 1, 41, HYPER_THREADING_PROC, 41, -1}, + {42, 3, 1, 42, HYPER_THREADING_PROC, 42, -1}, {43, 3, 1, 43, HYPER_THREADING_PROC, 43, -1}, + {44, 3, 1, 44, HYPER_THREADING_PROC, 44, -1}, {45, 3, 1, 45, HYPER_THREADING_PROC, 45, -1}, + {46, 3, 1, 46, HYPER_THREADING_PROC, 46, -1}, {47, 3, 1, 47, HYPER_THREADING_PROC, 47, -1}, + {48, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {49, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {50, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {51, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {52, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {53, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {54, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {55, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {56, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {57, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {58, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {59, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {60, 1, 0, 12, MAIN_CORE_PROC, 12, -1}, {61, 1, 0, 13, MAIN_CORE_PROC, 13, -1}, + {62, 1, 0, 14, MAIN_CORE_PROC, 14, -1}, {63, 1, 0, 15, MAIN_CORE_PROC, 15, -1}, + {64, 1, 0, 16, MAIN_CORE_PROC, 16, -1}, {65, 1, 0, 17, MAIN_CORE_PROC, 17, -1}, + {66, 1, 0, 18, MAIN_CORE_PROC, 18, -1}, {67, 1, 0, 19, MAIN_CORE_PROC, 19, -1}, + {68, 1, 0, 20, MAIN_CORE_PROC, 20, -1}, {69, 1, 0, 21, MAIN_CORE_PROC, 21, -1}, + {70, 1, 0, 22, MAIN_CORE_PROC, 22, -1}, {71, 1, 0, 23, MAIN_CORE_PROC, 23, -1}, + {72, 2, 1, 24, MAIN_CORE_PROC, 24, -1}, {73, 2, 1, 25, MAIN_CORE_PROC, 25, -1}, + {74, 2, 1, 26, MAIN_CORE_PROC, 26, -1}, {75, 2, 1, 27, MAIN_CORE_PROC, 27, -1}, + {76, 2, 1, 28, MAIN_CORE_PROC, 28, -1}, {77, 2, 1, 29, MAIN_CORE_PROC, 29, -1}, + {78, 2, 1, 30, MAIN_CORE_PROC, 30, -1}, {79, 2, 1, 31, MAIN_CORE_PROC, 31, -1}, + {80, 2, 1, 32, MAIN_CORE_PROC, 32, -1}, {81, 2, 1, 33, MAIN_CORE_PROC, 33, -1}, + {82, 2, 1, 34, MAIN_CORE_PROC, 34, -1}, {83, 2, 1, 35, MAIN_CORE_PROC, 35, -1}, + {84, 3, 1, 36, MAIN_CORE_PROC, 36, -1}, {85, 3, 1, 37, MAIN_CORE_PROC, 37, -1}, + {86, 3, 1, 38, MAIN_CORE_PROC, 38, -1}, {87, 3, 1, 39, MAIN_CORE_PROC, 39, -1}, + {88, 3, 1, 40, MAIN_CORE_PROC, 40, -1}, {89, 3, 1, 41, MAIN_CORE_PROC, 41, -1}, + {90, 3, 1, 42, MAIN_CORE_PROC, 42, -1}, {91, 3, 1, 43, MAIN_CORE_PROC, 43, -1}, + {92, 3, 1, 44, MAIN_CORE_PROC, 44, -1}, {93, 3, 1, 45, MAIN_CORE_PROC, 45, -1}, + {94, 3, 1, 46, MAIN_CORE_PROC, 46, -1}, {95, 3, 1, 47, MAIN_CORE_PROC, 47, -1}, + }, + { + {"0,48", "0", "3600000"}, {"1,49", "0", "3600000"}, {"2,50", "0", "3600000"}, {"3,51", "0", "3600000"}, + {"4,52", "0", "3600000"}, {"5,53", "0", "3600000"}, {"6,54", "0", "3600000"}, {"7,55", "0", "3600000"}, + {"8,56", "0", "3600000"}, {"9,57", "0", "3600000"}, {"10,58", "0", "3600000"}, {"11,59", "0", "3600000"}, + {"12,60", "0", "3600000"}, {"13,61", "0", "3600000"}, {"14,62", "0", "3600000"}, {"15,63", "0", "3600000"}, + {"16,64", "0", "3600000"}, {"17,65", "0", "3600000"}, {"18,66", "0", "3600000"}, {"19,67", "0", "3600000"}, + {"20,68", "0", "3600000"}, {"21,69", "0", "3600000"}, {"22,70", "0", "3600000"}, {"23,71", "0", "3600000"}, + {"24,72", "1", "3600000"}, {"25,73", "1", "3600000"}, {"26,74", "1", "3600000"}, {"27,75", "1", "3600000"}, + {"28,76", "1", "3600000"}, {"29,77", "1", "3600000"}, {"30,78", "1", "3600000"}, {"31,79", "1", "3600000"}, + {"32,80", "1", "3600000"}, {"33,81", "1", "3600000"}, {"34,82", "1", "3600000"}, {"35,83", "1", "3600000"}, + {"36,84", "1", "3600000"}, {"37,85", "1", "3600000"}, {"38,86", "1", "3600000"}, {"39,87", "1", "3600000"}, + {"40,88", "1", "3600000"}, {"41,89", "1", "3600000"}, {"42,90", "1", "3600000"}, {"43,91", "1", "3600000"}, + {"44,92", "1", "3600000"}, {"45,93", "1", "3600000"}, {"46,94", "1", "3600000"}, {"47,95", "1", "3600000"}, + {"0,48", "0", "3600000"}, {"1,49", "0", "3600000"}, {"2,50", "0", "3600000"}, {"3,51", "0", "3600000"}, + {"4,52", "0", "3600000"}, {"5,53", "0", "3600000"}, {"6,54", "0", "3600000"}, {"7,55", "0", "3600000"}, + {"8,56", "0", "3600000"}, {"9,57", "0", "3600000"}, {"10,58", "0", "3600000"}, {"11,59", "0", "3600000"}, + {"12,60", "0", "3600000"}, {"13,61", "0", "3600000"}, {"14,62", "0", "3600000"}, {"15,63", "0", "3600000"}, + {"16,64", "0", "3600000"}, {"17,65", "0", "3600000"}, {"18,66", "0", "3600000"}, {"19,67", "0", "3600000"}, + {"20,68", "0", "3600000"}, {"21,69", "0", "3600000"}, {"22,70", "0", "3600000"}, {"23,71", "0", "3600000"}, + {"24,72", "1", "3600000"}, {"25,73", "1", "3600000"}, {"26,74", "1", "3600000"}, {"27,75", "1", "3600000"}, + {"28,76", "1", "3600000"}, {"29,77", "1", "3600000"}, {"30,78", "1", "3600000"}, {"31,79", "1", "3600000"}, + {"32,80", "1", "3600000"}, {"33,81", "1", "3600000"}, {"34,82", "1", "3600000"}, {"35,83", "1", "3600000"}, + {"36,84", "1", "3600000"}, {"37,85", "1", "3600000"}, {"38,86", "1", "3600000"}, {"39,87", "1", "3600000"}, + {"40,88", "1", "3600000"}, {"41,89", "1", "3600000"}, {"42,90", "1", "3600000"}, {"43,91", "1", "3600000"}, + {"44,92", "1", "3600000"}, {"45,93", "1", "3600000"}, {"46,94", "1", "3600000"}, {"47,95", "1", "3600000"}, + }, + { + {"0-11,48-59"}, + {"12-23,60-71"}, + {"24-35,72-83"}, + {"36-47,84-95"}, + }, +}; +LinuxCpuMapTestCase freq_2sockets_24cores_hyperthreading = { + 48, + 2, + 2, + 24, + {{48, 24, 0, 24, -1, -1}, {24, 12, 0, 12, 0, 0}, {24, 12, 0, 12, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 1, 1, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 1, 1, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 1, 1, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 1, 1, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 1, 1, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 1, 1, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 1, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 1, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {25, 1, 1, 1, MAIN_CORE_PROC, 1, -1}, + {26, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {27, 1, 1, 3, MAIN_CORE_PROC, 3, -1}, + {28, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {29, 1, 1, 5, MAIN_CORE_PROC, 5, -1}, + {30, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {31, 1, 1, 7, MAIN_CORE_PROC, 7, -1}, + {32, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {33, 1, 1, 9, MAIN_CORE_PROC, 9, -1}, + {34, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {35, 1, 1, 11, MAIN_CORE_PROC, 11, -1}, + {36, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {37, 1, 1, 13, MAIN_CORE_PROC, 13, -1}, + {38, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {39, 1, 1, 15, MAIN_CORE_PROC, 15, -1}, + {40, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {41, 1, 1, 17, MAIN_CORE_PROC, 17, -1}, + {42, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {43, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + {44, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {45, 1, 1, 21, MAIN_CORE_PROC, 21, -1}, + {46, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {47, 1, 1, 23, MAIN_CORE_PROC, 23, -1}, + }, + { + {"0,24", "0", "3500000"}, {"1,25", "1", "3500000"}, {"2,26", "0", "3500000"}, {"3,27", "1", "3500000"}, + {"4,28", "0", "3500000"}, {"5,29", "1", "3500000"}, {"6,30", "0", "3500000"}, {"7,31", "1", "3500000"}, + {"8,32", "0", "3500000"}, {"9,33", "1", "3500000"}, {"10,34", "0", "3500000"}, {"11,35", "1", "3500000"}, + {"12,36", "0", "3500000"}, {"13,37", "1", "3500000"}, {"14,38", "0", "3500000"}, {"15,39", "1", "3500000"}, + {"16,40", "0", "3500000"}, {"17,41", "1", "3500000"}, {"18,42", "0", "3500000"}, {"19,43", "1", "3500000"}, + {"20,44", "0", "3500000"}, {"21,45", "1", "3500000"}, {"22,46", "0", "3500000"}, {"23,47", "1", "3500000"}, + {"0,24", "0", "3500000"}, {"1,25", "1", "3500000"}, {"2,26", "0", "3500000"}, {"3,27", "1", "3500000"}, + {"4,28", "0", "3500000"}, {"5,29", "1", "3500000"}, {"6,30", "0", "3500000"}, {"7,31", "1", "3500000"}, + {"8,32", "0", "3500000"}, {"9,33", "1", "3500000"}, {"10,34", "0", "3500000"}, {"11,35", "1", "3500000"}, + {"12,36", "0", "3500000"}, {"13,37", "1", "3500000"}, {"14,38", "0", "3500000"}, {"15,39", "1", "3500000"}, + {"16,40", "0", "3500000"}, {"17,41", "1", "3500000"}, {"18,42", "0", "3500000"}, {"19,43", "1", "3500000"}, + {"20,44", "0", "3500000"}, {"21,45", "1", "3500000"}, {"22,46", "0", "3500000"}, {"23,47", "1", "3500000"}, + }, + { + {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}, + {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}, + }, +}; +LinuxCpuMapTestCase freq_2sockets_24cores_hyperthreading_1 = { + 48, + 4, + 2, + 24, + {{48, 24, 0, 24, -1, -1}, {12, 6, 0, 6, 0, 0}, {12, 6, 0, 6, 1, 0}, {12, 6, 0, 6, 2, 1}, {12, 6, 0, 6, 3, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 2, 1, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 2, 1, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 2, 1, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 2, 1, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 2, 1, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 2, 1, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 1, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 3, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 1, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 3, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 1, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 3, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 3, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 1, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 3, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 1, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 3, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {25, 2, 1, 1, MAIN_CORE_PROC, 1, -1}, + {26, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {27, 2, 1, 3, MAIN_CORE_PROC, 3, -1}, + {28, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {29, 2, 1, 5, MAIN_CORE_PROC, 5, -1}, + {30, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {31, 2, 1, 7, MAIN_CORE_PROC, 7, -1}, + {32, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {33, 2, 1, 9, MAIN_CORE_PROC, 9, -1}, + {34, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {35, 2, 1, 11, MAIN_CORE_PROC, 11, -1}, + {36, 1, 0, 12, MAIN_CORE_PROC, 12, -1}, {37, 3, 1, 13, MAIN_CORE_PROC, 13, -1}, + {38, 1, 0, 14, MAIN_CORE_PROC, 14, -1}, {39, 3, 1, 15, MAIN_CORE_PROC, 15, -1}, + {40, 1, 0, 16, MAIN_CORE_PROC, 16, -1}, {41, 3, 1, 17, MAIN_CORE_PROC, 17, -1}, + {42, 1, 0, 18, MAIN_CORE_PROC, 18, -1}, {43, 3, 1, 19, MAIN_CORE_PROC, 19, -1}, + {44, 1, 0, 20, MAIN_CORE_PROC, 20, -1}, {45, 3, 1, 21, MAIN_CORE_PROC, 21, -1}, + {46, 1, 0, 22, MAIN_CORE_PROC, 22, -1}, {47, 3, 1, 23, MAIN_CORE_PROC, 23, -1}, + }, + { + {"0,24", "0", "3500000"}, {"1,25", "1", "3500000"}, {"2,26", "0", "3500000"}, {"3,27", "1", "3500000"}, + {"4,28", "0", "3500000"}, {"5,29", "1", "3500000"}, {"6,30", "0", "3500000"}, {"7,31", "1", "3500000"}, + {"8,32", "0", "3500000"}, {"9,33", "1", "3500000"}, {"10,34", "0", "3500000"}, {"11,35", "1", "3500000"}, + {"12,36", "0", "3500000"}, {"13,37", "1", "3500000"}, {"14,38", "0", "3500000"}, {"15,39", "1", "3500000"}, + {"16,40", "0", "3500000"}, {"17,41", "1", "3500000"}, {"18,42", "0", "3500000"}, {"19,43", "1", "3500000"}, + {"20,44", "0", "3500000"}, {"21,45", "1", "3500000"}, {"22,46", "0", "3500000"}, {"23,47", "1", "3500000"}, + {"0,24", "0", "3500000"}, {"1,25", "1", "3500000"}, {"2,26", "0", "3500000"}, {"3,27", "1", "3500000"}, + {"4,28", "0", "3500000"}, {"5,29", "1", "3500000"}, {"6,30", "0", "3500000"}, {"7,31", "1", "3500000"}, + {"8,32", "0", "3500000"}, {"9,33", "1", "3500000"}, {"10,34", "0", "3500000"}, {"11,35", "1", "3500000"}, + {"12,36", "0", "3500000"}, {"13,37", "1", "3500000"}, {"14,38", "0", "3500000"}, {"15,39", "1", "3500000"}, + {"16,40", "0", "3500000"}, {"17,41", "1", "3500000"}, {"18,42", "0", "3500000"}, {"19,43", "1", "3500000"}, + {"20,44", "0", "3500000"}, {"21,45", "1", "3500000"}, {"22,46", "0", "3500000"}, {"23,47", "1", "3500000"}, + }, + { + {"0,2,4,6,8,10,24,26,28,30,32,34"}, + {"12,14,16,18,20,22,36,38,40,42,44,46"}, + {"1,3,5,7,9,11,25,27,29,31,33,35"}, + {"13,15,17,19,21,23,37,39,41,43,45,47"}, + }, +}; +LinuxCpuMapTestCase freq_2sockets_20cores_hyperthreading = { + 40, + 2, + 2, + 20, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, {11, 1, 1, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {28, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {29, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, {31, 1, 1, 11, MAIN_CORE_PROC, 11, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, {33, 1, 1, 13, MAIN_CORE_PROC, 13, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, {35, 1, 1, 15, MAIN_CORE_PROC, 15, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, {37, 1, 1, 17, MAIN_CORE_PROC, 17, -1}, + {38, 1, 1, 18, MAIN_CORE_PROC, 18, -1}, {39, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + }, + { + {"0,20", "0", "3000000"}, {"1,21", "0", "3000000"}, {"2,22", "0", "3000000"}, {"3,23", "0", "3000000"}, + {"4,24", "0", "3000000"}, {"5,25", "0", "3000000"}, {"6,26", "0", "3000000"}, {"7,27", "0", "3000000"}, + {"8,28", "0", "3000000"}, {"9,29", "0", "3000000"}, {"10,30", "1", "3000000"}, {"11,31", "1", "3000000"}, + {"12,32", "1", "3000000"}, {"13,33", "1", "3000000"}, {"14,34", "1", "3000000"}, {"15,35", "1", "3000000"}, + {"16,36", "1", "3000000"}, {"17,37", "1", "3000000"}, {"18,38", "1", "3000000"}, {"19,39", "1", "3000000"}, + {"0,20", "0", "3000000"}, {"1,21", "0", "3000000"}, {"2,22", "0", "3000000"}, {"3,23", "0", "3000000"}, + {"4,24", "0", "3000000"}, {"5,25", "0", "3000000"}, {"6,26", "0", "3000000"}, {"7,27", "0", "3000000"}, + {"8,28", "0", "3000000"}, {"9,29", "0", "3000000"}, {"10,30", "1", "3000000"}, {"11,31", "1", "3000000"}, + {"12,32", "1", "3000000"}, {"13,33", "1", "3000000"}, {"14,34", "1", "3000000"}, {"15,35", "1", "3000000"}, + {"16,36", "1", "3000000"}, {"17,37", "1", "3000000"}, {"18,38", "1", "3000000"}, {"19,39", "1", "3000000"}, + }, + {{"0-9,20-29"}, {"10-19,30-39"}}, +}; +LinuxCpuMapTestCase freq_2sockets_20cores_hyperthreading_1 = { + 40, + 2, + 2, + 20, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, {11, 1, 1, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 1, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 1, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 1, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {28, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {29, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, {31, 1, 1, 11, MAIN_CORE_PROC, 11, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, {33, 1, 1, 13, MAIN_CORE_PROC, 13, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, {35, 1, 1, 15, MAIN_CORE_PROC, 15, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, {37, 1, 1, 17, MAIN_CORE_PROC, 17, -1}, + {38, 1, 1, 18, MAIN_CORE_PROC, 18, -1}, {39, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + }, + { + {"0,20", "0", "3000000"}, {"1,21", "0", "3000000"}, {"2,22", "0", "3000000"}, {"3,23", "0", "3000000"}, + {"4,24", "0", "3000000"}, {"5,25", "0", "3000000"}, {"6,26", "0", "3000000"}, {"7,27", "0", "3000000"}, + {"8,28", "0", "3000000"}, {"9,29", "0", "3000000"}, {"10,30", "1", "3000000"}, {"11,31", "1", "3000000"}, + {"12,32", "1", "3000000"}, {"13,33", "1", "3000000"}, {"14,34", "1", "3000000"}, {"15,35", "1", "3000000"}, + {"16,36", "1", "3000000"}, {"17,37", "1", "3000000"}, {"18,38", "1", "3000000"}, {"19,39", "1", "3000000"}, + {"0,20", "0", "3000000"}, {"1,21", "0", "3000000"}, {"2,22", "0", "3000000"}, {"3,23", "0", "3000000"}, + {"4,24", "0", "3000000"}, {"5,25", "0", "3000000"}, {"6,26", "0", "3000000"}, {"7,27", "0", "3000000"}, + {"8,28", "0", "3000000"}, {"9,29", "0", "3000000"}, {"10,30", "1", "3000000"}, {"11,31", "1", "3000000"}, + {"12,32", "1", "3000000"}, {"13,33", "1", "3000000"}, {"14,34", "1", "3000000"}, {"15,35", "1", "3000000"}, + {"16,36", "1", "3000000"}, {"17,37", "1", "3000000"}, {"18,38", "1", "3000000"}, {"19,39", "1", "3000000"}, + }, + {}, +}; +LinuxCpuMapTestCase freq_2sockets_20cores = { + 20, + 2, + 2, + 20, + {{20, 20, 0, 0, -1, -1}, {10, 10, 0, 0, 0, 0}, {10, 10, 0, 0, 1, 1}}, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, {11, 1, 1, 11, MAIN_CORE_PROC, 11, -1}, + {12, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, {13, 1, 1, 13, MAIN_CORE_PROC, 13, -1}, + {14, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, {15, 1, 1, 15, MAIN_CORE_PROC, 15, -1}, + {16, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, {17, 1, 1, 17, MAIN_CORE_PROC, 17, -1}, + {18, 1, 1, 18, MAIN_CORE_PROC, 18, -1}, {19, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + }, + { + {"0", "0", "3000000"}, {"1", "0", "3000000"}, {"2", "0", "3000000"}, {"3", "0", "3000000"}, + {"4", "0", "3000000"}, {"5", "0", "3000000"}, {"6", "0", "3000000"}, {"7", "0", "3000000"}, + {"8", "0", "3000000"}, {"9", "0", "3000000"}, {"10", "1", "3000000"}, {"11", "1", "3000000"}, + {"12", "1", "3000000"}, {"13", "1", "3000000"}, {"14", "1", "3000000"}, {"15", "1", "3000000"}, + {"16", "1", "3000000"}, {"17", "1", "3000000"}, {"18", "1", "3000000"}, {"19", "1", "3000000"}, + }, + {{"0-9"}, {"10-19"}}, +}; +LinuxCpuMapTestCase freq_1sockets_32cores_hyperthreading = { + 64, + 1, + 1, + 32, + {{64, 32, 0, 32, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 0, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 0, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 0, 0, 24, HYPER_THREADING_PROC, 24, -1}, {25, 0, 0, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 0, 0, 26, HYPER_THREADING_PROC, 26, -1}, {27, 0, 0, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 0, 0, 28, HYPER_THREADING_PROC, 28, -1}, {29, 0, 0, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 0, 0, 30, HYPER_THREADING_PROC, 30, -1}, {31, 0, 0, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {33, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {34, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {35, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {36, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {37, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {38, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {39, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {40, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {41, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {42, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {43, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {44, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {45, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {46, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {47, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {48, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {49, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {50, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {51, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {52, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {53, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {54, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {55, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {56, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, {57, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {58, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, {59, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {60, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, {61, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {62, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, {63, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + }, + { + {"0,32", "0", "3400000"}, {"1,33", "0", "3400000"}, {"2,34", "0", "3400000"}, {"3,35", "0", "3400000"}, + {"4,36", "0", "3400000"}, {"5,37", "0", "3400000"}, {"6,38", "0", "3400000"}, {"7,39", "0", "3400000"}, + {"8,40", "0", "3400000"}, {"9,41", "0", "3400000"}, {"10,42", "0", "3400000"}, {"11,43", "0", "3400000"}, + {"12,44", "0", "3400000"}, {"13,45", "0", "3400000"}, {"14,46", "0", "3400000"}, {"15,47", "0", "3400000"}, + {"16,48", "0", "3400000"}, {"17,49", "0", "3400000"}, {"18,50", "0", "3400000"}, {"19,51", "0", "3400000"}, + {"20,52", "0", "3400000"}, {"21,53", "0", "3400000"}, {"22,54", "0", "3400000"}, {"23,55", "0", "3400000"}, + {"24,56", "0", "3400000"}, {"25,57", "0", "3400000"}, {"26,58", "0", "3400000"}, {"27,59", "0", "3400000"}, + {"28,60", "0", "3400000"}, {"29,61", "0", "3400000"}, {"30,62", "0", "3400000"}, {"31,63", "0", "3400000"}, + {"0,32", "0", "3400000"}, {"1,33", "0", "3400000"}, {"2,34", "0", "3400000"}, {"3,35", "0", "3400000"}, + {"4,36", "0", "3400000"}, {"5,37", "0", "3400000"}, {"6,38", "0", "3400000"}, {"7,39", "0", "3400000"}, + {"8,40", "0", "3400000"}, {"9,41", "0", "3400000"}, {"10,42", "0", "3400000"}, {"11,43", "0", "3400000"}, + {"12,44", "0", "3400000"}, {"13,45", "0", "3400000"}, {"14,46", "0", "3400000"}, {"15,47", "0", "3400000"}, + {"16,48", "0", "3400000"}, {"17,49", "0", "3400000"}, {"18,50", "0", "3400000"}, {"19,51", "0", "3400000"}, + {"20,52", "0", "3400000"}, {"21,53", "0", "3400000"}, {"22,54", "0", "3400000"}, {"23,55", "0", "3400000"}, + {"24,56", "0", "3400000"}, {"25,57", "0", "3400000"}, {"26,58", "0", "3400000"}, {"27,59", "0", "3400000"}, + {"28,60", "0", "3400000"}, {"29,61", "0", "3400000"}, {"30,62", "0", "3400000"}, {"31,63", "0", "3400000"}, + }, + {{"0-63"}}, +}; +LinuxCpuMapTestCase freq_1sockets_16cores_hyperthreading = { + 24, + 1, + 1, + 16, + {{24, 8, 8, 8, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 12, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 13, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 14, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 15, -1}, + }, + { + {"0-1", "0", "5376760"}, {"0-1", "0", "5376760"}, {"2-3", "0", "5376760"}, {"2-3", "0", "5376760"}, + {"4-5", "0", "5376760"}, {"4-5", "0", "5376760"}, {"6-7", "0", "5376760"}, {"6-7", "0", "5376760"}, + {"8-9", "0", "5400000"}, {"8-9", "0", "5400000"}, {"10-11", "0", "5400000"}, {"10-11", "0", "5400000"}, + {"12-13", "0", "5376760"}, {"12-13", "0", "5376760"}, {"14-15", "0", "5376760"}, {"14-15", "0", "5376760"}, + {"16", "0", "4200000"}, {"17", "0", "4200000"}, {"18", "0", "4200000"}, {"19", "0", "4200000"}, + {"20", "0", "4200000"}, {"21", "0", "4200000"}, {"22", "0", "4200000"}, {"23", "0", "4200000"}, + }, + {}, +}; +LinuxCpuMapTestCase freq_1sockets_16cores = { + 16, + 1, + 1, + 16, + {{16, 8, 8, 0, 0, 0}}, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {9, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {10, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {11, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {12, 0, 0, 12, EFFICIENT_CORE_PROC, 12, -1}, + {13, 0, 0, 13, EFFICIENT_CORE_PROC, 13, -1}, + {14, 0, 0, 14, EFFICIENT_CORE_PROC, 14, -1}, + {15, 0, 0, 15, EFFICIENT_CORE_PROC, 15, -1}, + }, + { + {"0", "0", "5376760"}, + {"1", "0", "5376760"}, + {"2", "0", "5376760"}, + {"3", "0", "5376760"}, + {"4", "0", "5400000"}, + {"5", "0", "5400000"}, + {"6", "0", "5376760"}, + {"7", "0", "5376760"}, + {"8", "0", "4200000"}, + {"9", "0", "4200000"}, + {"10", "0", "4200000"}, + {"11", "0", "4200000"}, + {"12", "0", "4200000"}, + {"13", "0", "4200000"}, + {"14", "0", "4200000"}, + {"15", "0", "4200000"}, + }, + {{"0-15"}}, +}; +LinuxCpuMapTestCase freq_1sockets_16cores_1_hyperthreading = { + 22, + 1, + 1, + 16, + {{22, 6, 10, 6, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 0, 7, EFFICIENT_CORE_PROC, 7, -1}, + {14, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {15, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {16, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, {17, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {18, 0, 0, 12, EFFICIENT_CORE_PROC, 12, -1}, {19, 0, 0, 13, EFFICIENT_CORE_PROC, 13, -1}, + {20, 0, 0, 14, EFFICIENT_CORE_PROC, 14, -1}, {21, 0, 0, 15, EFFICIENT_CORE_PROC, 15, -1}, + }, + { + {"0-1", "2", "3200040"}, {"0-1", "2", "3200040"}, {"2-3", "3", "3200040"}, {"2-3", "3", "3200040"}, + {"4-5", "4", "3200040"}, {"4-5", "4", "3200040"}, {"6-7", "5", "3200040"}, {"6-7", "5", "3200040"}, + {"8-9", "6", "3200040"}, {"8-9", "6", "3200040"}, {"10-11", "7", "3200040"}, {"10-11", "7", "3200040"}, + {"12", "0", "3100000"}, {"13", "0", "3100000"}, {"14", "0", "3100000"}, {"15", "0", "3100000"}, + {"16", "1", "3100000"}, {"17", "1", "3100000"}, {"18", "1", "3100000"}, {"19", "1", "3100000"}, + {"20", "8", "1600011"}, {"21", "8", "1600011"}, + }, + {}, +}; +LinuxCpuMapTestCase freq_1sockets_12cores_hyperthreading = { + 14, + 1, + 1, + 12, + {{14, 2, 10, 2, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, EFFICIENT_CORE_PROC, 2, -1}, + {5, 0, 0, 3, EFFICIENT_CORE_PROC, 3, -1}, + {6, 0, 0, 4, EFFICIENT_CORE_PROC, 4, -1}, + {7, 0, 0, 5, EFFICIENT_CORE_PROC, 5, -1}, + {8, 0, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, + {9, 0, 0, 7, EFFICIENT_CORE_PROC, 7, -1}, + {10, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {11, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {12, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {13, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + }, + { + {"0-1", "2", "4100000"}, + {"0-1", "2", "4100000"}, + {"2-3", "3", "4100000"}, + {"2-3", "3", "4100000"}, + {"4", "0", "3100000"}, + {"5", "0", "3100000"}, + {"6", "0", "3100000"}, + {"7", "0", "3100000"}, + {"8", "1", "3100000"}, + {"9", "1", "3100000"}, + {"10", "1", "3100000"}, + {"11", "1", "3100000"}, + {"12", "8", "2100000"}, + {"13", "8", "2100000"}, + }, + {{"0-13"}}, +}; +LinuxCpuMapTestCase freq_1sockets_8cores_hyperthreading = { + 16, + 1, + 1, + 8, + {{16, 8, 0, 8, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {13, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + }, + { + {"0-1", "0", "6100000"}, + {"0-1", "0", "6100000"}, + {"2-3", "0", "6100000"}, + {"2-3", "0", "6100000"}, + {"4-5", "0", "6100000"}, + {"4-5", "0", "6100000"}, + {"6-7", "0", "6100000"}, + {"6-7", "0", "6100000"}, + {"8-9", "0", "6300000"}, + {"8-9", "0", "6300000"}, + {"10-11", "0", "6300000"}, + {"10-11", "0", "6300000"}, + {"12-13", "0", "6100000"}, + {"12-13", "0", "6100000"}, + {"14-15", "0", "6100000"}, + {"14-15", "0", "6100000"}, + }, + {}, +}; +LinuxCpuMapTestCase freq_1sockets_8cores_hyperthreading_1 = { + 16, + 1, + 1, + 8, + {{16, 8, 0, 8, 0, 0}}, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {9, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {10, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {11, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {12, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {13, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {14, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + }, + { + {"0,8", "0", "4700000"}, + {"1,9", "0", "4800000"}, + {"2,10", "0", "4800000"}, + {"3,11", "0", "4700000"}, + {"4,12", "0", "4700000"}, + {"5,13", "0", "4700000"}, + {"6,14", "0", "4700000"}, + {"7,15", "0", "4700000"}, + {"0,8", "0", "4700000"}, + {"1,9", "0", "4800000"}, + {"2,10", "0", "4800000"}, + {"3,11", "0", "4700000"}, + {"4,12", "0", "4700000"}, + {"5,13", "0", "4700000"}, + {"6,14", "0", "4700000"}, + {"7,15", "0", "4700000"}, + }, + {{"0-15"}}, +}; +LinuxCpuMapTestCase freq_1sockets_4cores = { + 4, + 1, + 1, + 4, + {{4, 4, 0, 0, 0, 0}}, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + }, + { + {"0", "0", "1800000"}, + {"1", "0", "1800000"}, + {"2", "0", "1800000"}, + {"3", "0", "1800000"}, + }, + {}, +}; + +TEST_P(LinuxCpuMapFreqParserTests, LinuxFreq) {} + +INSTANTIATE_TEST_SUITE_P(CPUMap, + LinuxCpuMapFreqParserTests, + testing::Values(freq_2sockets_112cores_hyperthreading, + freq_2sockets_48cores_hyperthreading, + freq_2sockets_48cores_hyperthreading_1, + freq_2sockets_24cores_hyperthreading, + freq_2sockets_24cores_hyperthreading_1, + freq_2sockets_20cores_hyperthreading, + freq_2sockets_20cores_hyperthreading_1, + freq_2sockets_20cores, + freq_1sockets_32cores_hyperthreading, + freq_1sockets_16cores_hyperthreading, + freq_1sockets_16cores, + freq_1sockets_16cores_1_hyperthreading, + freq_1sockets_12cores_hyperthreading, + freq_1sockets_8cores_hyperthreading, + freq_1sockets_8cores_hyperthreading_1, + freq_1sockets_4cores)); + +#endif +} // namespace \ No newline at end of file diff --git a/src/inference/tests/unit/cpu_map_parser.cpp b/src/inference/tests/unit/cpu_map_parser/parser_windows.cpp similarity index 62% rename from src/inference/tests/unit/cpu_map_parser.cpp rename to src/inference/tests/unit/cpu_map_parser/parser_windows.cpp index 06ade186b39..3898e5839f9 100644 --- a/src/inference/tests/unit/cpu_map_parser.cpp +++ b/src/inference/tests/unit/cpu_map_parser/parser_windows.cpp @@ -7,1300 +7,13 @@ #include #include "ie_system_conf.h" -#include "streams_executor.hpp" +#include "os/cpu_map_info.hpp" using namespace testing; using namespace ov; namespace { -#ifdef __linux__ - -struct LinuxCpuMapTestCase { - int _processors; - int _sockets; - int _cores; - std::vector> _proc_type_table; - std::vector> _cpu_mapping_table; - std::vector> system_info_table; -}; - -class LinuxCpuMapCacheParserTests : public CommonTestUtils::TestsCommon, - public testing::WithParamInterface> { -public: - void SetUp() override { - const auto& test_data = std::get<0>(GetParam()); - - int test_processors = 0; - int test_sockets = 0; - int test_cores = 0; - std::vector> test_proc_type_table; - std::vector> test_cpu_mapping_table; - - ov::parse_cache_info_linux(test_data.system_info_table, - test_processors, - test_sockets, - test_cores, - test_proc_type_table, - test_cpu_mapping_table); - - ASSERT_EQ(test_data._processors, test_processors); - ASSERT_EQ(test_data._sockets, test_sockets); - ASSERT_EQ(test_data._cores, test_cores); - ASSERT_EQ(test_data._proc_type_table, test_proc_type_table); - ASSERT_EQ(test_data._cpu_mapping_table, test_cpu_mapping_table); - } -}; - -class LinuxGetCpuMapFromCoresTests : public CommonTestUtils::TestsCommon, - public testing::WithParamInterface> { -public: - void SetUp() override { - const auto& test_data = std::get<0>(GetParam()); - - std::vector> test_proc_type_table; - std::vector> test_cpu_mapping_table; - - ov::get_cpu_mapping_from_cores(test_data._processors, - test_data._sockets, - test_data._cores, - test_proc_type_table, - test_cpu_mapping_table); - - ASSERT_EQ(test_data._proc_type_table, test_proc_type_table); - ASSERT_EQ(test_data._cpu_mapping_table, test_cpu_mapping_table); - } -}; - -LinuxCpuMapTestCase cache_2sockets_104cores_hyperthreading = { - 208, - 2, - 104, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 9, HYPER_THREADING_PROC, 9, -1}, - {10, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 11, HYPER_THREADING_PROC, 11, -1}, - {12, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 13, HYPER_THREADING_PROC, 13, -1}, - {14, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 15, HYPER_THREADING_PROC, 15, -1}, - {16, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 17, HYPER_THREADING_PROC, 17, -1}, - {18, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 19, HYPER_THREADING_PROC, 19, -1}, - {20, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 21, HYPER_THREADING_PROC, 21, -1}, - {22, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 23, HYPER_THREADING_PROC, 23, -1}, - {24, 0, 24, HYPER_THREADING_PROC, 24, -1}, {25, 0, 25, HYPER_THREADING_PROC, 25, -1}, - {26, 0, 26, HYPER_THREADING_PROC, 26, -1}, {27, 0, 27, HYPER_THREADING_PROC, 27, -1}, - {28, 0, 28, HYPER_THREADING_PROC, 28, -1}, {29, 0, 29, HYPER_THREADING_PROC, 29, -1}, - {30, 0, 30, HYPER_THREADING_PROC, 30, -1}, {31, 0, 31, HYPER_THREADING_PROC, 31, -1}, - {32, 0, 32, HYPER_THREADING_PROC, 32, -1}, {33, 0, 33, HYPER_THREADING_PROC, 33, -1}, - {34, 0, 34, HYPER_THREADING_PROC, 34, -1}, {35, 0, 35, HYPER_THREADING_PROC, 35, -1}, - {36, 0, 36, HYPER_THREADING_PROC, 36, -1}, {37, 0, 37, HYPER_THREADING_PROC, 37, -1}, - {38, 0, 38, HYPER_THREADING_PROC, 38, -1}, {39, 0, 39, HYPER_THREADING_PROC, 39, -1}, - {40, 0, 40, HYPER_THREADING_PROC, 40, -1}, {41, 0, 41, HYPER_THREADING_PROC, 41, -1}, - {42, 0, 42, HYPER_THREADING_PROC, 42, -1}, {43, 0, 43, HYPER_THREADING_PROC, 43, -1}, - {44, 0, 44, HYPER_THREADING_PROC, 44, -1}, {45, 0, 45, HYPER_THREADING_PROC, 45, -1}, - {46, 0, 46, HYPER_THREADING_PROC, 46, -1}, {47, 0, 47, HYPER_THREADING_PROC, 47, -1}, - {48, 0, 48, HYPER_THREADING_PROC, 48, -1}, {49, 0, 49, HYPER_THREADING_PROC, 49, -1}, - {50, 0, 50, HYPER_THREADING_PROC, 50, -1}, {51, 0, 51, HYPER_THREADING_PROC, 51, -1}, - {52, 1, 52, HYPER_THREADING_PROC, 52, -1}, {53, 1, 53, HYPER_THREADING_PROC, 53, -1}, - {54, 1, 54, HYPER_THREADING_PROC, 54, -1}, {55, 1, 55, HYPER_THREADING_PROC, 55, -1}, - {56, 1, 56, HYPER_THREADING_PROC, 56, -1}, {57, 1, 57, HYPER_THREADING_PROC, 57, -1}, - {58, 1, 58, HYPER_THREADING_PROC, 58, -1}, {59, 1, 59, HYPER_THREADING_PROC, 59, -1}, - {60, 1, 60, HYPER_THREADING_PROC, 60, -1}, {61, 1, 61, HYPER_THREADING_PROC, 61, -1}, - {62, 1, 62, HYPER_THREADING_PROC, 62, -1}, {63, 1, 63, HYPER_THREADING_PROC, 63, -1}, - {64, 1, 64, HYPER_THREADING_PROC, 64, -1}, {65, 1, 65, HYPER_THREADING_PROC, 65, -1}, - {66, 1, 66, HYPER_THREADING_PROC, 66, -1}, {67, 1, 67, HYPER_THREADING_PROC, 67, -1}, - {68, 1, 68, HYPER_THREADING_PROC, 68, -1}, {69, 1, 69, HYPER_THREADING_PROC, 69, -1}, - {70, 1, 70, HYPER_THREADING_PROC, 70, -1}, {71, 1, 71, HYPER_THREADING_PROC, 71, -1}, - {72, 1, 72, HYPER_THREADING_PROC, 72, -1}, {73, 1, 73, HYPER_THREADING_PROC, 73, -1}, - {74, 1, 74, HYPER_THREADING_PROC, 74, -1}, {75, 1, 75, HYPER_THREADING_PROC, 75, -1}, - {76, 1, 76, HYPER_THREADING_PROC, 76, -1}, {77, 1, 77, HYPER_THREADING_PROC, 77, -1}, - {78, 1, 78, HYPER_THREADING_PROC, 78, -1}, {79, 1, 79, HYPER_THREADING_PROC, 79, -1}, - {80, 1, 80, HYPER_THREADING_PROC, 80, -1}, {81, 1, 81, HYPER_THREADING_PROC, 81, -1}, - {82, 1, 82, HYPER_THREADING_PROC, 82, -1}, {83, 1, 83, HYPER_THREADING_PROC, 83, -1}, - {84, 1, 84, HYPER_THREADING_PROC, 84, -1}, {85, 1, 85, HYPER_THREADING_PROC, 85, -1}, - {86, 1, 86, HYPER_THREADING_PROC, 86, -1}, {87, 1, 87, HYPER_THREADING_PROC, 87, -1}, - {88, 1, 88, HYPER_THREADING_PROC, 88, -1}, {89, 1, 89, HYPER_THREADING_PROC, 89, -1}, - {90, 1, 90, HYPER_THREADING_PROC, 90, -1}, {91, 1, 91, HYPER_THREADING_PROC, 91, -1}, - {92, 1, 92, HYPER_THREADING_PROC, 92, -1}, {93, 1, 93, HYPER_THREADING_PROC, 93, -1}, - {94, 1, 94, HYPER_THREADING_PROC, 94, -1}, {95, 1, 95, HYPER_THREADING_PROC, 95, -1}, - {96, 1, 96, HYPER_THREADING_PROC, 96, -1}, {97, 1, 97, HYPER_THREADING_PROC, 97, -1}, - {98, 1, 98, HYPER_THREADING_PROC, 98, -1}, {99, 1, 99, HYPER_THREADING_PROC, 99, -1}, - {100, 1, 100, HYPER_THREADING_PROC, 100, -1}, {101, 1, 101, HYPER_THREADING_PROC, 101, -1}, - {102, 1, 102, HYPER_THREADING_PROC, 102, -1}, {103, 1, 103, HYPER_THREADING_PROC, 103, -1}, - {104, 0, 0, MAIN_CORE_PROC, 0, -1}, {105, 0, 1, MAIN_CORE_PROC, 1, -1}, - {106, 0, 2, MAIN_CORE_PROC, 2, -1}, {107, 0, 3, MAIN_CORE_PROC, 3, -1}, - {108, 0, 4, MAIN_CORE_PROC, 4, -1}, {109, 0, 5, MAIN_CORE_PROC, 5, -1}, - {110, 0, 6, MAIN_CORE_PROC, 6, -1}, {111, 0, 7, MAIN_CORE_PROC, 7, -1}, - {112, 0, 8, MAIN_CORE_PROC, 8, -1}, {113, 0, 9, MAIN_CORE_PROC, 9, -1}, - {114, 0, 10, MAIN_CORE_PROC, 10, -1}, {115, 0, 11, MAIN_CORE_PROC, 11, -1}, - {116, 0, 12, MAIN_CORE_PROC, 12, -1}, {117, 0, 13, MAIN_CORE_PROC, 13, -1}, - {118, 0, 14, MAIN_CORE_PROC, 14, -1}, {119, 0, 15, MAIN_CORE_PROC, 15, -1}, - {120, 0, 16, MAIN_CORE_PROC, 16, -1}, {121, 0, 17, MAIN_CORE_PROC, 17, -1}, - {122, 0, 18, MAIN_CORE_PROC, 18, -1}, {123, 0, 19, MAIN_CORE_PROC, 19, -1}, - {124, 0, 20, MAIN_CORE_PROC, 20, -1}, {125, 0, 21, MAIN_CORE_PROC, 21, -1}, - {126, 0, 22, MAIN_CORE_PROC, 22, -1}, {127, 0, 23, MAIN_CORE_PROC, 23, -1}, - {128, 0, 24, MAIN_CORE_PROC, 24, -1}, {129, 0, 25, MAIN_CORE_PROC, 25, -1}, - {130, 0, 26, MAIN_CORE_PROC, 26, -1}, {131, 0, 27, MAIN_CORE_PROC, 27, -1}, - {132, 0, 28, MAIN_CORE_PROC, 28, -1}, {133, 0, 29, MAIN_CORE_PROC, 29, -1}, - {134, 0, 30, MAIN_CORE_PROC, 30, -1}, {135, 0, 31, MAIN_CORE_PROC, 31, -1}, - {136, 0, 32, MAIN_CORE_PROC, 32, -1}, {137, 0, 33, MAIN_CORE_PROC, 33, -1}, - {138, 0, 34, MAIN_CORE_PROC, 34, -1}, {139, 0, 35, MAIN_CORE_PROC, 35, -1}, - {140, 0, 36, MAIN_CORE_PROC, 36, -1}, {141, 0, 37, MAIN_CORE_PROC, 37, -1}, - {142, 0, 38, MAIN_CORE_PROC, 38, -1}, {143, 0, 39, MAIN_CORE_PROC, 39, -1}, - {144, 0, 40, MAIN_CORE_PROC, 40, -1}, {145, 0, 41, MAIN_CORE_PROC, 41, -1}, - {146, 0, 42, MAIN_CORE_PROC, 42, -1}, {147, 0, 43, MAIN_CORE_PROC, 43, -1}, - {148, 0, 44, MAIN_CORE_PROC, 44, -1}, {149, 0, 45, MAIN_CORE_PROC, 45, -1}, - {150, 0, 46, MAIN_CORE_PROC, 46, -1}, {151, 0, 47, MAIN_CORE_PROC, 47, -1}, - {152, 0, 48, MAIN_CORE_PROC, 48, -1}, {153, 0, 49, MAIN_CORE_PROC, 49, -1}, - {154, 0, 50, MAIN_CORE_PROC, 50, -1}, {155, 0, 51, MAIN_CORE_PROC, 51, -1}, - {156, 1, 52, MAIN_CORE_PROC, 52, -1}, {157, 1, 53, MAIN_CORE_PROC, 53, -1}, - {158, 1, 54, MAIN_CORE_PROC, 54, -1}, {159, 1, 55, MAIN_CORE_PROC, 55, -1}, - {160, 1, 56, MAIN_CORE_PROC, 56, -1}, {161, 1, 57, MAIN_CORE_PROC, 57, -1}, - {162, 1, 58, MAIN_CORE_PROC, 58, -1}, {163, 1, 59, MAIN_CORE_PROC, 59, -1}, - {164, 1, 60, MAIN_CORE_PROC, 60, -1}, {165, 1, 61, MAIN_CORE_PROC, 61, -1}, - {166, 1, 62, MAIN_CORE_PROC, 62, -1}, {167, 1, 63, MAIN_CORE_PROC, 63, -1}, - {168, 1, 64, MAIN_CORE_PROC, 64, -1}, {169, 1, 65, MAIN_CORE_PROC, 65, -1}, - {170, 1, 66, MAIN_CORE_PROC, 66, -1}, {171, 1, 67, MAIN_CORE_PROC, 67, -1}, - {172, 1, 68, MAIN_CORE_PROC, 68, -1}, {173, 1, 69, MAIN_CORE_PROC, 69, -1}, - {174, 1, 70, MAIN_CORE_PROC, 70, -1}, {175, 1, 71, MAIN_CORE_PROC, 71, -1}, - {176, 1, 72, MAIN_CORE_PROC, 72, -1}, {177, 1, 73, MAIN_CORE_PROC, 73, -1}, - {178, 1, 74, MAIN_CORE_PROC, 74, -1}, {179, 1, 75, MAIN_CORE_PROC, 75, -1}, - {180, 1, 76, MAIN_CORE_PROC, 76, -1}, {181, 1, 77, MAIN_CORE_PROC, 77, -1}, - {182, 1, 78, MAIN_CORE_PROC, 78, -1}, {183, 1, 79, MAIN_CORE_PROC, 79, -1}, - {184, 1, 80, MAIN_CORE_PROC, 80, -1}, {185, 1, 81, MAIN_CORE_PROC, 81, -1}, - {186, 1, 82, MAIN_CORE_PROC, 82, -1}, {187, 1, 83, MAIN_CORE_PROC, 83, -1}, - {188, 1, 84, MAIN_CORE_PROC, 84, -1}, {189, 1, 85, MAIN_CORE_PROC, 85, -1}, - {190, 1, 86, MAIN_CORE_PROC, 86, -1}, {191, 1, 87, MAIN_CORE_PROC, 87, -1}, - {192, 1, 88, MAIN_CORE_PROC, 88, -1}, {193, 1, 89, MAIN_CORE_PROC, 89, -1}, - {194, 1, 90, MAIN_CORE_PROC, 90, -1}, {195, 1, 91, MAIN_CORE_PROC, 91, -1}, - {196, 1, 92, MAIN_CORE_PROC, 92, -1}, {197, 1, 93, MAIN_CORE_PROC, 93, -1}, - {198, 1, 94, MAIN_CORE_PROC, 94, -1}, {199, 1, 95, MAIN_CORE_PROC, 95, -1}, - {200, 1, 96, MAIN_CORE_PROC, 96, -1}, {201, 1, 97, MAIN_CORE_PROC, 97, -1}, - {202, 1, 98, MAIN_CORE_PROC, 98, -1}, {203, 1, 99, MAIN_CORE_PROC, 99, -1}, - {204, 1, 100, MAIN_CORE_PROC, 100, -1}, {205, 1, 101, MAIN_CORE_PROC, 101, -1}, - {206, 1, 102, MAIN_CORE_PROC, 102, -1}, {207, 1, 103, MAIN_CORE_PROC, 103, -1}, - }, - { - {{"0,104"}, {"0,104"}, {"0-51,104-155"}}, {{"1,105"}, {"1,105"}, {"0-51,104-155"}}, - {{"2,106"}, {"2,106"}, {"0-51,104-155"}}, {{"3,107"}, {"3,107"}, {"0-51,104-155"}}, - {{"4,108"}, {"4,108"}, {"0-51,104-155"}}, {{"5,109"}, {"5,109"}, {"0-51,104-155"}}, - {{"6,110"}, {"6,110"}, {"0-51,104-155"}}, {{"7,111"}, {"7,111"}, {"0-51,104-155"}}, - {{"8,112"}, {"8,112"}, {"0-51,104-155"}}, {{"9,113"}, {"9,113"}, {"0-51,104-155"}}, - {{"10,114"}, {"10,114"}, {"0-51,104-155"}}, {{"11,115"}, {"11,115"}, {"0-51,104-155"}}, - {{"12,116"}, {"12,116"}, {"0-51,104-155"}}, {{"13,117"}, {"13,117"}, {"0-51,104-155"}}, - {{"14,118"}, {"14,118"}, {"0-51,104-155"}}, {{"15,119"}, {"15,119"}, {"0-51,104-155"}}, - {{"16,120"}, {"16,120"}, {"0-51,104-155"}}, {{"17,121"}, {"17,121"}, {"0-51,104-155"}}, - {{"18,122"}, {"18,122"}, {"0-51,104-155"}}, {{"19,123"}, {"19,123"}, {"0-51,104-155"}}, - {{"20,124"}, {"20,124"}, {"0-51,104-155"}}, {{"21,125"}, {"21,125"}, {"0-51,104-155"}}, - {{"22,126"}, {"22,126"}, {"0-51,104-155"}}, {{"23,127"}, {"23,127"}, {"0-51,104-155"}}, - {{"24,128"}, {"24,128"}, {"0-51,104-155"}}, {{"25,129"}, {"25,129"}, {"0-51,104-155"}}, - {{"26,130"}, {"26,130"}, {"0-51,104-155"}}, {{"27,131"}, {"27,131"}, {"0-51,104-155"}}, - {{"28,132"}, {"28,132"}, {"0-51,104-155"}}, {{"29,133"}, {"29,133"}, {"0-51,104-155"}}, - {{"30,134"}, {"30,134"}, {"0-51,104-155"}}, {{"31,135"}, {"31,135"}, {"0-51,104-155"}}, - {{"32,136"}, {"32,136"}, {"0-51,104-155"}}, {{"33,137"}, {"33,137"}, {"0-51,104-155"}}, - {{"34,138"}, {"34,138"}, {"0-51,104-155"}}, {{"35,139"}, {"35,139"}, {"0-51,104-155"}}, - {{"36,140"}, {"36,140"}, {"0-51,104-155"}}, {{"37,141"}, {"37,141"}, {"0-51,104-155"}}, - {{"38,142"}, {"38,142"}, {"0-51,104-155"}}, {{"39,143"}, {"39,143"}, {"0-51,104-155"}}, - {{"40,144"}, {"40,144"}, {"0-51,104-155"}}, {{"41,145"}, {"41,145"}, {"0-51,104-155"}}, - {{"42,146"}, {"42,146"}, {"0-51,104-155"}}, {{"43,147"}, {"43,147"}, {"0-51,104-155"}}, - {{"44,148"}, {"44,148"}, {"0-51,104-155"}}, {{"45,149"}, {"45,149"}, {"0-51,104-155"}}, - {{"46,150"}, {"46,150"}, {"0-51,104-155"}}, {{"47,151"}, {"47,151"}, {"0-51,104-155"}}, - {{"48,152"}, {"48,152"}, {"0-51,104-155"}}, {{"49,153"}, {"49,153"}, {"0-51,104-155"}}, - {{"50,154"}, {"50,154"}, {"0-51,104-155"}}, {{"51,155"}, {"51,155"}, {"0-51,104-155"}}, - {{"52,156"}, {"52,156"}, {"52-103,156-207"}}, {{"53,157"}, {"53,157"}, {"52-103,156-207"}}, - {{"54,158"}, {"54,158"}, {"52-103,156-207"}}, {{"55,159"}, {"55,159"}, {"52-103,156-207"}}, - {{"56,160"}, {"56,160"}, {"52-103,156-207"}}, {{"57,161"}, {"57,161"}, {"52-103,156-207"}}, - {{"58,162"}, {"58,162"}, {"52-103,156-207"}}, {{"59,163"}, {"59,163"}, {"52-103,156-207"}}, - {{"60,164"}, {"60,164"}, {"52-103,156-207"}}, {{"61,165"}, {"61,165"}, {"52-103,156-207"}}, - {{"62,166"}, {"62,166"}, {"52-103,156-207"}}, {{"63,167"}, {"63,167"}, {"52-103,156-207"}}, - {{"64,168"}, {"64,168"}, {"52-103,156-207"}}, {{"65,169"}, {"65,169"}, {"52-103,156-207"}}, - {{"66,170"}, {"66,170"}, {"52-103,156-207"}}, {{"67,171"}, {"67,171"}, {"52-103,156-207"}}, - {{"68,172"}, {"68,172"}, {"52-103,156-207"}}, {{"69,173"}, {"69,173"}, {"52-103,156-207"}}, - {{"70,174"}, {"70,174"}, {"52-103,156-207"}}, {{"71,175"}, {"71,175"}, {"52-103,156-207"}}, - {{"72,176"}, {"72,176"}, {"52-103,156-207"}}, {{"73,177"}, {"73,177"}, {"52-103,156-207"}}, - {{"74,178"}, {"74,178"}, {"52-103,156-207"}}, {{"75,179"}, {"75,179"}, {"52-103,156-207"}}, - {{"76,180"}, {"76,180"}, {"52-103,156-207"}}, {{"77,181"}, {"77,181"}, {"52-103,156-207"}}, - {{"78,182"}, {"78,182"}, {"52-103,156-207"}}, {{"79,183"}, {"79,183"}, {"52-103,156-207"}}, - {{"80,184"}, {"80,184"}, {"52-103,156-207"}}, {{"81,185"}, {"81,185"}, {"52-103,156-207"}}, - {{"82,186"}, {"82,186"}, {"52-103,156-207"}}, {{"83,187"}, {"83,187"}, {"52-103,156-207"}}, - {{"84,188"}, {"84,188"}, {"52-103,156-207"}}, {{"85,189"}, {"85,189"}, {"52-103,156-207"}}, - {{"86,190"}, {"86,190"}, {"52-103,156-207"}}, {{"87,191"}, {"87,191"}, {"52-103,156-207"}}, - {{"88,192"}, {"88,192"}, {"52-103,156-207"}}, {{"89,193"}, {"89,193"}, {"52-103,156-207"}}, - {{"90,194"}, {"90,194"}, {"52-103,156-207"}}, {{"91,195"}, {"91,195"}, {"52-103,156-207"}}, - {{"92,196"}, {"92,196"}, {"52-103,156-207"}}, {{"93,197"}, {"93,197"}, {"52-103,156-207"}}, - {{"94,198"}, {"94,198"}, {"52-103,156-207"}}, {{"95,199"}, {"95,199"}, {"52-103,156-207"}}, - {{"96,200"}, {"96,200"}, {"52-103,156-207"}}, {{"97,201"}, {"97,201"}, {"52-103,156-207"}}, - {{"98,202"}, {"98,202"}, {"52-103,156-207"}}, {{"99,203"}, {"99,203"}, {"52-103,156-207"}}, - {{"100,204"}, {"100,204"}, {"52-103,156-207"}}, {{"101,205"}, {"101,205"}, {"52-103,156-207"}}, - {{"102,206"}, {"102,206"}, {"52-103,156-207"}}, {{"103,207"}, {"103,207"}, {"52-103,156-207"}}, - {{"0,104"}, {"0,104"}, {"0-51,104-155"}}, {{"1,105"}, {"1,105"}, {"0-51,104-155"}}, - {{"2,106"}, {"2,106"}, {"0-51,104-155"}}, {{"3,107"}, {"3,107"}, {"0-51,104-155"}}, - {{"4,108"}, {"4,108"}, {"0-51,104-155"}}, {{"5,109"}, {"5,109"}, {"0-51,104-155"}}, - {{"6,110"}, {"6,110"}, {"0-51,104-155"}}, {{"7,111"}, {"7,111"}, {"0-51,104-155"}}, - {{"8,112"}, {"8,112"}, {"0-51,104-155"}}, {{"9,113"}, {"9,113"}, {"0-51,104-155"}}, - {{"10,114"}, {"10,114"}, {"0-51,104-155"}}, {{"11,115"}, {"11,115"}, {"0-51,104-155"}}, - {{"12,116"}, {"12,116"}, {"0-51,104-155"}}, {{"13,117"}, {"13,117"}, {"0-51,104-155"}}, - {{"14,118"}, {"14,118"}, {"0-51,104-155"}}, {{"15,119"}, {"15,119"}, {"0-51,104-155"}}, - {{"16,120"}, {"16,120"}, {"0-51,104-155"}}, {{"17,121"}, {"17,121"}, {"0-51,104-155"}}, - {{"18,122"}, {"18,122"}, {"0-51,104-155"}}, {{"19,123"}, {"19,123"}, {"0-51,104-155"}}, - {{"20,124"}, {"20,124"}, {"0-51,104-155"}}, {{"21,125"}, {"21,125"}, {"0-51,104-155"}}, - {{"22,126"}, {"22,126"}, {"0-51,104-155"}}, {{"23,127"}, {"23,127"}, {"0-51,104-155"}}, - {{"24,128"}, {"24,128"}, {"0-51,104-155"}}, {{"25,129"}, {"25,129"}, {"0-51,104-155"}}, - {{"26,130"}, {"26,130"}, {"0-51,104-155"}}, {{"27,131"}, {"27,131"}, {"0-51,104-155"}}, - {{"28,132"}, {"28,132"}, {"0-51,104-155"}}, {{"29,133"}, {"29,133"}, {"0-51,104-155"}}, - {{"30,134"}, {"30,134"}, {"0-51,104-155"}}, {{"31,135"}, {"31,135"}, {"0-51,104-155"}}, - {{"32,136"}, {"32,136"}, {"0-51,104-155"}}, {{"33,137"}, {"33,137"}, {"0-51,104-155"}}, - {{"34,138"}, {"34,138"}, {"0-51,104-155"}}, {{"35,139"}, {"35,139"}, {"0-51,104-155"}}, - {{"36,140"}, {"36,140"}, {"0-51,104-155"}}, {{"37,141"}, {"37,141"}, {"0-51,104-155"}}, - {{"38,142"}, {"38,142"}, {"0-51,104-155"}}, {{"39,143"}, {"39,143"}, {"0-51,104-155"}}, - {{"40,144"}, {"40,144"}, {"0-51,104-155"}}, {{"41,145"}, {"41,145"}, {"0-51,104-155"}}, - {{"42,146"}, {"42,146"}, {"0-51,104-155"}}, {{"43,147"}, {"43,147"}, {"0-51,104-155"}}, - {{"44,148"}, {"44,148"}, {"0-51,104-155"}}, {{"45,149"}, {"45,149"}, {"0-51,104-155"}}, - {{"46,150"}, {"46,150"}, {"0-51,104-155"}}, {{"47,151"}, {"47,151"}, {"0-51,104-155"}}, - {{"48,152"}, {"48,152"}, {"0-51,104-155"}}, {{"49,153"}, {"49,153"}, {"0-51,104-155"}}, - {{"50,154"}, {"50,154"}, {"0-51,104-155"}}, {{"51,155"}, {"51,155"}, {"0-51,104-155"}}, - {{"52,156"}, {"52,156"}, {"52-103,156-207"}}, {{"53,157"}, {"53,157"}, {"52-103,156-207"}}, - {{"54,158"}, {"54,158"}, {"52-103,156-207"}}, {{"55,159"}, {"55,159"}, {"52-103,156-207"}}, - {{"56,160"}, {"56,160"}, {"52-103,156-207"}}, {{"57,161"}, {"57,161"}, {"52-103,156-207"}}, - {{"58,162"}, {"58,162"}, {"52-103,156-207"}}, {{"59,163"}, {"59,163"}, {"52-103,156-207"}}, - {{"60,164"}, {"60,164"}, {"52-103,156-207"}}, {{"61,165"}, {"61,165"}, {"52-103,156-207"}}, - {{"62,166"}, {"62,166"}, {"52-103,156-207"}}, {{"63,167"}, {"63,167"}, {"52-103,156-207"}}, - {{"64,168"}, {"64,168"}, {"52-103,156-207"}}, {{"65,169"}, {"65,169"}, {"52-103,156-207"}}, - {{"66,170"}, {"66,170"}, {"52-103,156-207"}}, {{"67,171"}, {"67,171"}, {"52-103,156-207"}}, - {{"68,172"}, {"68,172"}, {"52-103,156-207"}}, {{"69,173"}, {"69,173"}, {"52-103,156-207"}}, - {{"70,174"}, {"70,174"}, {"52-103,156-207"}}, {{"71,175"}, {"71,175"}, {"52-103,156-207"}}, - {{"72,176"}, {"72,176"}, {"52-103,156-207"}}, {{"73,177"}, {"73,177"}, {"52-103,156-207"}}, - {{"74,178"}, {"74,178"}, {"52-103,156-207"}}, {{"75,179"}, {"75,179"}, {"52-103,156-207"}}, - {{"76,180"}, {"76,180"}, {"52-103,156-207"}}, {{"77,181"}, {"77,181"}, {"52-103,156-207"}}, - {{"78,182"}, {"78,182"}, {"52-103,156-207"}}, {{"79,183"}, {"79,183"}, {"52-103,156-207"}}, - {{"80,184"}, {"80,184"}, {"52-103,156-207"}}, {{"81,185"}, {"81,185"}, {"52-103,156-207"}}, - {{"82,186"}, {"82,186"}, {"52-103,156-207"}}, {{"83,187"}, {"83,187"}, {"52-103,156-207"}}, - {{"84,188"}, {"84,188"}, {"52-103,156-207"}}, {{"85,189"}, {"85,189"}, {"52-103,156-207"}}, - {{"86,190"}, {"86,190"}, {"52-103,156-207"}}, {{"87,191"}, {"87,191"}, {"52-103,156-207"}}, - {{"88,192"}, {"88,192"}, {"52-103,156-207"}}, {{"89,193"}, {"89,193"}, {"52-103,156-207"}}, - {{"90,194"}, {"90,194"}, {"52-103,156-207"}}, {{"91,195"}, {"91,195"}, {"52-103,156-207"}}, - {{"92,196"}, {"92,196"}, {"52-103,156-207"}}, {{"93,197"}, {"93,197"}, {"52-103,156-207"}}, - {{"94,198"}, {"94,198"}, {"52-103,156-207"}}, {{"95,199"}, {"95,199"}, {"52-103,156-207"}}, - {{"96,200"}, {"96,200"}, {"52-103,156-207"}}, {{"97,201"}, {"97,201"}, {"52-103,156-207"}}, - {{"98,202"}, {"98,202"}, {"52-103,156-207"}}, {{"99,203"}, {"99,203"}, {"52-103,156-207"}}, - {{"100,204"}, {"100,204"}, {"52-103,156-207"}}, {{"101,205"}, {"101,205"}, {"52-103,156-207"}}, - {{"102,206"}, {"102,206"}, {"52-103,156-207"}}, {{"103,207"}, {"103,207"}, {"52-103,156-207"}}, - }, -}; -LinuxCpuMapTestCase cache_2sockets_24cores_hyperthreading = { - 48, - 2, - 24, - {{48, 24, 0, 24}, {24, 12, 0, 12}, {24, 12, 0, 12}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 1, 12, HYPER_THREADING_PROC, 12, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 1, 13, HYPER_THREADING_PROC, 13, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 1, 14, HYPER_THREADING_PROC, 14, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 1, 15, HYPER_THREADING_PROC, 15, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 1, 16, HYPER_THREADING_PROC, 16, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 1, 17, HYPER_THREADING_PROC, 17, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 1, 18, HYPER_THREADING_PROC, 18, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 1, 19, HYPER_THREADING_PROC, 19, -1}, - {16, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 1, 20, HYPER_THREADING_PROC, 20, -1}, - {18, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 1, 21, HYPER_THREADING_PROC, 21, -1}, - {20, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 1, 22, HYPER_THREADING_PROC, 22, -1}, - {22, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 1, 23, HYPER_THREADING_PROC, 23, -1}, - {24, 0, 0, MAIN_CORE_PROC, 0, -1}, {25, 1, 12, MAIN_CORE_PROC, 12, -1}, - {26, 0, 1, MAIN_CORE_PROC, 1, -1}, {27, 1, 13, MAIN_CORE_PROC, 13, -1}, - {28, 0, 2, MAIN_CORE_PROC, 2, -1}, {29, 1, 14, MAIN_CORE_PROC, 14, -1}, - {30, 0, 3, MAIN_CORE_PROC, 3, -1}, {31, 1, 15, MAIN_CORE_PROC, 15, -1}, - {32, 0, 4, MAIN_CORE_PROC, 4, -1}, {33, 1, 16, MAIN_CORE_PROC, 16, -1}, - {34, 0, 5, MAIN_CORE_PROC, 5, -1}, {35, 1, 17, MAIN_CORE_PROC, 17, -1}, - {36, 0, 6, MAIN_CORE_PROC, 6, -1}, {37, 1, 18, MAIN_CORE_PROC, 18, -1}, - {38, 0, 7, MAIN_CORE_PROC, 7, -1}, {39, 1, 19, MAIN_CORE_PROC, 19, -1}, - {40, 0, 8, MAIN_CORE_PROC, 8, -1}, {41, 1, 20, MAIN_CORE_PROC, 20, -1}, - {42, 0, 9, MAIN_CORE_PROC, 9, -1}, {43, 1, 21, MAIN_CORE_PROC, 21, -1}, - {44, 0, 10, MAIN_CORE_PROC, 10, -1}, {45, 1, 22, MAIN_CORE_PROC, 22, -1}, - {46, 0, 11, MAIN_CORE_PROC, 11, -1}, {47, 1, 23, MAIN_CORE_PROC, 23, -1}, - }, - { - {{"0,24"}, {"0,24"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"1,25"}, {"1,25"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"2,26"}, {"2,26"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"3,27"}, {"3,27"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"4,28"}, {"4,28"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"5,29"}, {"5,29"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"6,30"}, {"6,30"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"7,31"}, {"7,31"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"8,32"}, {"8,32"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"9,33"}, {"9,33"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"10,34"}, {"10,34"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"11,35"}, {"11,35"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"12,36"}, {"12,36"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"13,37"}, {"13,37"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"14,38"}, {"14,38"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"15,39"}, {"15,39"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"16,40"}, {"16,40"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"17,41"}, {"17,41"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"18,42"}, {"18,42"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"19,43"}, {"19,43"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"20,44"}, {"20,44"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"21,45"}, {"21,45"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"22,46"}, {"22,46"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"23,47"}, {"23,47"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"0,24"}, {"0,24"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"1,25"}, {"1,25"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"2,26"}, {"2,26"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"3,27"}, {"3,27"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"4,28"}, {"4,28"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"5,29"}, {"5,29"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"6,30"}, {"6,30"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"7,31"}, {"7,31"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"8,32"}, {"8,32"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"9,33"}, {"9,33"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"10,34"}, {"10,34"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"11,35"}, {"11,35"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"12,36"}, {"12,36"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"13,37"}, {"13,37"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"14,38"}, {"14,38"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"15,39"}, {"15,39"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"16,40"}, {"16,40"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"17,41"}, {"17,41"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"18,42"}, {"18,42"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"19,43"}, {"19,43"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"20,44"}, {"20,44"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"21,45"}, {"21,45"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - {{"22,46"}, {"22,46"}, {"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46"}}, - {{"23,47"}, {"23,47"}, {"1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47"}}, - }, -}; -LinuxCpuMapTestCase cache_2sockets_48cores = { - 48, - 2, - 48, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, - { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 1, MAIN_CORE_PROC, 1, -1}, {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {3, 0, 3, MAIN_CORE_PROC, 3, -1}, {4, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 5, MAIN_CORE_PROC, 5, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 7, MAIN_CORE_PROC, 7, -1}, {8, 0, 8, MAIN_CORE_PROC, 8, -1}, - {9, 0, 9, MAIN_CORE_PROC, 9, -1}, {10, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 11, MAIN_CORE_PROC, 11, -1}, - {12, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 13, MAIN_CORE_PROC, 13, -1}, {14, 0, 14, MAIN_CORE_PROC, 14, -1}, - {15, 0, 15, MAIN_CORE_PROC, 15, -1}, {16, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 17, MAIN_CORE_PROC, 17, -1}, - {18, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 19, MAIN_CORE_PROC, 19, -1}, {20, 0, 20, MAIN_CORE_PROC, 20, -1}, - {21, 0, 21, MAIN_CORE_PROC, 21, -1}, {22, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 23, MAIN_CORE_PROC, 23, -1}, - {24, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 25, MAIN_CORE_PROC, 25, -1}, {26, 1, 26, MAIN_CORE_PROC, 26, -1}, - {27, 1, 27, MAIN_CORE_PROC, 27, -1}, {28, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 29, MAIN_CORE_PROC, 29, -1}, - {30, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 31, MAIN_CORE_PROC, 31, -1}, {32, 1, 32, MAIN_CORE_PROC, 32, -1}, - {33, 1, 33, MAIN_CORE_PROC, 33, -1}, {34, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 35, MAIN_CORE_PROC, 35, -1}, - {36, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 37, MAIN_CORE_PROC, 37, -1}, {38, 1, 38, MAIN_CORE_PROC, 38, -1}, - {39, 1, 39, MAIN_CORE_PROC, 39, -1}, {40, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 41, MAIN_CORE_PROC, 41, -1}, - {42, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 43, MAIN_CORE_PROC, 43, -1}, {44, 1, 44, MAIN_CORE_PROC, 44, -1}, - {45, 1, 45, MAIN_CORE_PROC, 45, -1}, {46, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 47, MAIN_CORE_PROC, 47, -1}, - }, - { - {{"0"}, {"0"}, {"0-23"}}, {{"1"}, {"1"}, {"0-23"}}, {{"2"}, {"2"}, {"0-23"}}, - {{"3"}, {"3"}, {"0-23"}}, {{"4"}, {"4"}, {"0-23"}}, {{"5"}, {"5"}, {"0-23"}}, - {{"6"}, {"6"}, {"0-23"}}, {{"7"}, {"7"}, {"0-23"}}, {{"8"}, {"8"}, {"0-23"}}, - {{"9"}, {"9"}, {"0-23"}}, {{"10"}, {"10"}, {"0-23"}}, {{"11"}, {"11"}, {"0-23"}}, - {{"12"}, {"12"}, {"0-23"}}, {{"13"}, {"13"}, {"0-23"}}, {{"14"}, {"14"}, {"0-23"}}, - {{"15"}, {"15"}, {"0-23"}}, {{"16"}, {"16"}, {"0-23"}}, {{"17"}, {"17"}, {"0-23"}}, - {{"18"}, {"18"}, {"0-23"}}, {{"19"}, {"19"}, {"0-23"}}, {{"20"}, {"20"}, {"0-23"}}, - {{"21"}, {"21"}, {"0-23"}}, {{"22"}, {"22"}, {"0-23"}}, {{"23"}, {"23"}, {"0-23"}}, - {{"24"}, {"24"}, {"24-47"}}, {{"25"}, {"25"}, {"24-47"}}, {{"26"}, {"26"}, {"24-47"}}, - {{"27"}, {"27"}, {"24-47"}}, {{"28"}, {"28"}, {"24-47"}}, {{"29"}, {"29"}, {"24-47"}}, - {{"30"}, {"30"}, {"24-47"}}, {{"31"}, {"31"}, {"24-47"}}, {{"32"}, {"32"}, {"24-47"}}, - {{"33"}, {"33"}, {"24-47"}}, {{"34"}, {"34"}, {"24-47"}}, {{"35"}, {"35"}, {"24-47"}}, - {{"36"}, {"36"}, {"24-47"}}, {{"37"}, {"37"}, {"24-47"}}, {{"38"}, {"38"}, {"24-47"}}, - {{"39"}, {"39"}, {"24-47"}}, {{"40"}, {"40"}, {"24-47"}}, {{"41"}, {"41"}, {"24-47"}}, - {{"42"}, {"42"}, {"24-47"}}, {{"43"}, {"43"}, {"24-47"}}, {{"44"}, {"44"}, {"24-47"}}, - {{"45"}, {"45"}, {"24-47"}}, {{"46"}, {"46"}, {"24-47"}}, {{"47"}, {"47"}, {"24-47"}}, - }, -}; -LinuxCpuMapTestCase cache_2sockets_20cores_hyperthreading = { - 40, - 2, - 20, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 9, HYPER_THREADING_PROC, 9, -1}, - {10, 1, 10, HYPER_THREADING_PROC, 10, -1}, {11, 1, 11, HYPER_THREADING_PROC, 11, -1}, - {12, 1, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 13, HYPER_THREADING_PROC, 13, -1}, - {14, 1, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 15, HYPER_THREADING_PROC, 15, -1}, - {16, 1, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 17, HYPER_THREADING_PROC, 17, -1}, - {18, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 19, HYPER_THREADING_PROC, 19, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, {21, 0, 1, MAIN_CORE_PROC, 1, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, {23, 0, 3, MAIN_CORE_PROC, 3, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, {25, 0, 5, MAIN_CORE_PROC, 5, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, {27, 0, 7, MAIN_CORE_PROC, 7, -1}, - {28, 0, 8, MAIN_CORE_PROC, 8, -1}, {29, 0, 9, MAIN_CORE_PROC, 9, -1}, - {30, 1, 10, MAIN_CORE_PROC, 10, -1}, {31, 1, 11, MAIN_CORE_PROC, 11, -1}, - {32, 1, 12, MAIN_CORE_PROC, 12, -1}, {33, 1, 13, MAIN_CORE_PROC, 13, -1}, - {34, 1, 14, MAIN_CORE_PROC, 14, -1}, {35, 1, 15, MAIN_CORE_PROC, 15, -1}, - {36, 1, 16, MAIN_CORE_PROC, 16, -1}, {37, 1, 17, MAIN_CORE_PROC, 17, -1}, - {38, 1, 18, MAIN_CORE_PROC, 18, -1}, {39, 1, 19, MAIN_CORE_PROC, 19, -1}, - }, - { - {{"0,20"}, {"0,20"}, {"0-9,20-29"}}, {{"1,21"}, {"1,21"}, {"0-9,20-29"}}, - {{"2,22"}, {"2,22"}, {"0-9,20-29"}}, {{"3,23"}, {"3,23"}, {"0-9,20-29"}}, - {{"4,24"}, {"4,24"}, {"0-9,20-29"}}, {{"5,25"}, {"5,25"}, {"0-9,20-29"}}, - {{"6,26"}, {"6,26"}, {"0-9,20-29"}}, {{"7,27"}, {"7,27"}, {"0-9,20-29"}}, - {{"8,28"}, {"8,28"}, {"0-9,20-29"}}, {{"9,29"}, {"9,29"}, {"0-9,20-29"}}, - {{"10,30"}, {"10,30"}, {"10-19,30-39"}}, {{"11,31"}, {"11,31"}, {"10-19,30-39"}}, - {{"12,32"}, {"12,32"}, {"10-19,30-39"}}, {{"13,33"}, {"13,33"}, {"10-19,30-39"}}, - {{"14,34"}, {"14,34"}, {"10-19,30-39"}}, {{"15,35"}, {"15,35"}, {"10-19,30-39"}}, - {{"16,36"}, {"16,36"}, {"10-19,30-39"}}, {{"17,37"}, {"17,37"}, {"10-19,30-39"}}, - {{"18,38"}, {"18,38"}, {"10-19,30-39"}}, {{"19,39"}, {"19,39"}, {"10-19,30-39"}}, - {{"0,20"}, {"0,20"}, {"0-9,20-29"}}, {{"1,21"}, {"1,21"}, {"0-9,20-29"}}, - {{"2,22"}, {"2,22"}, {"0-9,20-29"}}, {{"3,23"}, {"3,23"}, {"0-9,20-29"}}, - {{"4,24"}, {"4,24"}, {"0-9,20-29"}}, {{"5,25"}, {"5,25"}, {"0-9,20-29"}}, - {{"6,26"}, {"6,26"}, {"0-9,20-29"}}, {{"7,27"}, {"7,27"}, {"0-9,20-29"}}, - {{"8,28"}, {"8,28"}, {"0-9,20-29"}}, {{"9,29"}, {"9,29"}, {"0-9,20-29"}}, - {{"10,30"}, {"10,30"}, {"10-19,30-39"}}, {{"11,31"}, {"11,31"}, {"10-19,30-39"}}, - {{"12,32"}, {"12,32"}, {"10-19,30-39"}}, {{"13,33"}, {"13,33"}, {"10-19,30-39"}}, - {{"14,34"}, {"14,34"}, {"10-19,30-39"}}, {{"15,35"}, {"15,35"}, {"10-19,30-39"}}, - {{"16,36"}, {"16,36"}, {"10-19,30-39"}}, {{"17,37"}, {"17,37"}, {"10-19,30-39"}}, - {{"18,38"}, {"18,38"}, {"10-19,30-39"}}, {{"19,39"}, {"19,39"}, {"10-19,30-39"}}, - }, -}; -LinuxCpuMapTestCase cache_1sockets_14cores_hyperthreading = { - 20, - 1, - 14, - {{20, 6, 8, 6}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 7, EFFICIENT_CORE_PROC, 6, -1}, - {14, 0, 8, EFFICIENT_CORE_PROC, 6, -1}, {15, 0, 9, EFFICIENT_CORE_PROC, 6, -1}, - {16, 0, 10, EFFICIENT_CORE_PROC, 7, -1}, {17, 0, 11, EFFICIENT_CORE_PROC, 7, -1}, - {18, 0, 12, EFFICIENT_CORE_PROC, 7, -1}, {19, 0, 13, EFFICIENT_CORE_PROC, 7, -1}, - }, - { - {{"0-1"}, {"0-1"}, {"0-19"}}, {{"0-1"}, {"0-1"}, {"0-19"}}, {{"2-3"}, {"2-3"}, {"0-19"}}, - {{"2-3"}, {"2-3"}, {"0-19"}}, {{"4-5"}, {"4-5"}, {"0-19"}}, {{"4-5"}, {"4-5"}, {"0-19"}}, - {{"6-7"}, {"6-7"}, {"0-19"}}, {{"6-7"}, {"6-7"}, {"0-19"}}, {{"8-9"}, {"8-9"}, {"0-19"}}, - {{"8-9"}, {"8-9"}, {"0-19"}}, {{"10-11"}, {"10-11"}, {"0-19"}}, {{"10-11"}, {"10-11"}, {"0-19"}}, - {{"12"}, {"12-15"}, {"0-19"}}, {{"13"}, {"12-15"}, {"0-19"}}, {{"14"}, {"12-15"}, {"0-19"}}, - {{"15"}, {"12-15"}, {"0-19"}}, {{"16"}, {"16-19"}, {"0-19"}}, {{"17"}, {"16-19"}, {"0-19"}}, - {{"18"}, {"16-19"}, {"0-19"}}, {{"19"}, {"16-19"}, {"0-19"}}, - }, -}; -LinuxCpuMapTestCase cache_1sockets_10cores_hyperthreading{ - 12, - 1, - 10, - {{12, 2, 8, 2}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, EFFICIENT_CORE_PROC, 2, -1}, - {5, 0, 3, EFFICIENT_CORE_PROC, 2, -1}, - {6, 0, 4, EFFICIENT_CORE_PROC, 2, -1}, - {7, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, - {8, 0, 6, EFFICIENT_CORE_PROC, 3, -1}, - {9, 0, 7, EFFICIENT_CORE_PROC, 3, -1}, - {10, 0, 8, EFFICIENT_CORE_PROC, 3, -1}, - {11, 0, 9, EFFICIENT_CORE_PROC, 3, -1}, - }, - { - {{"0-1"}, {"0-1"}, {"0-11"}}, - {{"0-1"}, {"0-1"}, {"0-11"}}, - {{"2-3"}, {"2-3"}, {"0-11"}}, - {{"2-3"}, {"2-3"}, {"0-11"}}, - {{"4"}, {"4-7"}, {"0-11"}}, - {{"5"}, {"4-7"}, {"0-11"}}, - {{"6"}, {"4-7"}, {"0-11"}}, - {{"7"}, {"4-7"}, {"0-11"}}, - {{"8"}, {"8-11"}, {"0-11"}}, - {{"9"}, {"8-11"}, {"0-11"}}, - {{"10"}, {"8-11"}, {"0-11"}}, - {{"11"}, {"8-11"}, {"0-11"}}, - }, -}; -LinuxCpuMapTestCase cache_1sockets_8cores_hyperthreading = { - 12, - 1, - 8, - {{12, 4, 4, 4}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, EFFICIENT_CORE_PROC, 4, -1}, - {9, 0, 5, EFFICIENT_CORE_PROC, 4, -1}, - {10, 0, 6, EFFICIENT_CORE_PROC, 4, -1}, - {11, 0, 7, EFFICIENT_CORE_PROC, 4, -1}, - }, - { - {{"0-1"}, {"0-1"}, {"0-11"}}, - {{"0-1"}, {"0-1"}, {"0-11"}}, - {{"2-3"}, {"2-3"}, {"0-11"}}, - {{"2-3"}, {"2-3"}, {"0-11"}}, - {{"4-5"}, {"4-5"}, {"0-11"}}, - {{"4-5"}, {"4-5"}, {"0-11"}}, - {{"6-7"}, {"6-7"}, {"0-11"}}, - {{"6-7"}, {"6-7"}, {"0-11"}}, - {{"8"}, {"8-11"}, {"0-11"}}, - {{"9"}, {"8-11"}, {"0-11"}}, - {{"10"}, {"8-11"}, {"0-11"}}, - {{"11"}, {"8-11"}, {"0-11"}}, - }, -}; -LinuxCpuMapTestCase cache_1sockets_6cores_hyperthreading = { - 12, - 1, - 6, - {{12, 6, 0, 6}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - }, - { - {{"0-1"}, {"0-1"}, {"0-11"}}, - {{"0-1"}, {"0-1"}, {"0-11"}}, - {{"2-3"}, {"2-3"}, {"0-11"}}, - {{"2-3"}, {"2-3"}, {"0-11"}}, - {{"4-5"}, {"4-5"}, {"0-11"}}, - {{"4-5"}, {"4-5"}, {"0-11"}}, - {{"6-7"}, {"6-7"}, {"0-11"}}, - {{"6-7"}, {"6-7"}, {"0-11"}}, - {{"8-9"}, {"8-9"}, {"0-11"}}, - {{"8-9"}, {"8-9"}, {"0-11"}}, - {{"10-11"}, {"10-11"}, {"0-11"}}, - {{"10-11"}, {"10-11"}, {"0-11"}}, - }, -}; - -TEST_P(LinuxCpuMapCacheParserTests, LinuxCpuMapCache) {} - -INSTANTIATE_TEST_SUITE_P(CPUMap, - LinuxCpuMapCacheParserTests, - testing::Values(cache_2sockets_104cores_hyperthreading, - cache_2sockets_24cores_hyperthreading, - cache_2sockets_48cores, - cache_2sockets_20cores_hyperthreading, - cache_1sockets_14cores_hyperthreading, - cache_1sockets_10cores_hyperthreading, - cache_1sockets_8cores_hyperthreading, - cache_1sockets_6cores_hyperthreading)); - -TEST_P(LinuxGetCpuMapFromCoresTests, LinuxCpuMap) {} - -INSTANTIATE_TEST_SUITE_P(CPUMapFromCore, - LinuxGetCpuMapFromCoresTests, - testing::Values(cache_2sockets_104cores_hyperthreading, - cache_2sockets_48cores, - cache_2sockets_20cores_hyperthreading, - cache_1sockets_14cores_hyperthreading, - cache_1sockets_10cores_hyperthreading, - cache_1sockets_8cores_hyperthreading)); - -class LinuxCpuMapFreqParserTests : public CommonTestUtils::TestsCommon, - public testing::WithParamInterface> { -public: - void SetUp() override { - const auto& test_data = std::get<0>(GetParam()); - - int test_processors = 0; - int test_sockets = 0; - int test_cores = 0; - std::vector> test_proc_type_table; - std::vector> test_cpu_mapping_table; - - ov::parse_freq_info_linux(test_data.system_info_table, - test_processors, - test_sockets, - test_cores, - test_proc_type_table, - test_cpu_mapping_table); - - ASSERT_EQ(test_data._processors, test_processors); - ASSERT_EQ(test_data._sockets, test_sockets); - ASSERT_EQ(test_data._cores, test_cores); - ASSERT_EQ(test_data._proc_type_table, test_proc_type_table); - ASSERT_EQ(test_data._cpu_mapping_table, test_cpu_mapping_table); - } -}; - -LinuxCpuMapTestCase freq_2sockets_112cores_hyperthreading = { - 224, - 2, - 112, - {{224, 112, 0, 112}, {112, 56, 0, 56}, {112, 56, 0, 56}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 9, HYPER_THREADING_PROC, 9, -1}, - {10, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 11, HYPER_THREADING_PROC, 11, -1}, - {12, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 13, HYPER_THREADING_PROC, 13, -1}, - {14, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 15, HYPER_THREADING_PROC, 15, -1}, - {16, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 17, HYPER_THREADING_PROC, 17, -1}, - {18, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 19, HYPER_THREADING_PROC, 19, -1}, - {20, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 21, HYPER_THREADING_PROC, 21, -1}, - {22, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 23, HYPER_THREADING_PROC, 23, -1}, - {24, 0, 24, HYPER_THREADING_PROC, 24, -1}, {25, 0, 25, HYPER_THREADING_PROC, 25, -1}, - {26, 0, 26, HYPER_THREADING_PROC, 26, -1}, {27, 0, 27, HYPER_THREADING_PROC, 27, -1}, - {28, 0, 28, HYPER_THREADING_PROC, 28, -1}, {29, 0, 29, HYPER_THREADING_PROC, 29, -1}, - {30, 0, 30, HYPER_THREADING_PROC, 30, -1}, {31, 0, 31, HYPER_THREADING_PROC, 31, -1}, - {32, 0, 32, HYPER_THREADING_PROC, 32, -1}, {33, 0, 33, HYPER_THREADING_PROC, 33, -1}, - {34, 0, 34, HYPER_THREADING_PROC, 34, -1}, {35, 0, 35, HYPER_THREADING_PROC, 35, -1}, - {36, 0, 36, HYPER_THREADING_PROC, 36, -1}, {37, 0, 37, HYPER_THREADING_PROC, 37, -1}, - {38, 0, 38, HYPER_THREADING_PROC, 38, -1}, {39, 0, 39, HYPER_THREADING_PROC, 39, -1}, - {40, 0, 40, HYPER_THREADING_PROC, 40, -1}, {41, 0, 41, HYPER_THREADING_PROC, 41, -1}, - {42, 0, 42, HYPER_THREADING_PROC, 42, -1}, {43, 0, 43, HYPER_THREADING_PROC, 43, -1}, - {44, 0, 44, HYPER_THREADING_PROC, 44, -1}, {45, 0, 45, HYPER_THREADING_PROC, 45, -1}, - {46, 0, 46, HYPER_THREADING_PROC, 46, -1}, {47, 0, 47, HYPER_THREADING_PROC, 47, -1}, - {48, 0, 48, HYPER_THREADING_PROC, 48, -1}, {49, 0, 49, HYPER_THREADING_PROC, 49, -1}, - {50, 0, 50, HYPER_THREADING_PROC, 50, -1}, {51, 0, 51, HYPER_THREADING_PROC, 51, -1}, - {52, 0, 52, HYPER_THREADING_PROC, 52, -1}, {53, 0, 53, HYPER_THREADING_PROC, 53, -1}, - {54, 0, 54, HYPER_THREADING_PROC, 54, -1}, {55, 0, 55, HYPER_THREADING_PROC, 55, -1}, - {56, 1, 56, HYPER_THREADING_PROC, 56, -1}, {57, 1, 57, HYPER_THREADING_PROC, 57, -1}, - {58, 1, 58, HYPER_THREADING_PROC, 58, -1}, {59, 1, 59, HYPER_THREADING_PROC, 59, -1}, - {60, 1, 60, HYPER_THREADING_PROC, 60, -1}, {61, 1, 61, HYPER_THREADING_PROC, 61, -1}, - {62, 1, 62, HYPER_THREADING_PROC, 62, -1}, {63, 1, 63, HYPER_THREADING_PROC, 63, -1}, - {64, 1, 64, HYPER_THREADING_PROC, 64, -1}, {65, 1, 65, HYPER_THREADING_PROC, 65, -1}, - {66, 1, 66, HYPER_THREADING_PROC, 66, -1}, {67, 1, 67, HYPER_THREADING_PROC, 67, -1}, - {68, 1, 68, HYPER_THREADING_PROC, 68, -1}, {69, 1, 69, HYPER_THREADING_PROC, 69, -1}, - {70, 1, 70, HYPER_THREADING_PROC, 70, -1}, {71, 1, 71, HYPER_THREADING_PROC, 71, -1}, - {72, 1, 72, HYPER_THREADING_PROC, 72, -1}, {73, 1, 73, HYPER_THREADING_PROC, 73, -1}, - {74, 1, 74, HYPER_THREADING_PROC, 74, -1}, {75, 1, 75, HYPER_THREADING_PROC, 75, -1}, - {76, 1, 76, HYPER_THREADING_PROC, 76, -1}, {77, 1, 77, HYPER_THREADING_PROC, 77, -1}, - {78, 1, 78, HYPER_THREADING_PROC, 78, -1}, {79, 1, 79, HYPER_THREADING_PROC, 79, -1}, - {80, 1, 80, HYPER_THREADING_PROC, 80, -1}, {81, 1, 81, HYPER_THREADING_PROC, 81, -1}, - {82, 1, 82, HYPER_THREADING_PROC, 82, -1}, {83, 1, 83, HYPER_THREADING_PROC, 83, -1}, - {84, 1, 84, HYPER_THREADING_PROC, 84, -1}, {85, 1, 85, HYPER_THREADING_PROC, 85, -1}, - {86, 1, 86, HYPER_THREADING_PROC, 86, -1}, {87, 1, 87, HYPER_THREADING_PROC, 87, -1}, - {88, 1, 88, HYPER_THREADING_PROC, 88, -1}, {89, 1, 89, HYPER_THREADING_PROC, 89, -1}, - {90, 1, 90, HYPER_THREADING_PROC, 90, -1}, {91, 1, 91, HYPER_THREADING_PROC, 91, -1}, - {92, 1, 92, HYPER_THREADING_PROC, 92, -1}, {93, 1, 93, HYPER_THREADING_PROC, 93, -1}, - {94, 1, 94, HYPER_THREADING_PROC, 94, -1}, {95, 1, 95, HYPER_THREADING_PROC, 95, -1}, - {96, 1, 96, HYPER_THREADING_PROC, 96, -1}, {97, 1, 97, HYPER_THREADING_PROC, 97, -1}, - {98, 1, 98, HYPER_THREADING_PROC, 98, -1}, {99, 1, 99, HYPER_THREADING_PROC, 99, -1}, - {100, 1, 100, HYPER_THREADING_PROC, 100, -1}, {101, 1, 101, HYPER_THREADING_PROC, 101, -1}, - {102, 1, 102, HYPER_THREADING_PROC, 102, -1}, {103, 1, 103, HYPER_THREADING_PROC, 103, -1}, - {104, 1, 104, HYPER_THREADING_PROC, 104, -1}, {105, 1, 105, HYPER_THREADING_PROC, 105, -1}, - {106, 1, 106, HYPER_THREADING_PROC, 106, -1}, {107, 1, 107, HYPER_THREADING_PROC, 107, -1}, - {108, 1, 108, HYPER_THREADING_PROC, 108, -1}, {109, 1, 109, HYPER_THREADING_PROC, 109, -1}, - {110, 1, 110, HYPER_THREADING_PROC, 110, -1}, {111, 1, 111, HYPER_THREADING_PROC, 111, -1}, - {112, 0, 0, MAIN_CORE_PROC, 0, -1}, {113, 0, 1, MAIN_CORE_PROC, 1, -1}, - {114, 0, 2, MAIN_CORE_PROC, 2, -1}, {115, 0, 3, MAIN_CORE_PROC, 3, -1}, - {116, 0, 4, MAIN_CORE_PROC, 4, -1}, {117, 0, 5, MAIN_CORE_PROC, 5, -1}, - {118, 0, 6, MAIN_CORE_PROC, 6, -1}, {119, 0, 7, MAIN_CORE_PROC, 7, -1}, - {120, 0, 8, MAIN_CORE_PROC, 8, -1}, {121, 0, 9, MAIN_CORE_PROC, 9, -1}, - {122, 0, 10, MAIN_CORE_PROC, 10, -1}, {123, 0, 11, MAIN_CORE_PROC, 11, -1}, - {124, 0, 12, MAIN_CORE_PROC, 12, -1}, {125, 0, 13, MAIN_CORE_PROC, 13, -1}, - {126, 0, 14, MAIN_CORE_PROC, 14, -1}, {127, 0, 15, MAIN_CORE_PROC, 15, -1}, - {128, 0, 16, MAIN_CORE_PROC, 16, -1}, {129, 0, 17, MAIN_CORE_PROC, 17, -1}, - {130, 0, 18, MAIN_CORE_PROC, 18, -1}, {131, 0, 19, MAIN_CORE_PROC, 19, -1}, - {132, 0, 20, MAIN_CORE_PROC, 20, -1}, {133, 0, 21, MAIN_CORE_PROC, 21, -1}, - {134, 0, 22, MAIN_CORE_PROC, 22, -1}, {135, 0, 23, MAIN_CORE_PROC, 23, -1}, - {136, 0, 24, MAIN_CORE_PROC, 24, -1}, {137, 0, 25, MAIN_CORE_PROC, 25, -1}, - {138, 0, 26, MAIN_CORE_PROC, 26, -1}, {139, 0, 27, MAIN_CORE_PROC, 27, -1}, - {140, 0, 28, MAIN_CORE_PROC, 28, -1}, {141, 0, 29, MAIN_CORE_PROC, 29, -1}, - {142, 0, 30, MAIN_CORE_PROC, 30, -1}, {143, 0, 31, MAIN_CORE_PROC, 31, -1}, - {144, 0, 32, MAIN_CORE_PROC, 32, -1}, {145, 0, 33, MAIN_CORE_PROC, 33, -1}, - {146, 0, 34, MAIN_CORE_PROC, 34, -1}, {147, 0, 35, MAIN_CORE_PROC, 35, -1}, - {148, 0, 36, MAIN_CORE_PROC, 36, -1}, {149, 0, 37, MAIN_CORE_PROC, 37, -1}, - {150, 0, 38, MAIN_CORE_PROC, 38, -1}, {151, 0, 39, MAIN_CORE_PROC, 39, -1}, - {152, 0, 40, MAIN_CORE_PROC, 40, -1}, {153, 0, 41, MAIN_CORE_PROC, 41, -1}, - {154, 0, 42, MAIN_CORE_PROC, 42, -1}, {155, 0, 43, MAIN_CORE_PROC, 43, -1}, - {156, 0, 44, MAIN_CORE_PROC, 44, -1}, {157, 0, 45, MAIN_CORE_PROC, 45, -1}, - {158, 0, 46, MAIN_CORE_PROC, 46, -1}, {159, 0, 47, MAIN_CORE_PROC, 47, -1}, - {160, 0, 48, MAIN_CORE_PROC, 48, -1}, {161, 0, 49, MAIN_CORE_PROC, 49, -1}, - {162, 0, 50, MAIN_CORE_PROC, 50, -1}, {163, 0, 51, MAIN_CORE_PROC, 51, -1}, - {164, 0, 52, MAIN_CORE_PROC, 52, -1}, {165, 0, 53, MAIN_CORE_PROC, 53, -1}, - {166, 0, 54, MAIN_CORE_PROC, 54, -1}, {167, 0, 55, MAIN_CORE_PROC, 55, -1}, - {168, 1, 56, MAIN_CORE_PROC, 56, -1}, {169, 1, 57, MAIN_CORE_PROC, 57, -1}, - {170, 1, 58, MAIN_CORE_PROC, 58, -1}, {171, 1, 59, MAIN_CORE_PROC, 59, -1}, - {172, 1, 60, MAIN_CORE_PROC, 60, -1}, {173, 1, 61, MAIN_CORE_PROC, 61, -1}, - {174, 1, 62, MAIN_CORE_PROC, 62, -1}, {175, 1, 63, MAIN_CORE_PROC, 63, -1}, - {176, 1, 64, MAIN_CORE_PROC, 64, -1}, {177, 1, 65, MAIN_CORE_PROC, 65, -1}, - {178, 1, 66, MAIN_CORE_PROC, 66, -1}, {179, 1, 67, MAIN_CORE_PROC, 67, -1}, - {180, 1, 68, MAIN_CORE_PROC, 68, -1}, {181, 1, 69, MAIN_CORE_PROC, 69, -1}, - {182, 1, 70, MAIN_CORE_PROC, 70, -1}, {183, 1, 71, MAIN_CORE_PROC, 71, -1}, - {184, 1, 72, MAIN_CORE_PROC, 72, -1}, {185, 1, 73, MAIN_CORE_PROC, 73, -1}, - {186, 1, 74, MAIN_CORE_PROC, 74, -1}, {187, 1, 75, MAIN_CORE_PROC, 75, -1}, - {188, 1, 76, MAIN_CORE_PROC, 76, -1}, {189, 1, 77, MAIN_CORE_PROC, 77, -1}, - {190, 1, 78, MAIN_CORE_PROC, 78, -1}, {191, 1, 79, MAIN_CORE_PROC, 79, -1}, - {192, 1, 80, MAIN_CORE_PROC, 80, -1}, {193, 1, 81, MAIN_CORE_PROC, 81, -1}, - {194, 1, 82, MAIN_CORE_PROC, 82, -1}, {195, 1, 83, MAIN_CORE_PROC, 83, -1}, - {196, 1, 84, MAIN_CORE_PROC, 84, -1}, {197, 1, 85, MAIN_CORE_PROC, 85, -1}, - {198, 1, 86, MAIN_CORE_PROC, 86, -1}, {199, 1, 87, MAIN_CORE_PROC, 87, -1}, - {200, 1, 88, MAIN_CORE_PROC, 88, -1}, {201, 1, 89, MAIN_CORE_PROC, 89, -1}, - {202, 1, 90, MAIN_CORE_PROC, 90, -1}, {203, 1, 91, MAIN_CORE_PROC, 91, -1}, - {204, 1, 92, MAIN_CORE_PROC, 92, -1}, {205, 1, 93, MAIN_CORE_PROC, 93, -1}, - {206, 1, 94, MAIN_CORE_PROC, 94, -1}, {207, 1, 95, MAIN_CORE_PROC, 95, -1}, - {208, 1, 96, MAIN_CORE_PROC, 96, -1}, {209, 1, 97, MAIN_CORE_PROC, 97, -1}, - {210, 1, 98, MAIN_CORE_PROC, 98, -1}, {211, 1, 99, MAIN_CORE_PROC, 99, -1}, - {212, 1, 100, MAIN_CORE_PROC, 100, -1}, {213, 1, 101, MAIN_CORE_PROC, 101, -1}, - {214, 1, 102, MAIN_CORE_PROC, 102, -1}, {215, 1, 103, MAIN_CORE_PROC, 103, -1}, - {216, 1, 104, MAIN_CORE_PROC, 104, -1}, {217, 1, 105, MAIN_CORE_PROC, 105, -1}, - {218, 1, 106, MAIN_CORE_PROC, 106, -1}, {219, 1, 107, MAIN_CORE_PROC, 107, -1}, - {220, 1, 108, MAIN_CORE_PROC, 108, -1}, {221, 1, 109, MAIN_CORE_PROC, 109, -1}, - {222, 1, 110, MAIN_CORE_PROC, 110, -1}, {223, 1, 111, MAIN_CORE_PROC, 111, -1}, - }, - { - {"0,112", "0", "2001000"}, {"1,113", "0", "2001000"}, {"2,114", "0", "2001000"}, - {"3,115", "0", "2001000"}, {"4,116", "0", "2001000"}, {"5,117", "0", "2001000"}, - {"6,118", "0", "2001000"}, {"7,119", "0", "2001000"}, {"8,120", "0", "2001000"}, - {"9,121", "0", "2001000"}, {"10,122", "0", "2001000"}, {"11,123", "0", "2001000"}, - {"12,124", "0", "2001000"}, {"13,125", "0", "2001000"}, {"14,126", "0", "2001000"}, - {"15,127", "0", "2001000"}, {"16,128", "0", "2001000"}, {"17,129", "0", "2001000"}, - {"18,130", "0", "2001000"}, {"19,131", "0", "2001000"}, {"20,132", "0", "2001000"}, - {"21,133", "0", "2001000"}, {"22,134", "0", "2001000"}, {"23,135", "0", "2001000"}, - {"24,136", "0", "2001000"}, {"25,137", "0", "2001000"}, {"26,138", "0", "2001000"}, - {"27,139", "0", "2001000"}, {"28,140", "0", "2001000"}, {"29,141", "0", "2001000"}, - {"30,142", "0", "2001000"}, {"31,143", "0", "2001000"}, {"32,144", "0", "2001000"}, - {"33,145", "0", "2001000"}, {"34,146", "0", "2001000"}, {"35,147", "0", "2001000"}, - {"36,148", "0", "2001000"}, {"37,149", "0", "2001000"}, {"38,150", "0", "2001000"}, - {"39,151", "0", "2001000"}, {"40,152", "0", "2001000"}, {"41,153", "0", "2001000"}, - {"42,154", "0", "2001000"}, {"43,155", "0", "2001000"}, {"44,156", "0", "2001000"}, - {"45,157", "0", "2001000"}, {"46,158", "0", "2001000"}, {"47,159", "0", "2001000"}, - {"48,160", "0", "2001000"}, {"49,161", "0", "2001000"}, {"50,162", "0", "2001000"}, - {"51,163", "0", "2001000"}, {"52,164", "0", "2001000"}, {"53,165", "0", "2001000"}, - {"54,166", "0", "2001000"}, {"55,167", "0", "2001000"}, {"56,168", "1", "2001000"}, - {"57,169", "1", "2001000"}, {"58,170", "1", "2001000"}, {"59,171", "1", "2001000"}, - {"60,172", "1", "2001000"}, {"61,173", "1", "2001000"}, {"62,174", "1", "2001000"}, - {"63,175", "1", "2001000"}, {"64,176", "1", "2001000"}, {"65,177", "1", "2001000"}, - {"66,178", "1", "2001000"}, {"67,179", "1", "2001000"}, {"68,180", "1", "2001000"}, - {"69,181", "1", "2001000"}, {"70,182", "1", "2001000"}, {"71,183", "1", "2001000"}, - {"72,184", "1", "2001000"}, {"73,185", "1", "2001000"}, {"74,186", "1", "2001000"}, - {"75,187", "1", "2001000"}, {"76,188", "1", "2001000"}, {"77,189", "1", "2001000"}, - {"78,190", "1", "2001000"}, {"79,191", "1", "2001000"}, {"80,192", "1", "2001000"}, - {"81,193", "1", "2001000"}, {"82,194", "1", "2001000"}, {"83,195", "1", "2001000"}, - {"84,196", "1", "2001000"}, {"85,197", "1", "2001000"}, {"86,198", "1", "2001000"}, - {"87,199", "1", "2001000"}, {"88,200", "1", "2001000"}, {"89,201", "1", "2001000"}, - {"90,202", "1", "2001000"}, {"91,203", "1", "2001000"}, {"92,204", "1", "2001000"}, - {"93,205", "1", "2001000"}, {"94,206", "1", "2001000"}, {"95,207", "1", "2001000"}, - {"96,208", "1", "2001000"}, {"97,209", "1", "2001000"}, {"98,210", "1", "2001000"}, - {"99,211", "1", "2001000"}, {"100,212", "1", "2001000"}, {"101,213", "1", "2001000"}, - {"102,214", "1", "2001000"}, {"103,215", "1", "2001000"}, {"104,216", "1", "2001000"}, - {"105,217", "1", "2001000"}, {"106,218", "1", "2001000"}, {"107,219", "1", "2001000"}, - {"108,220", "1", "2001000"}, {"109,221", "1", "2001000"}, {"110,222", "1", "2001000"}, - {"111,223", "1", "2001000"}, {"0,112", "0", "2001000"}, {"1,113", "0", "2001000"}, - {"2,114", "0", "2001000"}, {"3,115", "0", "2001000"}, {"4,116", "0", "2001000"}, - {"5,117", "0", "2001000"}, {"6,118", "0", "2001000"}, {"7,119", "0", "2001000"}, - {"8,120", "0", "2001000"}, {"9,121", "0", "2001000"}, {"10,122", "0", "2001000"}, - {"11,123", "0", "2001000"}, {"12,124", "0", "2001000"}, {"13,125", "0", "2001000"}, - {"14,126", "0", "2001000"}, {"15,127", "0", "2001000"}, {"16,128", "0", "2001000"}, - {"17,129", "0", "2001000"}, {"18,130", "0", "2001000"}, {"19,131", "0", "2001000"}, - {"20,132", "0", "2001000"}, {"21,133", "0", "2001000"}, {"22,134", "0", "2001000"}, - {"23,135", "0", "2001000"}, {"24,136", "0", "2001000"}, {"25,137", "0", "2001000"}, - {"26,138", "0", "2001000"}, {"27,139", "0", "2001000"}, {"28,140", "0", "2001000"}, - {"29,141", "0", "2001000"}, {"30,142", "0", "2001000"}, {"31,143", "0", "2001000"}, - {"32,144", "0", "2001000"}, {"33,145", "0", "2001000"}, {"34,146", "0", "2001000"}, - {"35,147", "0", "2001000"}, {"36,148", "0", "2001000"}, {"37,149", "0", "2001000"}, - {"38,150", "0", "2001000"}, {"39,151", "0", "2001000"}, {"40,152", "0", "2001000"}, - {"41,153", "0", "2001000"}, {"42,154", "0", "2001000"}, {"43,155", "0", "2001000"}, - {"44,156", "0", "2001000"}, {"45,157", "0", "2001000"}, {"46,158", "0", "2001000"}, - {"47,159", "0", "2001000"}, {"48,160", "0", "2001000"}, {"49,161", "0", "2001000"}, - {"50,162", "0", "2001000"}, {"51,163", "0", "2001000"}, {"52,164", "0", "2001000"}, - {"53,165", "0", "2001000"}, {"54,166", "0", "2001000"}, {"55,167", "0", "2001000"}, - {"56,168", "1", "2001000"}, {"57,169", "1", "2001000"}, {"58,170", "1", "2001000"}, - {"59,171", "1", "2001000"}, {"60,172", "1", "2001000"}, {"61,173", "1", "2001000"}, - {"62,174", "1", "2001000"}, {"63,175", "1", "2001000"}, {"64,176", "1", "2001000"}, - {"65,177", "1", "2001000"}, {"66,178", "1", "2001000"}, {"67,179", "1", "2001000"}, - {"68,180", "1", "2001000"}, {"69,181", "1", "2001000"}, {"70,182", "1", "2001000"}, - {"71,183", "1", "2001000"}, {"72,184", "1", "2001000"}, {"73,185", "1", "2001000"}, - {"74,186", "1", "2001000"}, {"75,187", "1", "2001000"}, {"76,188", "1", "2001000"}, - {"77,189", "1", "2001000"}, {"78,190", "1", "2001000"}, {"79,191", "1", "2001000"}, - {"80,192", "1", "2001000"}, {"81,193", "1", "2001000"}, {"82,194", "1", "2001000"}, - {"83,195", "1", "2001000"}, {"84,196", "1", "2001000"}, {"85,197", "1", "2001000"}, - {"86,198", "1", "2001000"}, {"87,199", "1", "2001000"}, {"88,200", "1", "2001000"}, - {"89,201", "1", "2001000"}, {"90,202", "1", "2001000"}, {"91,203", "1", "2001000"}, - {"92,204", "1", "2001000"}, {"93,205", "1", "2001000"}, {"94,206", "1", "2001000"}, - {"95,207", "1", "2001000"}, {"96,208", "1", "2001000"}, {"97,209", "1", "2001000"}, - {"98,210", "1", "2001000"}, {"99,211", "1", "2001000"}, {"100,212", "1", "2001000"}, - {"101,213", "1", "2001000"}, {"102,214", "1", "2001000"}, {"103,215", "1", "2001000"}, - {"104,216", "1", "2001000"}, {"105,217", "1", "2001000"}, {"106,218", "1", "2001000"}, - {"107,219", "1", "2001000"}, {"108,220", "1", "2001000"}, {"109,221", "1", "2001000"}, - {"110,222", "1", "2001000"}, {"111,223", "1", "2001000"}, - }, -}; -LinuxCpuMapTestCase freq_2sockets_48cores_hyperthreading = { - 96, - 2, - 48, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 9, HYPER_THREADING_PROC, 9, -1}, - {10, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 11, HYPER_THREADING_PROC, 11, -1}, - {12, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 13, HYPER_THREADING_PROC, 13, -1}, - {14, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 15, HYPER_THREADING_PROC, 15, -1}, - {16, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 17, HYPER_THREADING_PROC, 17, -1}, - {18, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 19, HYPER_THREADING_PROC, 19, -1}, - {20, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 21, HYPER_THREADING_PROC, 21, -1}, - {22, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 23, HYPER_THREADING_PROC, 23, -1}, - {24, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 1, 25, HYPER_THREADING_PROC, 25, -1}, - {26, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 1, 27, HYPER_THREADING_PROC, 27, -1}, - {28, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 1, 29, HYPER_THREADING_PROC, 29, -1}, - {30, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 1, 31, HYPER_THREADING_PROC, 31, -1}, - {32, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 1, 33, HYPER_THREADING_PROC, 33, -1}, - {34, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 1, 35, HYPER_THREADING_PROC, 35, -1}, - {36, 1, 36, HYPER_THREADING_PROC, 36, -1}, {37, 1, 37, HYPER_THREADING_PROC, 37, -1}, - {38, 1, 38, HYPER_THREADING_PROC, 38, -1}, {39, 1, 39, HYPER_THREADING_PROC, 39, -1}, - {40, 1, 40, HYPER_THREADING_PROC, 40, -1}, {41, 1, 41, HYPER_THREADING_PROC, 41, -1}, - {42, 1, 42, HYPER_THREADING_PROC, 42, -1}, {43, 1, 43, HYPER_THREADING_PROC, 43, -1}, - {44, 1, 44, HYPER_THREADING_PROC, 44, -1}, {45, 1, 45, HYPER_THREADING_PROC, 45, -1}, - {46, 1, 46, HYPER_THREADING_PROC, 46, -1}, {47, 1, 47, HYPER_THREADING_PROC, 47, -1}, - {48, 0, 0, MAIN_CORE_PROC, 0, -1}, {49, 0, 1, MAIN_CORE_PROC, 1, -1}, - {50, 0, 2, MAIN_CORE_PROC, 2, -1}, {51, 0, 3, MAIN_CORE_PROC, 3, -1}, - {52, 0, 4, MAIN_CORE_PROC, 4, -1}, {53, 0, 5, MAIN_CORE_PROC, 5, -1}, - {54, 0, 6, MAIN_CORE_PROC, 6, -1}, {55, 0, 7, MAIN_CORE_PROC, 7, -1}, - {56, 0, 8, MAIN_CORE_PROC, 8, -1}, {57, 0, 9, MAIN_CORE_PROC, 9, -1}, - {58, 0, 10, MAIN_CORE_PROC, 10, -1}, {59, 0, 11, MAIN_CORE_PROC, 11, -1}, - {60, 0, 12, MAIN_CORE_PROC, 12, -1}, {61, 0, 13, MAIN_CORE_PROC, 13, -1}, - {62, 0, 14, MAIN_CORE_PROC, 14, -1}, {63, 0, 15, MAIN_CORE_PROC, 15, -1}, - {64, 0, 16, MAIN_CORE_PROC, 16, -1}, {65, 0, 17, MAIN_CORE_PROC, 17, -1}, - {66, 0, 18, MAIN_CORE_PROC, 18, -1}, {67, 0, 19, MAIN_CORE_PROC, 19, -1}, - {68, 0, 20, MAIN_CORE_PROC, 20, -1}, {69, 0, 21, MAIN_CORE_PROC, 21, -1}, - {70, 0, 22, MAIN_CORE_PROC, 22, -1}, {71, 0, 23, MAIN_CORE_PROC, 23, -1}, - {72, 1, 24, MAIN_CORE_PROC, 24, -1}, {73, 1, 25, MAIN_CORE_PROC, 25, -1}, - {74, 1, 26, MAIN_CORE_PROC, 26, -1}, {75, 1, 27, MAIN_CORE_PROC, 27, -1}, - {76, 1, 28, MAIN_CORE_PROC, 28, -1}, {77, 1, 29, MAIN_CORE_PROC, 29, -1}, - {78, 1, 30, MAIN_CORE_PROC, 30, -1}, {79, 1, 31, MAIN_CORE_PROC, 31, -1}, - {80, 1, 32, MAIN_CORE_PROC, 32, -1}, {81, 1, 33, MAIN_CORE_PROC, 33, -1}, - {82, 1, 34, MAIN_CORE_PROC, 34, -1}, {83, 1, 35, MAIN_CORE_PROC, 35, -1}, - {84, 1, 36, MAIN_CORE_PROC, 36, -1}, {85, 1, 37, MAIN_CORE_PROC, 37, -1}, - {86, 1, 38, MAIN_CORE_PROC, 38, -1}, {87, 1, 39, MAIN_CORE_PROC, 39, -1}, - {88, 1, 40, MAIN_CORE_PROC, 40, -1}, {89, 1, 41, MAIN_CORE_PROC, 41, -1}, - {90, 1, 42, MAIN_CORE_PROC, 42, -1}, {91, 1, 43, MAIN_CORE_PROC, 43, -1}, - {92, 1, 44, MAIN_CORE_PROC, 44, -1}, {93, 1, 45, MAIN_CORE_PROC, 45, -1}, - {94, 1, 46, MAIN_CORE_PROC, 46, -1}, {95, 1, 47, MAIN_CORE_PROC, 47, -1}, - }, - { - {"0,48", "0", "3600000"}, {"1,49", "0", "3600000"}, {"2,50", "0", "3600000"}, {"3,51", "0", "3600000"}, - {"4,52", "0", "3600000"}, {"5,53", "0", "3600000"}, {"6,54", "0", "3600000"}, {"7,55", "0", "3600000"}, - {"8,56", "0", "3600000"}, {"9,57", "0", "3600000"}, {"10,58", "0", "3600000"}, {"11,59", "0", "3600000"}, - {"12,60", "0", "3600000"}, {"13,61", "0", "3600000"}, {"14,62", "0", "3600000"}, {"15,63", "0", "3600000"}, - {"16,64", "0", "3600000"}, {"17,65", "0", "3600000"}, {"18,66", "0", "3600000"}, {"19,67", "0", "3600000"}, - {"20,68", "0", "3600000"}, {"21,69", "0", "3600000"}, {"22,70", "0", "3600000"}, {"23,71", "0", "3600000"}, - {"24,72", "1", "3600000"}, {"25,73", "1", "3600000"}, {"26,74", "1", "3600000"}, {"27,75", "1", "3600000"}, - {"28,76", "1", "3600000"}, {"29,77", "1", "3600000"}, {"30,78", "1", "3600000"}, {"31,79", "1", "3600000"}, - {"32,80", "1", "3600000"}, {"33,81", "1", "3600000"}, {"34,82", "1", "3600000"}, {"35,83", "1", "3600000"}, - {"36,84", "1", "3600000"}, {"37,85", "1", "3600000"}, {"38,86", "1", "3600000"}, {"39,87", "1", "3600000"}, - {"40,88", "1", "3600000"}, {"41,89", "1", "3600000"}, {"42,90", "1", "3600000"}, {"43,91", "1", "3600000"}, - {"44,92", "1", "3600000"}, {"45,93", "1", "3600000"}, {"46,94", "1", "3600000"}, {"47,95", "1", "3600000"}, - {"0,48", "0", "3600000"}, {"1,49", "0", "3600000"}, {"2,50", "0", "3600000"}, {"3,51", "0", "3600000"}, - {"4,52", "0", "3600000"}, {"5,53", "0", "3600000"}, {"6,54", "0", "3600000"}, {"7,55", "0", "3600000"}, - {"8,56", "0", "3600000"}, {"9,57", "0", "3600000"}, {"10,58", "0", "3600000"}, {"11,59", "0", "3600000"}, - {"12,60", "0", "3600000"}, {"13,61", "0", "3600000"}, {"14,62", "0", "3600000"}, {"15,63", "0", "3600000"}, - {"16,64", "0", "3600000"}, {"17,65", "0", "3600000"}, {"18,66", "0", "3600000"}, {"19,67", "0", "3600000"}, - {"20,68", "0", "3600000"}, {"21,69", "0", "3600000"}, {"22,70", "0", "3600000"}, {"23,71", "0", "3600000"}, - {"24,72", "1", "3600000"}, {"25,73", "1", "3600000"}, {"26,74", "1", "3600000"}, {"27,75", "1", "3600000"}, - {"28,76", "1", "3600000"}, {"29,77", "1", "3600000"}, {"30,78", "1", "3600000"}, {"31,79", "1", "3600000"}, - {"32,80", "1", "3600000"}, {"33,81", "1", "3600000"}, {"34,82", "1", "3600000"}, {"35,83", "1", "3600000"}, - {"36,84", "1", "3600000"}, {"37,85", "1", "3600000"}, {"38,86", "1", "3600000"}, {"39,87", "1", "3600000"}, - {"40,88", "1", "3600000"}, {"41,89", "1", "3600000"}, {"42,90", "1", "3600000"}, {"43,91", "1", "3600000"}, - {"44,92", "1", "3600000"}, {"45,93", "1", "3600000"}, {"46,94", "1", "3600000"}, {"47,95", "1", "3600000"}, - }, -}; -LinuxCpuMapTestCase freq_2sockets_20cores_hyperthreading = { - 40, - 2, - 20, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 9, HYPER_THREADING_PROC, 9, -1}, - {10, 1, 10, HYPER_THREADING_PROC, 10, -1}, {11, 1, 11, HYPER_THREADING_PROC, 11, -1}, - {12, 1, 12, HYPER_THREADING_PROC, 12, -1}, {13, 1, 13, HYPER_THREADING_PROC, 13, -1}, - {14, 1, 14, HYPER_THREADING_PROC, 14, -1}, {15, 1, 15, HYPER_THREADING_PROC, 15, -1}, - {16, 1, 16, HYPER_THREADING_PROC, 16, -1}, {17, 1, 17, HYPER_THREADING_PROC, 17, -1}, - {18, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 19, HYPER_THREADING_PROC, 19, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, {21, 0, 1, MAIN_CORE_PROC, 1, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, {23, 0, 3, MAIN_CORE_PROC, 3, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, {25, 0, 5, MAIN_CORE_PROC, 5, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, {27, 0, 7, MAIN_CORE_PROC, 7, -1}, - {28, 0, 8, MAIN_CORE_PROC, 8, -1}, {29, 0, 9, MAIN_CORE_PROC, 9, -1}, - {30, 1, 10, MAIN_CORE_PROC, 10, -1}, {31, 1, 11, MAIN_CORE_PROC, 11, -1}, - {32, 1, 12, MAIN_CORE_PROC, 12, -1}, {33, 1, 13, MAIN_CORE_PROC, 13, -1}, - {34, 1, 14, MAIN_CORE_PROC, 14, -1}, {35, 1, 15, MAIN_CORE_PROC, 15, -1}, - {36, 1, 16, MAIN_CORE_PROC, 16, -1}, {37, 1, 17, MAIN_CORE_PROC, 17, -1}, - {38, 1, 18, MAIN_CORE_PROC, 18, -1}, {39, 1, 19, MAIN_CORE_PROC, 19, -1}, - }, - { - {"0,20", "0", "3000000"}, {"1,21", "0", "3000000"}, {"2,22", "0", "3000000"}, {"3,23", "0", "3000000"}, - {"4,24", "0", "3000000"}, {"5,25", "0", "3000000"}, {"6,26", "0", "3000000"}, {"7,27", "0", "3000000"}, - {"8,28", "0", "3000000"}, {"9,29", "0", "3000000"}, {"10,30", "1", "3000000"}, {"11,31", "1", "3000000"}, - {"12,32", "1", "3000000"}, {"13,33", "1", "3000000"}, {"14,34", "1", "3000000"}, {"15,35", "1", "3000000"}, - {"16,36", "1", "3000000"}, {"17,37", "1", "3000000"}, {"18,38", "1", "3000000"}, {"19,39", "1", "3000000"}, - {"0,20", "0", "3000000"}, {"1,21", "0", "3000000"}, {"2,22", "0", "3000000"}, {"3,23", "0", "3000000"}, - {"4,24", "0", "3000000"}, {"5,25", "0", "3000000"}, {"6,26", "0", "3000000"}, {"7,27", "0", "3000000"}, - {"8,28", "0", "3000000"}, {"9,29", "0", "3000000"}, {"10,30", "1", "3000000"}, {"11,31", "1", "3000000"}, - {"12,32", "1", "3000000"}, {"13,33", "1", "3000000"}, {"14,34", "1", "3000000"}, {"15,35", "1", "3000000"}, - {"16,36", "1", "3000000"}, {"17,37", "1", "3000000"}, {"18,38", "1", "3000000"}, {"19,39", "1", "3000000"}, - }, -}; -LinuxCpuMapTestCase freq_2sockets_20cores = { - 20, - 2, - 20, - {{20, 20, 0, 0}, {10, 10, 0, 0}, {10, 10, 0, 0}}, - { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 1, MAIN_CORE_PROC, 1, -1}, {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {3, 0, 3, MAIN_CORE_PROC, 3, -1}, {4, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 5, MAIN_CORE_PROC, 5, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 7, MAIN_CORE_PROC, 7, -1}, {8, 0, 8, MAIN_CORE_PROC, 8, -1}, - {9, 0, 9, MAIN_CORE_PROC, 9, -1}, {10, 1, 10, MAIN_CORE_PROC, 10, -1}, {11, 1, 11, MAIN_CORE_PROC, 11, -1}, - {12, 1, 12, MAIN_CORE_PROC, 12, -1}, {13, 1, 13, MAIN_CORE_PROC, 13, -1}, {14, 1, 14, MAIN_CORE_PROC, 14, -1}, - {15, 1, 15, MAIN_CORE_PROC, 15, -1}, {16, 1, 16, MAIN_CORE_PROC, 16, -1}, {17, 1, 17, MAIN_CORE_PROC, 17, -1}, - {18, 1, 18, MAIN_CORE_PROC, 18, -1}, {19, 1, 19, MAIN_CORE_PROC, 19, -1}, - }, - { - {"0", "0", "3000000"}, {"1", "0", "3000000"}, {"2", "0", "3000000"}, {"3", "0", "3000000"}, - {"4", "0", "3000000"}, {"5", "0", "3000000"}, {"6", "0", "3000000"}, {"7", "0", "3000000"}, - {"8", "0", "3000000"}, {"9", "0", "3000000"}, {"10", "1", "3000000"}, {"11", "1", "3000000"}, - {"12", "1", "3000000"}, {"13", "1", "3000000"}, {"14", "1", "3000000"}, {"15", "1", "3000000"}, - {"16", "1", "3000000"}, {"17", "1", "3000000"}, {"18", "1", "3000000"}, {"19", "1", "3000000"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_32cores_hyperthreading = { - 64, - 1, - 32, - {{64, 32, 0, 32}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 9, HYPER_THREADING_PROC, 9, -1}, - {10, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 11, HYPER_THREADING_PROC, 11, -1}, - {12, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 13, HYPER_THREADING_PROC, 13, -1}, - {14, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 15, HYPER_THREADING_PROC, 15, -1}, - {16, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 17, HYPER_THREADING_PROC, 17, -1}, - {18, 0, 18, HYPER_THREADING_PROC, 18, -1}, {19, 0, 19, HYPER_THREADING_PROC, 19, -1}, - {20, 0, 20, HYPER_THREADING_PROC, 20, -1}, {21, 0, 21, HYPER_THREADING_PROC, 21, -1}, - {22, 0, 22, HYPER_THREADING_PROC, 22, -1}, {23, 0, 23, HYPER_THREADING_PROC, 23, -1}, - {24, 0, 24, HYPER_THREADING_PROC, 24, -1}, {25, 0, 25, HYPER_THREADING_PROC, 25, -1}, - {26, 0, 26, HYPER_THREADING_PROC, 26, -1}, {27, 0, 27, HYPER_THREADING_PROC, 27, -1}, - {28, 0, 28, HYPER_THREADING_PROC, 28, -1}, {29, 0, 29, HYPER_THREADING_PROC, 29, -1}, - {30, 0, 30, HYPER_THREADING_PROC, 30, -1}, {31, 0, 31, HYPER_THREADING_PROC, 31, -1}, - {32, 0, 0, MAIN_CORE_PROC, 0, -1}, {33, 0, 1, MAIN_CORE_PROC, 1, -1}, - {34, 0, 2, MAIN_CORE_PROC, 2, -1}, {35, 0, 3, MAIN_CORE_PROC, 3, -1}, - {36, 0, 4, MAIN_CORE_PROC, 4, -1}, {37, 0, 5, MAIN_CORE_PROC, 5, -1}, - {38, 0, 6, MAIN_CORE_PROC, 6, -1}, {39, 0, 7, MAIN_CORE_PROC, 7, -1}, - {40, 0, 8, MAIN_CORE_PROC, 8, -1}, {41, 0, 9, MAIN_CORE_PROC, 9, -1}, - {42, 0, 10, MAIN_CORE_PROC, 10, -1}, {43, 0, 11, MAIN_CORE_PROC, 11, -1}, - {44, 0, 12, MAIN_CORE_PROC, 12, -1}, {45, 0, 13, MAIN_CORE_PROC, 13, -1}, - {46, 0, 14, MAIN_CORE_PROC, 14, -1}, {47, 0, 15, MAIN_CORE_PROC, 15, -1}, - {48, 0, 16, MAIN_CORE_PROC, 16, -1}, {49, 0, 17, MAIN_CORE_PROC, 17, -1}, - {50, 0, 18, MAIN_CORE_PROC, 18, -1}, {51, 0, 19, MAIN_CORE_PROC, 19, -1}, - {52, 0, 20, MAIN_CORE_PROC, 20, -1}, {53, 0, 21, MAIN_CORE_PROC, 21, -1}, - {54, 0, 22, MAIN_CORE_PROC, 22, -1}, {55, 0, 23, MAIN_CORE_PROC, 23, -1}, - {56, 0, 24, MAIN_CORE_PROC, 24, -1}, {57, 0, 25, MAIN_CORE_PROC, 25, -1}, - {58, 0, 26, MAIN_CORE_PROC, 26, -1}, {59, 0, 27, MAIN_CORE_PROC, 27, -1}, - {60, 0, 28, MAIN_CORE_PROC, 28, -1}, {61, 0, 29, MAIN_CORE_PROC, 29, -1}, - {62, 0, 30, MAIN_CORE_PROC, 30, -1}, {63, 0, 31, MAIN_CORE_PROC, 31, -1}, - }, - { - {"0,32", "0", "3400000"}, {"1,33", "0", "3400000"}, {"2,34", "0", "3400000"}, {"3,35", "0", "3400000"}, - {"4,36", "0", "3400000"}, {"5,37", "0", "3400000"}, {"6,38", "0", "3400000"}, {"7,39", "0", "3400000"}, - {"8,40", "0", "3400000"}, {"9,41", "0", "3400000"}, {"10,42", "0", "3400000"}, {"11,43", "0", "3400000"}, - {"12,44", "0", "3400000"}, {"13,45", "0", "3400000"}, {"14,46", "0", "3400000"}, {"15,47", "0", "3400000"}, - {"16,48", "0", "3400000"}, {"17,49", "0", "3400000"}, {"18,50", "0", "3400000"}, {"19,51", "0", "3400000"}, - {"20,52", "0", "3400000"}, {"21,53", "0", "3400000"}, {"22,54", "0", "3400000"}, {"23,55", "0", "3400000"}, - {"24,56", "0", "3400000"}, {"25,57", "0", "3400000"}, {"26,58", "0", "3400000"}, {"27,59", "0", "3400000"}, - {"28,60", "0", "3400000"}, {"29,61", "0", "3400000"}, {"30,62", "0", "3400000"}, {"31,63", "0", "3400000"}, - {"0,32", "0", "3400000"}, {"1,33", "0", "3400000"}, {"2,34", "0", "3400000"}, {"3,35", "0", "3400000"}, - {"4,36", "0", "3400000"}, {"5,37", "0", "3400000"}, {"6,38", "0", "3400000"}, {"7,39", "0", "3400000"}, - {"8,40", "0", "3400000"}, {"9,41", "0", "3400000"}, {"10,42", "0", "3400000"}, {"11,43", "0", "3400000"}, - {"12,44", "0", "3400000"}, {"13,45", "0", "3400000"}, {"14,46", "0", "3400000"}, {"15,47", "0", "3400000"}, - {"16,48", "0", "3400000"}, {"17,49", "0", "3400000"}, {"18,50", "0", "3400000"}, {"19,51", "0", "3400000"}, - {"20,52", "0", "3400000"}, {"21,53", "0", "3400000"}, {"22,54", "0", "3400000"}, {"23,55", "0", "3400000"}, - {"24,56", "0", "3400000"}, {"25,57", "0", "3400000"}, {"26,58", "0", "3400000"}, {"27,59", "0", "3400000"}, - {"28,60", "0", "3400000"}, {"29,61", "0", "3400000"}, {"30,62", "0", "3400000"}, {"31,63", "0", "3400000"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_16cores_hyperthreading = { - 24, - 1, - 16, - {{24, 8, 8, 8}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, - {20, 0, 12, EFFICIENT_CORE_PROC, 12, -1}, {21, 0, 13, EFFICIENT_CORE_PROC, 13, -1}, - {22, 0, 14, EFFICIENT_CORE_PROC, 14, -1}, {23, 0, 15, EFFICIENT_CORE_PROC, 15, -1}, - }, - { - {"0-1", "0", "5376760"}, {"0-1", "0", "5376760"}, {"2-3", "0", "5376760"}, {"2-3", "0", "5376760"}, - {"4-5", "0", "5376760"}, {"4-5", "0", "5376760"}, {"6-7", "0", "5376760"}, {"6-7", "0", "5376760"}, - {"8-9", "0", "5400000"}, {"8-9", "0", "5400000"}, {"10-11", "0", "5400000"}, {"10-11", "0", "5400000"}, - {"12-13", "0", "5376760"}, {"12-13", "0", "5376760"}, {"14-15", "0", "5376760"}, {"14-15", "0", "5376760"}, - {"16", "0", "4200000"}, {"17", "0", "4200000"}, {"18", "0", "4200000"}, {"19", "0", "4200000"}, - {"20", "0", "4200000"}, {"21", "0", "4200000"}, {"22", "0", "4200000"}, {"23", "0", "4200000"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_16cores = { - 16, - 1, - 16, - {{16, 8, 8, 0}}, - { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {1, 0, 1, MAIN_CORE_PROC, 1, -1}, - {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {3, 0, 3, MAIN_CORE_PROC, 3, -1}, - {4, 0, 4, MAIN_CORE_PROC, 4, -1}, - {5, 0, 5, MAIN_CORE_PROC, 5, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, - {7, 0, 7, MAIN_CORE_PROC, 7, -1}, - {8, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {9, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {10, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {11, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, - {12, 0, 12, EFFICIENT_CORE_PROC, 12, -1}, - {13, 0, 13, EFFICIENT_CORE_PROC, 13, -1}, - {14, 0, 14, EFFICIENT_CORE_PROC, 14, -1}, - {15, 0, 15, EFFICIENT_CORE_PROC, 15, -1}, - }, - { - {"0", "0", "5376760"}, - {"1", "0", "5376760"}, - {"2", "0", "5376760"}, - {"3", "0", "5376760"}, - {"4", "0", "5400000"}, - {"5", "0", "5400000"}, - {"6", "0", "5376760"}, - {"7", "0", "5376760"}, - {"8", "0", "4200000"}, - {"9", "0", "4200000"}, - {"10", "0", "4200000"}, - {"11", "0", "4200000"}, - {"12", "0", "4200000"}, - {"13", "0", "4200000"}, - {"14", "0", "4200000"}, - {"15", "0", "4200000"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_16cores_1_hyperthreading = { - 22, - 1, - 16, - {{22, 6, 10, 6}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 7, EFFICIENT_CORE_PROC, 7, -1}, - {14, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {15, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {16, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, {17, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, - {18, 0, 12, EFFICIENT_CORE_PROC, 12, -1}, {19, 0, 13, EFFICIENT_CORE_PROC, 13, -1}, - {20, 0, 14, EFFICIENT_CORE_PROC, 14, -1}, {21, 0, 15, EFFICIENT_CORE_PROC, 15, -1}, - }, - { - {"0-1", "2", "3200040"}, {"0-1", "2", "3200040"}, {"2-3", "3", "3200040"}, {"2-3", "3", "3200040"}, - {"4-5", "4", "3200040"}, {"4-5", "4", "3200040"}, {"6-7", "5", "3200040"}, {"6-7", "5", "3200040"}, - {"8-9", "6", "3200040"}, {"8-9", "6", "3200040"}, {"10-11", "7", "3200040"}, {"10-11", "7", "3200040"}, - {"12", "0", "3100000"}, {"13", "0", "3100000"}, {"14", "0", "3100000"}, {"15", "0", "3100000"}, - {"16", "1", "3100000"}, {"17", "1", "3100000"}, {"18", "1", "3100000"}, {"19", "1", "3100000"}, - {"20", "8", "1600011"}, {"21", "8", "1600011"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_12cores_hyperthreading = { - 14, - 1, - 12, - {{14, 2, 10, 2}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, EFFICIENT_CORE_PROC, 2, -1}, - {5, 0, 3, EFFICIENT_CORE_PROC, 3, -1}, - {6, 0, 4, EFFICIENT_CORE_PROC, 4, -1}, - {7, 0, 5, EFFICIENT_CORE_PROC, 5, -1}, - {8, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, - {9, 0, 7, EFFICIENT_CORE_PROC, 7, -1}, - {10, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {11, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {12, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {13, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, - }, - { - {"0-1", "2", "4100000"}, - {"0-1", "2", "4100000"}, - {"2-3", "3", "4100000"}, - {"2-3", "3", "4100000"}, - {"4", "0", "3100000"}, - {"5", "0", "3100000"}, - {"6", "0", "3100000"}, - {"7", "0", "3100000"}, - {"8", "1", "3100000"}, - {"9", "1", "3100000"}, - {"10", "1", "3100000"}, - {"11", "1", "3100000"}, - {"12", "8", "2100000"}, - {"13", "8", "2100000"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_8cores_hyperthreading = { - 16, - 1, - 8, - {{16, 8, 0, 8}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {13, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - }, - { - {"0-1", "0", "6100000"}, - {"0-1", "0", "6100000"}, - {"2-3", "0", "6100000"}, - {"2-3", "0", "6100000"}, - {"4-5", "0", "6100000"}, - {"4-5", "0", "6100000"}, - {"6-7", "0", "6100000"}, - {"6-7", "0", "6100000"}, - {"8-9", "0", "6300000"}, - {"8-9", "0", "6300000"}, - {"10-11", "0", "6300000"}, - {"10-11", "0", "6300000"}, - {"12-13", "0", "6100000"}, - {"12-13", "0", "6100000"}, - {"14-15", "0", "6100000"}, - {"14-15", "0", "6100000"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_8cores_1_hyperthreading = { - 16, - 1, - 8, - {{16, 8, 0, 8}}, - { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {3, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {5, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {7, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 0, MAIN_CORE_PROC, 0, -1}, - {9, 0, 1, MAIN_CORE_PROC, 1, -1}, - {10, 0, 2, MAIN_CORE_PROC, 2, -1}, - {11, 0, 3, MAIN_CORE_PROC, 3, -1}, - {12, 0, 4, MAIN_CORE_PROC, 4, -1}, - {13, 0, 5, MAIN_CORE_PROC, 5, -1}, - {14, 0, 6, MAIN_CORE_PROC, 6, -1}, - {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - }, - { - {"0,8", "0", "4700000"}, - {"1,9", "0", "4800000"}, - {"2,10", "0", "4800000"}, - {"3,11", "0", "4700000"}, - {"4,12", "0", "4700000"}, - {"5,13", "0", "4700000"}, - {"6,14", "0", "4700000"}, - {"7,15", "0", "4700000"}, - {"0,8", "0", "4700000"}, - {"1,9", "0", "4800000"}, - {"2,10", "0", "4800000"}, - {"3,11", "0", "4700000"}, - {"4,12", "0", "4700000"}, - {"5,13", "0", "4700000"}, - {"6,14", "0", "4700000"}, - {"7,15", "0", "4700000"}, - }, -}; -LinuxCpuMapTestCase freq_1sockets_4cores = { - 4, - 1, - 4, - {{4, 4, 0, 0}}, - { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {1, 0, 1, MAIN_CORE_PROC, 1, -1}, - {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {3, 0, 3, MAIN_CORE_PROC, 3, -1}, - }, - { - {"0", "0", "1800000"}, - {"1", "0", "1800000"}, - {"2", "0", "1800000"}, - {"3", "0", "1800000"}, - }, -}; - -TEST_P(LinuxCpuMapFreqParserTests, LinuxCpuMapFreq) {} - -INSTANTIATE_TEST_SUITE_P(CPUMap, - LinuxCpuMapFreqParserTests, - testing::Values(freq_2sockets_112cores_hyperthreading, - freq_2sockets_48cores_hyperthreading, - freq_2sockets_20cores_hyperthreading, - freq_2sockets_20cores, - freq_1sockets_32cores_hyperthreading, - freq_1sockets_16cores_hyperthreading, - freq_1sockets_16cores, - freq_1sockets_16cores_1_hyperthreading, - freq_1sockets_12cores_hyperthreading, - freq_1sockets_8cores_hyperthreading, - freq_1sockets_8cores_1_hyperthreading, - freq_1sockets_4cores)); - -#endif - #if defined(_WIN32) int Hex2Int(char c) { @@ -1317,6 +30,7 @@ void Hex2Bin(const char* hex, std::size_t sz, char* out) { struct WinCpuMapTestCase { int _processors; + int _numa_nodes; int _sockets; int _cores; std::vector> _proc_type_table; @@ -1339,6 +53,7 @@ public: Hex2Bin(test_ptr, test_len, test_info_ptr); int test_processors = 0; + int test_numa_nodes = 0; int test_sockets = 0; int test_cores = 0; unsigned long len = (unsigned long)(test_len / 2); @@ -1348,12 +63,14 @@ public: ov::parse_processor_info_win(test_info_ptr, len, test_processors, + test_numa_nodes, test_sockets, test_cores, test_proc_type_table, test_cpu_mapping_table); ASSERT_EQ(test_data._processors, test_processors); + ASSERT_EQ(test_data._numa_nodes, test_numa_nodes); ASSERT_EQ(test_data._sockets, test_sockets); ASSERT_EQ(test_data._cores, test_cores); ASSERT_EQ(test_data._proc_type_table, test_proc_type_table); @@ -1362,116 +79,119 @@ public: }; WinCpuMapTestCase _2sockets_104cores_hyperthreading = { - 208, - 2, - 104, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + 208, // param[expected out]: total 208 logcial processors on this simulated platform + 2, // param[expected out]: total 2 numa nodes on this simulated platform + 2, // param[expected out]: total 2 sockets on this simulated platform + 104, // param[expected out]: total 104 CPU cores on this simulated platform + {{208, 104, 0, 104, -1, -1}, + {104, 52, 0, 52, 0, 0}, + {104, 52, 0, 52, 1, 1}}, // param[expected out]: The proc_type_table of this simulated platform { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - {16, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 0, 8, MAIN_CORE_PROC, 8, -1}, - {18, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 0, 9, MAIN_CORE_PROC, 9, -1}, - {20, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 0, 10, MAIN_CORE_PROC, 10, -1}, - {22, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 0, 11, MAIN_CORE_PROC, 11, -1}, - {24, 0, 12, HYPER_THREADING_PROC, 12, -1}, {25, 0, 12, MAIN_CORE_PROC, 12, -1}, - {26, 0, 13, HYPER_THREADING_PROC, 13, -1}, {27, 0, 13, MAIN_CORE_PROC, 13, -1}, - {28, 0, 14, HYPER_THREADING_PROC, 14, -1}, {29, 0, 14, MAIN_CORE_PROC, 14, -1}, - {30, 0, 15, HYPER_THREADING_PROC, 15, -1}, {31, 0, 15, MAIN_CORE_PROC, 15, -1}, - {32, 0, 16, HYPER_THREADING_PROC, 16, -1}, {33, 0, 16, MAIN_CORE_PROC, 16, -1}, - {34, 0, 17, HYPER_THREADING_PROC, 17, -1}, {35, 0, 17, MAIN_CORE_PROC, 17, -1}, - {36, 0, 18, HYPER_THREADING_PROC, 18, -1}, {37, 0, 18, MAIN_CORE_PROC, 18, -1}, - {38, 0, 19, HYPER_THREADING_PROC, 19, -1}, {39, 0, 19, MAIN_CORE_PROC, 19, -1}, - {40, 0, 20, HYPER_THREADING_PROC, 20, -1}, {41, 0, 20, MAIN_CORE_PROC, 20, -1}, - {42, 0, 21, HYPER_THREADING_PROC, 21, -1}, {43, 0, 21, MAIN_CORE_PROC, 21, -1}, - {44, 0, 22, HYPER_THREADING_PROC, 22, -1}, {45, 0, 22, MAIN_CORE_PROC, 22, -1}, - {46, 0, 23, HYPER_THREADING_PROC, 23, -1}, {47, 0, 23, MAIN_CORE_PROC, 23, -1}, - {48, 0, 24, HYPER_THREADING_PROC, 24, -1}, {49, 0, 24, MAIN_CORE_PROC, 24, -1}, - {50, 0, 25, HYPER_THREADING_PROC, 25, -1}, {51, 0, 25, MAIN_CORE_PROC, 25, -1}, - {52, 0, 26, HYPER_THREADING_PROC, 26, -1}, {53, 0, 26, MAIN_CORE_PROC, 26, -1}, - {54, 0, 27, HYPER_THREADING_PROC, 27, -1}, {55, 0, 27, MAIN_CORE_PROC, 27, -1}, - {56, 0, 28, HYPER_THREADING_PROC, 28, -1}, {57, 0, 28, MAIN_CORE_PROC, 28, -1}, - {58, 0, 29, HYPER_THREADING_PROC, 29, -1}, {59, 0, 29, MAIN_CORE_PROC, 29, -1}, - {60, 0, 30, HYPER_THREADING_PROC, 30, -1}, {61, 0, 30, MAIN_CORE_PROC, 30, -1}, - {62, 0, 31, HYPER_THREADING_PROC, 31, -1}, {63, 0, 31, MAIN_CORE_PROC, 31, -1}, - {64, 0, 32, HYPER_THREADING_PROC, 32, -1}, {65, 0, 32, MAIN_CORE_PROC, 32, -1}, - {66, 0, 33, HYPER_THREADING_PROC, 33, -1}, {67, 0, 33, MAIN_CORE_PROC, 33, -1}, - {68, 0, 34, HYPER_THREADING_PROC, 34, -1}, {69, 0, 34, MAIN_CORE_PROC, 34, -1}, - {70, 0, 35, HYPER_THREADING_PROC, 35, -1}, {71, 0, 35, MAIN_CORE_PROC, 35, -1}, - {72, 0, 36, HYPER_THREADING_PROC, 36, -1}, {73, 0, 36, MAIN_CORE_PROC, 36, -1}, - {74, 0, 37, HYPER_THREADING_PROC, 37, -1}, {75, 0, 37, MAIN_CORE_PROC, 37, -1}, - {76, 0, 38, HYPER_THREADING_PROC, 38, -1}, {77, 0, 38, MAIN_CORE_PROC, 38, -1}, - {78, 0, 39, HYPER_THREADING_PROC, 39, -1}, {79, 0, 39, MAIN_CORE_PROC, 39, -1}, - {80, 0, 40, HYPER_THREADING_PROC, 40, -1}, {81, 0, 40, MAIN_CORE_PROC, 40, -1}, - {82, 0, 41, HYPER_THREADING_PROC, 41, -1}, {83, 0, 41, MAIN_CORE_PROC, 41, -1}, - {84, 0, 42, HYPER_THREADING_PROC, 42, -1}, {85, 0, 42, MAIN_CORE_PROC, 42, -1}, - {86, 0, 43, HYPER_THREADING_PROC, 43, -1}, {87, 0, 43, MAIN_CORE_PROC, 43, -1}, - {88, 0, 44, HYPER_THREADING_PROC, 44, -1}, {89, 0, 44, MAIN_CORE_PROC, 44, -1}, - {90, 0, 45, HYPER_THREADING_PROC, 45, -1}, {91, 0, 45, MAIN_CORE_PROC, 45, -1}, - {92, 0, 46, HYPER_THREADING_PROC, 46, -1}, {93, 0, 46, MAIN_CORE_PROC, 46, -1}, - {94, 0, 47, HYPER_THREADING_PROC, 47, -1}, {95, 0, 47, MAIN_CORE_PROC, 47, -1}, - {96, 0, 48, HYPER_THREADING_PROC, 48, -1}, {97, 0, 48, MAIN_CORE_PROC, 48, -1}, - {98, 0, 49, HYPER_THREADING_PROC, 49, -1}, {99, 0, 49, MAIN_CORE_PROC, 49, -1}, - {100, 0, 50, HYPER_THREADING_PROC, 50, -1}, {101, 0, 50, MAIN_CORE_PROC, 50, -1}, - {102, 0, 51, HYPER_THREADING_PROC, 51, -1}, {103, 0, 51, MAIN_CORE_PROC, 51, -1}, - {104, 1, 52, HYPER_THREADING_PROC, 52, -1}, {105, 1, 52, MAIN_CORE_PROC, 52, -1}, - {106, 1, 53, HYPER_THREADING_PROC, 53, -1}, {107, 1, 53, MAIN_CORE_PROC, 53, -1}, - {108, 1, 54, HYPER_THREADING_PROC, 54, -1}, {109, 1, 54, MAIN_CORE_PROC, 54, -1}, - {110, 1, 55, HYPER_THREADING_PROC, 55, -1}, {111, 1, 55, MAIN_CORE_PROC, 55, -1}, - {112, 1, 56, HYPER_THREADING_PROC, 56, -1}, {113, 1, 56, MAIN_CORE_PROC, 56, -1}, - {114, 1, 57, HYPER_THREADING_PROC, 57, -1}, {115, 1, 57, MAIN_CORE_PROC, 57, -1}, - {116, 1, 58, HYPER_THREADING_PROC, 58, -1}, {117, 1, 58, MAIN_CORE_PROC, 58, -1}, - {118, 1, 59, HYPER_THREADING_PROC, 59, -1}, {119, 1, 59, MAIN_CORE_PROC, 59, -1}, - {120, 1, 60, HYPER_THREADING_PROC, 60, -1}, {121, 1, 60, MAIN_CORE_PROC, 60, -1}, - {122, 1, 61, HYPER_THREADING_PROC, 61, -1}, {123, 1, 61, MAIN_CORE_PROC, 61, -1}, - {124, 1, 62, HYPER_THREADING_PROC, 62, -1}, {125, 1, 62, MAIN_CORE_PROC, 62, -1}, - {126, 1, 63, HYPER_THREADING_PROC, 63, -1}, {127, 1, 63, MAIN_CORE_PROC, 63, -1}, - {128, 1, 64, HYPER_THREADING_PROC, 64, -1}, {129, 1, 64, MAIN_CORE_PROC, 64, -1}, - {130, 1, 65, HYPER_THREADING_PROC, 65, -1}, {131, 1, 65, MAIN_CORE_PROC, 65, -1}, - {132, 1, 66, HYPER_THREADING_PROC, 66, -1}, {133, 1, 66, MAIN_CORE_PROC, 66, -1}, - {134, 1, 67, HYPER_THREADING_PROC, 67, -1}, {135, 1, 67, MAIN_CORE_PROC, 67, -1}, - {136, 1, 68, HYPER_THREADING_PROC, 68, -1}, {137, 1, 68, MAIN_CORE_PROC, 68, -1}, - {138, 1, 69, HYPER_THREADING_PROC, 69, -1}, {139, 1, 69, MAIN_CORE_PROC, 69, -1}, - {140, 1, 70, HYPER_THREADING_PROC, 70, -1}, {141, 1, 70, MAIN_CORE_PROC, 70, -1}, - {142, 1, 71, HYPER_THREADING_PROC, 71, -1}, {143, 1, 71, MAIN_CORE_PROC, 71, -1}, - {144, 1, 72, HYPER_THREADING_PROC, 72, -1}, {145, 1, 72, MAIN_CORE_PROC, 72, -1}, - {146, 1, 73, HYPER_THREADING_PROC, 73, -1}, {147, 1, 73, MAIN_CORE_PROC, 73, -1}, - {148, 1, 74, HYPER_THREADING_PROC, 74, -1}, {149, 1, 74, MAIN_CORE_PROC, 74, -1}, - {150, 1, 75, HYPER_THREADING_PROC, 75, -1}, {151, 1, 75, MAIN_CORE_PROC, 75, -1}, - {152, 1, 76, HYPER_THREADING_PROC, 76, -1}, {153, 1, 76, MAIN_CORE_PROC, 76, -1}, - {154, 1, 77, HYPER_THREADING_PROC, 77, -1}, {155, 1, 77, MAIN_CORE_PROC, 77, -1}, - {156, 1, 78, HYPER_THREADING_PROC, 78, -1}, {157, 1, 78, MAIN_CORE_PROC, 78, -1}, - {158, 1, 79, HYPER_THREADING_PROC, 79, -1}, {159, 1, 79, MAIN_CORE_PROC, 79, -1}, - {160, 1, 80, HYPER_THREADING_PROC, 80, -1}, {161, 1, 80, MAIN_CORE_PROC, 80, -1}, - {162, 1, 81, HYPER_THREADING_PROC, 81, -1}, {163, 1, 81, MAIN_CORE_PROC, 81, -1}, - {164, 1, 82, HYPER_THREADING_PROC, 82, -1}, {165, 1, 82, MAIN_CORE_PROC, 82, -1}, - {166, 1, 83, HYPER_THREADING_PROC, 83, -1}, {167, 1, 83, MAIN_CORE_PROC, 83, -1}, - {168, 1, 84, HYPER_THREADING_PROC, 84, -1}, {169, 1, 84, MAIN_CORE_PROC, 84, -1}, - {170, 1, 85, HYPER_THREADING_PROC, 85, -1}, {171, 1, 85, MAIN_CORE_PROC, 85, -1}, - {172, 1, 86, HYPER_THREADING_PROC, 86, -1}, {173, 1, 86, MAIN_CORE_PROC, 86, -1}, - {174, 1, 87, HYPER_THREADING_PROC, 87, -1}, {175, 1, 87, MAIN_CORE_PROC, 87, -1}, - {176, 1, 88, HYPER_THREADING_PROC, 88, -1}, {177, 1, 88, MAIN_CORE_PROC, 88, -1}, - {178, 1, 89, HYPER_THREADING_PROC, 89, -1}, {179, 1, 89, MAIN_CORE_PROC, 89, -1}, - {180, 1, 90, HYPER_THREADING_PROC, 90, -1}, {181, 1, 90, MAIN_CORE_PROC, 90, -1}, - {182, 1, 91, HYPER_THREADING_PROC, 91, -1}, {183, 1, 91, MAIN_CORE_PROC, 91, -1}, - {184, 1, 92, HYPER_THREADING_PROC, 92, -1}, {185, 1, 92, MAIN_CORE_PROC, 92, -1}, - {186, 1, 93, HYPER_THREADING_PROC, 93, -1}, {187, 1, 93, MAIN_CORE_PROC, 93, -1}, - {188, 1, 94, HYPER_THREADING_PROC, 94, -1}, {189, 1, 94, MAIN_CORE_PROC, 94, -1}, - {190, 1, 95, HYPER_THREADING_PROC, 95, -1}, {191, 1, 95, MAIN_CORE_PROC, 95, -1}, - {192, 1, 96, HYPER_THREADING_PROC, 96, -1}, {193, 1, 96, MAIN_CORE_PROC, 96, -1}, - {194, 1, 97, HYPER_THREADING_PROC, 97, -1}, {195, 1, 97, MAIN_CORE_PROC, 97, -1}, - {196, 1, 98, HYPER_THREADING_PROC, 98, -1}, {197, 1, 98, MAIN_CORE_PROC, 98, -1}, - {198, 1, 99, HYPER_THREADING_PROC, 99, -1}, {199, 1, 99, MAIN_CORE_PROC, 99, -1}, - {200, 1, 100, HYPER_THREADING_PROC, 100, -1}, {201, 1, 100, MAIN_CORE_PROC, 100, -1}, - {202, 1, 101, HYPER_THREADING_PROC, 101, -1}, {203, 1, 101, MAIN_CORE_PROC, 101, -1}, - {204, 1, 102, HYPER_THREADING_PROC, 102, -1}, {205, 1, 102, MAIN_CORE_PROC, 102, -1}, - {206, 1, 103, HYPER_THREADING_PROC, 103, -1}, {207, 1, 103, MAIN_CORE_PROC, 103, -1}, - }, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {16, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, + {18, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {20, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, + {22, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {24, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {25, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, + {26, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, {27, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {28, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {29, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, + {30, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, {31, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {32, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {33, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, + {34, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, {35, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {36, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {37, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, + {38, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, {39, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {40, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {41, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, + {42, 0, 0, 21, HYPER_THREADING_PROC, 21, -1}, {43, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {44, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {45, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, + {46, 0, 0, 23, HYPER_THREADING_PROC, 23, -1}, {47, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {48, 0, 0, 24, HYPER_THREADING_PROC, 24, -1}, {49, 0, 0, 24, MAIN_CORE_PROC, 24, -1}, + {50, 0, 0, 25, HYPER_THREADING_PROC, 25, -1}, {51, 0, 0, 25, MAIN_CORE_PROC, 25, -1}, + {52, 0, 0, 26, HYPER_THREADING_PROC, 26, -1}, {53, 0, 0, 26, MAIN_CORE_PROC, 26, -1}, + {54, 0, 0, 27, HYPER_THREADING_PROC, 27, -1}, {55, 0, 0, 27, MAIN_CORE_PROC, 27, -1}, + {56, 0, 0, 28, HYPER_THREADING_PROC, 28, -1}, {57, 0, 0, 28, MAIN_CORE_PROC, 28, -1}, + {58, 0, 0, 29, HYPER_THREADING_PROC, 29, -1}, {59, 0, 0, 29, MAIN_CORE_PROC, 29, -1}, + {60, 0, 0, 30, HYPER_THREADING_PROC, 30, -1}, {61, 0, 0, 30, MAIN_CORE_PROC, 30, -1}, + {62, 0, 0, 31, HYPER_THREADING_PROC, 31, -1}, {63, 0, 0, 31, MAIN_CORE_PROC, 31, -1}, + {64, 0, 0, 32, HYPER_THREADING_PROC, 32, -1}, {65, 0, 0, 32, MAIN_CORE_PROC, 32, -1}, + {66, 0, 0, 33, HYPER_THREADING_PROC, 33, -1}, {67, 0, 0, 33, MAIN_CORE_PROC, 33, -1}, + {68, 0, 0, 34, HYPER_THREADING_PROC, 34, -1}, {69, 0, 0, 34, MAIN_CORE_PROC, 34, -1}, + {70, 0, 0, 35, HYPER_THREADING_PROC, 35, -1}, {71, 0, 0, 35, MAIN_CORE_PROC, 35, -1}, + {72, 0, 0, 36, HYPER_THREADING_PROC, 36, -1}, {73, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, + {74, 0, 0, 37, HYPER_THREADING_PROC, 37, -1}, {75, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {76, 0, 0, 38, HYPER_THREADING_PROC, 38, -1}, {77, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, + {78, 0, 0, 39, HYPER_THREADING_PROC, 39, -1}, {79, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + {80, 0, 0, 40, HYPER_THREADING_PROC, 40, -1}, {81, 0, 0, 40, MAIN_CORE_PROC, 40, -1}, + {82, 0, 0, 41, HYPER_THREADING_PROC, 41, -1}, {83, 0, 0, 41, MAIN_CORE_PROC, 41, -1}, + {84, 0, 0, 42, HYPER_THREADING_PROC, 42, -1}, {85, 0, 0, 42, MAIN_CORE_PROC, 42, -1}, + {86, 0, 0, 43, HYPER_THREADING_PROC, 43, -1}, {87, 0, 0, 43, MAIN_CORE_PROC, 43, -1}, + {88, 0, 0, 44, HYPER_THREADING_PROC, 44, -1}, {89, 0, 0, 44, MAIN_CORE_PROC, 44, -1}, + {90, 0, 0, 45, HYPER_THREADING_PROC, 45, -1}, {91, 0, 0, 45, MAIN_CORE_PROC, 45, -1}, + {92, 0, 0, 46, HYPER_THREADING_PROC, 46, -1}, {93, 0, 0, 46, MAIN_CORE_PROC, 46, -1}, + {94, 0, 0, 47, HYPER_THREADING_PROC, 47, -1}, {95, 0, 0, 47, MAIN_CORE_PROC, 47, -1}, + {96, 0, 0, 48, HYPER_THREADING_PROC, 48, -1}, {97, 0, 0, 48, MAIN_CORE_PROC, 48, -1}, + {98, 0, 0, 49, HYPER_THREADING_PROC, 49, -1}, {99, 0, 0, 49, MAIN_CORE_PROC, 49, -1}, + {100, 0, 0, 50, HYPER_THREADING_PROC, 50, -1}, {101, 0, 0, 50, MAIN_CORE_PROC, 50, -1}, + {102, 0, 0, 51, HYPER_THREADING_PROC, 51, -1}, {103, 0, 0, 51, MAIN_CORE_PROC, 51, -1}, + {104, 1, 1, 52, HYPER_THREADING_PROC, 52, -1}, {105, 1, 1, 52, MAIN_CORE_PROC, 52, -1}, + {106, 1, 1, 53, HYPER_THREADING_PROC, 53, -1}, {107, 1, 1, 53, MAIN_CORE_PROC, 53, -1}, + {108, 1, 1, 54, HYPER_THREADING_PROC, 54, -1}, {109, 1, 1, 54, MAIN_CORE_PROC, 54, -1}, + {110, 1, 1, 55, HYPER_THREADING_PROC, 55, -1}, {111, 1, 1, 55, MAIN_CORE_PROC, 55, -1}, + {112, 1, 1, 56, HYPER_THREADING_PROC, 56, -1}, {113, 1, 1, 56, MAIN_CORE_PROC, 56, -1}, + {114, 1, 1, 57, HYPER_THREADING_PROC, 57, -1}, {115, 1, 1, 57, MAIN_CORE_PROC, 57, -1}, + {116, 1, 1, 58, HYPER_THREADING_PROC, 58, -1}, {117, 1, 1, 58, MAIN_CORE_PROC, 58, -1}, + {118, 1, 1, 59, HYPER_THREADING_PROC, 59, -1}, {119, 1, 1, 59, MAIN_CORE_PROC, 59, -1}, + {120, 1, 1, 60, HYPER_THREADING_PROC, 60, -1}, {121, 1, 1, 60, MAIN_CORE_PROC, 60, -1}, + {122, 1, 1, 61, HYPER_THREADING_PROC, 61, -1}, {123, 1, 1, 61, MAIN_CORE_PROC, 61, -1}, + {124, 1, 1, 62, HYPER_THREADING_PROC, 62, -1}, {125, 1, 1, 62, MAIN_CORE_PROC, 62, -1}, + {126, 1, 1, 63, HYPER_THREADING_PROC, 63, -1}, {127, 1, 1, 63, MAIN_CORE_PROC, 63, -1}, + {128, 1, 1, 64, HYPER_THREADING_PROC, 64, -1}, {129, 1, 1, 64, MAIN_CORE_PROC, 64, -1}, + {130, 1, 1, 65, HYPER_THREADING_PROC, 65, -1}, {131, 1, 1, 65, MAIN_CORE_PROC, 65, -1}, + {132, 1, 1, 66, HYPER_THREADING_PROC, 66, -1}, {133, 1, 1, 66, MAIN_CORE_PROC, 66, -1}, + {134, 1, 1, 67, HYPER_THREADING_PROC, 67, -1}, {135, 1, 1, 67, MAIN_CORE_PROC, 67, -1}, + {136, 1, 1, 68, HYPER_THREADING_PROC, 68, -1}, {137, 1, 1, 68, MAIN_CORE_PROC, 68, -1}, + {138, 1, 1, 69, HYPER_THREADING_PROC, 69, -1}, {139, 1, 1, 69, MAIN_CORE_PROC, 69, -1}, + {140, 1, 1, 70, HYPER_THREADING_PROC, 70, -1}, {141, 1, 1, 70, MAIN_CORE_PROC, 70, -1}, + {142, 1, 1, 71, HYPER_THREADING_PROC, 71, -1}, {143, 1, 1, 71, MAIN_CORE_PROC, 71, -1}, + {144, 1, 1, 72, HYPER_THREADING_PROC, 72, -1}, {145, 1, 1, 72, MAIN_CORE_PROC, 72, -1}, + {146, 1, 1, 73, HYPER_THREADING_PROC, 73, -1}, {147, 1, 1, 73, MAIN_CORE_PROC, 73, -1}, + {148, 1, 1, 74, HYPER_THREADING_PROC, 74, -1}, {149, 1, 1, 74, MAIN_CORE_PROC, 74, -1}, + {150, 1, 1, 75, HYPER_THREADING_PROC, 75, -1}, {151, 1, 1, 75, MAIN_CORE_PROC, 75, -1}, + {152, 1, 1, 76, HYPER_THREADING_PROC, 76, -1}, {153, 1, 1, 76, MAIN_CORE_PROC, 76, -1}, + {154, 1, 1, 77, HYPER_THREADING_PROC, 77, -1}, {155, 1, 1, 77, MAIN_CORE_PROC, 77, -1}, + {156, 1, 1, 78, HYPER_THREADING_PROC, 78, -1}, {157, 1, 1, 78, MAIN_CORE_PROC, 78, -1}, + {158, 1, 1, 79, HYPER_THREADING_PROC, 79, -1}, {159, 1, 1, 79, MAIN_CORE_PROC, 79, -1}, + {160, 1, 1, 80, HYPER_THREADING_PROC, 80, -1}, {161, 1, 1, 80, MAIN_CORE_PROC, 80, -1}, + {162, 1, 1, 81, HYPER_THREADING_PROC, 81, -1}, {163, 1, 1, 81, MAIN_CORE_PROC, 81, -1}, + {164, 1, 1, 82, HYPER_THREADING_PROC, 82, -1}, {165, 1, 1, 82, MAIN_CORE_PROC, 82, -1}, + {166, 1, 1, 83, HYPER_THREADING_PROC, 83, -1}, {167, 1, 1, 83, MAIN_CORE_PROC, 83, -1}, + {168, 1, 1, 84, HYPER_THREADING_PROC, 84, -1}, {169, 1, 1, 84, MAIN_CORE_PROC, 84, -1}, + {170, 1, 1, 85, HYPER_THREADING_PROC, 85, -1}, {171, 1, 1, 85, MAIN_CORE_PROC, 85, -1}, + {172, 1, 1, 86, HYPER_THREADING_PROC, 86, -1}, {173, 1, 1, 86, MAIN_CORE_PROC, 86, -1}, + {174, 1, 1, 87, HYPER_THREADING_PROC, 87, -1}, {175, 1, 1, 87, MAIN_CORE_PROC, 87, -1}, + {176, 1, 1, 88, HYPER_THREADING_PROC, 88, -1}, {177, 1, 1, 88, MAIN_CORE_PROC, 88, -1}, + {178, 1, 1, 89, HYPER_THREADING_PROC, 89, -1}, {179, 1, 1, 89, MAIN_CORE_PROC, 89, -1}, + {180, 1, 1, 90, HYPER_THREADING_PROC, 90, -1}, {181, 1, 1, 90, MAIN_CORE_PROC, 90, -1}, + {182, 1, 1, 91, HYPER_THREADING_PROC, 91, -1}, {183, 1, 1, 91, MAIN_CORE_PROC, 91, -1}, + {184, 1, 1, 92, HYPER_THREADING_PROC, 92, -1}, {185, 1, 1, 92, MAIN_CORE_PROC, 92, -1}, + {186, 1, 1, 93, HYPER_THREADING_PROC, 93, -1}, {187, 1, 1, 93, MAIN_CORE_PROC, 93, -1}, + {188, 1, 1, 94, HYPER_THREADING_PROC, 94, -1}, {189, 1, 1, 94, MAIN_CORE_PROC, 94, -1}, + {190, 1, 1, 95, HYPER_THREADING_PROC, 95, -1}, {191, 1, 1, 95, MAIN_CORE_PROC, 95, -1}, + {192, 1, 1, 96, HYPER_THREADING_PROC, 96, -1}, {193, 1, 1, 96, MAIN_CORE_PROC, 96, -1}, + {194, 1, 1, 97, HYPER_THREADING_PROC, 97, -1}, {195, 1, 1, 97, MAIN_CORE_PROC, 97, -1}, + {196, 1, 1, 98, HYPER_THREADING_PROC, 98, -1}, {197, 1, 1, 98, MAIN_CORE_PROC, 98, -1}, + {198, 1, 1, 99, HYPER_THREADING_PROC, 99, -1}, {199, 1, 1, 99, MAIN_CORE_PROC, 99, -1}, + {200, 1, 1, 100, HYPER_THREADING_PROC, 100, -1}, {201, 1, 1, 100, MAIN_CORE_PROC, 100, -1}, + {202, 1, 1, 101, HYPER_THREADING_PROC, 101, -1}, {203, 1, 1, 101, MAIN_CORE_PROC, 101, -1}, + {204, 1, 1, 102, HYPER_THREADING_PROC, 102, -1}, {205, 1, 1, 102, MAIN_CORE_PROC, 102, -1}, + {206, 1, 1, 103, HYPER_THREADING_PROC, 103, -1}, {207, 1, 1, 103, MAIN_CORE_PROC, 103, -1}, + }, // param[expected out]: The cpu_mapping_table of this simulated platform {"0300000040000000000000000000000000000000000000000000000000000200ffffffffffffffff0000000000000000ffffffffff0000000" "10000000000000000000000300000000100000000000000000000000000000000000000000001000300000000000000000000000000000007" "00000030000000000000000000000000000000000000000000000000000100030000000000000000000000000000000200000038000000010" @@ -1969,63 +689,64 @@ WinCpuMapTestCase _2sockets_104cores_hyperthreading = { "0000000000000000000000000000000000ffffffffffffffff282800000000000000000000000000000000000000000000000000000000000" "00000000000000000ffffffffff00000040400000000000000000000000000000000000000000000000000000000000000000000000000000" "ffffffffffffffff28280000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffff00000" - "0"}, + "0"}, // param[in]: The CPU information string of this simulated platform }; WinCpuMapTestCase _2sockets_48cores_hyperthreading = { 96, 2, + 2, 48, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - {16, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 0, 8, MAIN_CORE_PROC, 8, -1}, - {18, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 0, 9, MAIN_CORE_PROC, 9, -1}, - {20, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 0, 10, MAIN_CORE_PROC, 10, -1}, - {22, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 0, 11, MAIN_CORE_PROC, 11, -1}, - {24, 0, 12, HYPER_THREADING_PROC, 12, -1}, {25, 0, 12, MAIN_CORE_PROC, 12, -1}, - {26, 0, 13, HYPER_THREADING_PROC, 13, -1}, {27, 0, 13, MAIN_CORE_PROC, 13, -1}, - {28, 0, 14, HYPER_THREADING_PROC, 14, -1}, {29, 0, 14, MAIN_CORE_PROC, 14, -1}, - {30, 0, 15, HYPER_THREADING_PROC, 15, -1}, {31, 0, 15, MAIN_CORE_PROC, 15, -1}, - {32, 0, 16, HYPER_THREADING_PROC, 16, -1}, {33, 0, 16, MAIN_CORE_PROC, 16, -1}, - {34, 0, 17, HYPER_THREADING_PROC, 17, -1}, {35, 0, 17, MAIN_CORE_PROC, 17, -1}, - {36, 0, 18, HYPER_THREADING_PROC, 18, -1}, {37, 0, 18, MAIN_CORE_PROC, 18, -1}, - {38, 0, 19, HYPER_THREADING_PROC, 19, -1}, {39, 0, 19, MAIN_CORE_PROC, 19, -1}, - {40, 0, 20, HYPER_THREADING_PROC, 20, -1}, {41, 0, 20, MAIN_CORE_PROC, 20, -1}, - {42, 0, 21, HYPER_THREADING_PROC, 21, -1}, {43, 0, 21, MAIN_CORE_PROC, 21, -1}, - {44, 0, 22, HYPER_THREADING_PROC, 22, -1}, {45, 0, 22, MAIN_CORE_PROC, 22, -1}, - {46, 0, 23, HYPER_THREADING_PROC, 23, -1}, {47, 0, 23, MAIN_CORE_PROC, 23, -1}, - {48, 1, 24, HYPER_THREADING_PROC, 24, -1}, {49, 1, 24, MAIN_CORE_PROC, 24, -1}, - {50, 1, 25, HYPER_THREADING_PROC, 25, -1}, {51, 1, 25, MAIN_CORE_PROC, 25, -1}, - {52, 1, 26, HYPER_THREADING_PROC, 26, -1}, {53, 1, 26, MAIN_CORE_PROC, 26, -1}, - {54, 1, 27, HYPER_THREADING_PROC, 27, -1}, {55, 1, 27, MAIN_CORE_PROC, 27, -1}, - {56, 1, 28, HYPER_THREADING_PROC, 28, -1}, {57, 1, 28, MAIN_CORE_PROC, 28, -1}, - {58, 1, 29, HYPER_THREADING_PROC, 29, -1}, {59, 1, 29, MAIN_CORE_PROC, 29, -1}, - {60, 1, 30, HYPER_THREADING_PROC, 30, -1}, {61, 1, 30, MAIN_CORE_PROC, 30, -1}, - {62, 1, 31, HYPER_THREADING_PROC, 31, -1}, {63, 1, 31, MAIN_CORE_PROC, 31, -1}, - {64, 1, 32, HYPER_THREADING_PROC, 32, -1}, {65, 1, 32, MAIN_CORE_PROC, 32, -1}, - {66, 1, 33, HYPER_THREADING_PROC, 33, -1}, {67, 1, 33, MAIN_CORE_PROC, 33, -1}, - {68, 1, 34, HYPER_THREADING_PROC, 34, -1}, {69, 1, 34, MAIN_CORE_PROC, 34, -1}, - {70, 1, 35, HYPER_THREADING_PROC, 35, -1}, {71, 1, 35, MAIN_CORE_PROC, 35, -1}, - {72, 1, 36, HYPER_THREADING_PROC, 36, -1}, {73, 1, 36, MAIN_CORE_PROC, 36, -1}, - {74, 1, 37, HYPER_THREADING_PROC, 37, -1}, {75, 1, 37, MAIN_CORE_PROC, 37, -1}, - {76, 1, 38, HYPER_THREADING_PROC, 38, -1}, {77, 1, 38, MAIN_CORE_PROC, 38, -1}, - {78, 1, 39, HYPER_THREADING_PROC, 39, -1}, {79, 1, 39, MAIN_CORE_PROC, 39, -1}, - {80, 1, 40, HYPER_THREADING_PROC, 40, -1}, {81, 1, 40, MAIN_CORE_PROC, 40, -1}, - {82, 1, 41, HYPER_THREADING_PROC, 41, -1}, {83, 1, 41, MAIN_CORE_PROC, 41, -1}, - {84, 1, 42, HYPER_THREADING_PROC, 42, -1}, {85, 1, 42, MAIN_CORE_PROC, 42, -1}, - {86, 1, 43, HYPER_THREADING_PROC, 43, -1}, {87, 1, 43, MAIN_CORE_PROC, 43, -1}, - {88, 1, 44, HYPER_THREADING_PROC, 44, -1}, {89, 1, 44, MAIN_CORE_PROC, 44, -1}, - {90, 1, 45, HYPER_THREADING_PROC, 45, -1}, {91, 1, 45, MAIN_CORE_PROC, 45, -1}, - {92, 1, 46, HYPER_THREADING_PROC, 46, -1}, {93, 1, 46, MAIN_CORE_PROC, 46, -1}, - {94, 1, 47, HYPER_THREADING_PROC, 47, -1}, {95, 1, 47, MAIN_CORE_PROC, 47, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {16, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, + {18, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {20, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, + {22, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {24, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {25, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, + {26, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, {27, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {28, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {29, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, + {30, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, {31, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {32, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {33, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, + {34, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, {35, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {36, 0, 0, 18, HYPER_THREADING_PROC, 18, -1}, {37, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, + {38, 0, 0, 19, HYPER_THREADING_PROC, 19, -1}, {39, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {40, 0, 0, 20, HYPER_THREADING_PROC, 20, -1}, {41, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, + {42, 0, 0, 21, HYPER_THREADING_PROC, 21, -1}, {43, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {44, 0, 0, 22, HYPER_THREADING_PROC, 22, -1}, {45, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, + {46, 0, 0, 23, HYPER_THREADING_PROC, 23, -1}, {47, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {48, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {49, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, + {50, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, {51, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {52, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {53, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, + {54, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, {55, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {56, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {57, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, + {58, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, {59, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {60, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {61, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, + {62, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, {63, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {64, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {65, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, + {66, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, {67, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {68, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {69, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, + {70, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, {71, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {72, 1, 1, 36, HYPER_THREADING_PROC, 36, -1}, {73, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, + {74, 1, 1, 37, HYPER_THREADING_PROC, 37, -1}, {75, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {76, 1, 1, 38, HYPER_THREADING_PROC, 38, -1}, {77, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, + {78, 1, 1, 39, HYPER_THREADING_PROC, 39, -1}, {79, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {80, 1, 1, 40, HYPER_THREADING_PROC, 40, -1}, {81, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, + {82, 1, 1, 41, HYPER_THREADING_PROC, 41, -1}, {83, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {84, 1, 1, 42, HYPER_THREADING_PROC, 42, -1}, {85, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, + {86, 1, 1, 43, HYPER_THREADING_PROC, 43, -1}, {87, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {88, 1, 1, 44, HYPER_THREADING_PROC, 44, -1}, {89, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, + {90, 1, 1, 45, HYPER_THREADING_PROC, 45, -1}, {91, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {92, 1, 1, 46, HYPER_THREADING_PROC, 46, -1}, {93, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, + {94, 1, 1, 47, HYPER_THREADING_PROC, 47, -1}, {95, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffffffffffff0000000000000000000000000000300000000" "10000000000000000000000000000000000000000000100030000000000000000000000000000000700000030000000000000000000000000" @@ -2264,45 +985,46 @@ WinCpuMapTestCase _2sockets_48cores_hyperthreading = { WinCpuMapTestCase _2sockets_36cores_hyperthreading = { 72, 2, + 2, 36, - {{72, 36, 0, 36}, {36, 18, 0, 18}, {36, 18, 0, 18}}, + {{72, 36, 0, 36, -1, -1}, {36, 18, 0, 18, 0, 0}, {36, 18, 0, 18, 1, 1}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - {16, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 0, 8, MAIN_CORE_PROC, 8, -1}, - {18, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 0, 9, MAIN_CORE_PROC, 9, -1}, - {20, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 0, 10, MAIN_CORE_PROC, 10, -1}, - {22, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 0, 11, MAIN_CORE_PROC, 11, -1}, - {24, 0, 12, HYPER_THREADING_PROC, 12, -1}, {25, 0, 12, MAIN_CORE_PROC, 12, -1}, - {26, 0, 13, HYPER_THREADING_PROC, 13, -1}, {27, 0, 13, MAIN_CORE_PROC, 13, -1}, - {28, 0, 14, HYPER_THREADING_PROC, 14, -1}, {29, 0, 14, MAIN_CORE_PROC, 14, -1}, - {30, 0, 15, HYPER_THREADING_PROC, 15, -1}, {31, 0, 15, MAIN_CORE_PROC, 15, -1}, - {32, 0, 16, HYPER_THREADING_PROC, 16, -1}, {33, 0, 16, MAIN_CORE_PROC, 16, -1}, - {34, 0, 17, HYPER_THREADING_PROC, 17, -1}, {35, 0, 17, MAIN_CORE_PROC, 17, -1}, - {36, 1, 18, HYPER_THREADING_PROC, 18, -1}, {37, 1, 18, MAIN_CORE_PROC, 18, -1}, - {38, 1, 19, HYPER_THREADING_PROC, 19, -1}, {39, 1, 19, MAIN_CORE_PROC, 19, -1}, - {40, 1, 20, HYPER_THREADING_PROC, 20, -1}, {41, 1, 20, MAIN_CORE_PROC, 20, -1}, - {42, 1, 21, HYPER_THREADING_PROC, 21, -1}, {43, 1, 21, MAIN_CORE_PROC, 21, -1}, - {44, 1, 22, HYPER_THREADING_PROC, 22, -1}, {45, 1, 22, MAIN_CORE_PROC, 22, -1}, - {46, 1, 23, HYPER_THREADING_PROC, 23, -1}, {47, 1, 23, MAIN_CORE_PROC, 23, -1}, - {48, 1, 24, HYPER_THREADING_PROC, 24, -1}, {49, 1, 24, MAIN_CORE_PROC, 24, -1}, - {50, 1, 25, HYPER_THREADING_PROC, 25, -1}, {51, 1, 25, MAIN_CORE_PROC, 25, -1}, - {52, 1, 26, HYPER_THREADING_PROC, 26, -1}, {53, 1, 26, MAIN_CORE_PROC, 26, -1}, - {54, 1, 27, HYPER_THREADING_PROC, 27, -1}, {55, 1, 27, MAIN_CORE_PROC, 27, -1}, - {56, 1, 28, HYPER_THREADING_PROC, 28, -1}, {57, 1, 28, MAIN_CORE_PROC, 28, -1}, - {58, 1, 29, HYPER_THREADING_PROC, 29, -1}, {59, 1, 29, MAIN_CORE_PROC, 29, -1}, - {60, 1, 30, HYPER_THREADING_PROC, 30, -1}, {61, 1, 30, MAIN_CORE_PROC, 30, -1}, - {62, 1, 31, HYPER_THREADING_PROC, 31, -1}, {63, 1, 31, MAIN_CORE_PROC, 31, -1}, - {64, 1, 32, HYPER_THREADING_PROC, 32, -1}, {65, 1, 32, MAIN_CORE_PROC, 32, -1}, - {66, 1, 33, HYPER_THREADING_PROC, 33, -1}, {67, 1, 33, MAIN_CORE_PROC, 33, -1}, - {68, 1, 34, HYPER_THREADING_PROC, 34, -1}, {69, 1, 34, MAIN_CORE_PROC, 34, -1}, - {70, 1, 35, HYPER_THREADING_PROC, 35, -1}, {71, 1, 35, MAIN_CORE_PROC, 35, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {16, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {17, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, + {18, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, {19, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {20, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {21, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, + {22, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, {23, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {24, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {25, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, + {26, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, {27, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {28, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {29, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, + {30, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, {31, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {32, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {33, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, + {34, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, {35, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {36, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {37, 1, 1, 18, MAIN_CORE_PROC, 18, -1}, + {38, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, {39, 1, 1, 19, MAIN_CORE_PROC, 19, -1}, + {40, 1, 1, 20, HYPER_THREADING_PROC, 20, -1}, {41, 1, 1, 20, MAIN_CORE_PROC, 20, -1}, + {42, 1, 1, 21, HYPER_THREADING_PROC, 21, -1}, {43, 1, 1, 21, MAIN_CORE_PROC, 21, -1}, + {44, 1, 1, 22, HYPER_THREADING_PROC, 22, -1}, {45, 1, 1, 22, MAIN_CORE_PROC, 22, -1}, + {46, 1, 1, 23, HYPER_THREADING_PROC, 23, -1}, {47, 1, 1, 23, MAIN_CORE_PROC, 23, -1}, + {48, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {49, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, + {50, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, {51, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {52, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {53, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, + {54, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, {55, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {56, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {57, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, + {58, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, {59, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {60, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {61, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, + {62, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, {63, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {64, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {65, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, + {66, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, {67, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {68, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {69, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, + {70, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, {71, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffffffff0f000000000000000000000000000000300000000" "10000000000000000000000000000000000000000000100030000000000000000000000000000000200000038000000010c400000c0000002" @@ -2455,25 +1177,34 @@ WinCpuMapTestCase _2sockets_36cores_hyperthreading = { WinCpuMapTestCase _2sockets_48cores = { 48, 2, + 2, 48, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 1, MAIN_CORE_PROC, 1, -1}, {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {3, 0, 3, MAIN_CORE_PROC, 3, -1}, {4, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 5, MAIN_CORE_PROC, 5, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 7, MAIN_CORE_PROC, 7, -1}, {8, 0, 8, MAIN_CORE_PROC, 8, -1}, - {9, 0, 9, MAIN_CORE_PROC, 9, -1}, {10, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 11, MAIN_CORE_PROC, 11, -1}, - {12, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 13, MAIN_CORE_PROC, 13, -1}, {14, 0, 14, MAIN_CORE_PROC, 14, -1}, - {15, 0, 15, MAIN_CORE_PROC, 15, -1}, {16, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 17, MAIN_CORE_PROC, 17, -1}, - {18, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 19, MAIN_CORE_PROC, 19, -1}, {20, 0, 20, MAIN_CORE_PROC, 20, -1}, - {21, 0, 21, MAIN_CORE_PROC, 21, -1}, {22, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 23, MAIN_CORE_PROC, 23, -1}, - {24, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 25, MAIN_CORE_PROC, 25, -1}, {26, 1, 26, MAIN_CORE_PROC, 26, -1}, - {27, 1, 27, MAIN_CORE_PROC, 27, -1}, {28, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 29, MAIN_CORE_PROC, 29, -1}, - {30, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 31, MAIN_CORE_PROC, 31, -1}, {32, 1, 32, MAIN_CORE_PROC, 32, -1}, - {33, 1, 33, MAIN_CORE_PROC, 33, -1}, {34, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 35, MAIN_CORE_PROC, 35, -1}, - {36, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 37, MAIN_CORE_PROC, 37, -1}, {38, 1, 38, MAIN_CORE_PROC, 38, -1}, - {39, 1, 39, MAIN_CORE_PROC, 39, -1}, {40, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 41, MAIN_CORE_PROC, 41, -1}, - {42, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 43, MAIN_CORE_PROC, 43, -1}, {44, 1, 44, MAIN_CORE_PROC, 44, -1}, - {45, 1, 45, MAIN_CORE_PROC, 45, -1}, {46, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 47, MAIN_CORE_PROC, 47, -1}, + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {8, 0, 0, 8, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 9, MAIN_CORE_PROC, 9, -1}, + {10, 0, 0, 10, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 11, MAIN_CORE_PROC, 11, -1}, + {12, 0, 0, 12, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 13, MAIN_CORE_PROC, 13, -1}, + {14, 0, 0, 14, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 15, MAIN_CORE_PROC, 15, -1}, + {16, 0, 0, 16, MAIN_CORE_PROC, 16, -1}, {17, 0, 0, 17, MAIN_CORE_PROC, 17, -1}, + {18, 0, 0, 18, MAIN_CORE_PROC, 18, -1}, {19, 0, 0, 19, MAIN_CORE_PROC, 19, -1}, + {20, 0, 0, 20, MAIN_CORE_PROC, 20, -1}, {21, 0, 0, 21, MAIN_CORE_PROC, 21, -1}, + {22, 0, 0, 22, MAIN_CORE_PROC, 22, -1}, {23, 0, 0, 23, MAIN_CORE_PROC, 23, -1}, + {24, 1, 1, 24, MAIN_CORE_PROC, 24, -1}, {25, 1, 1, 25, MAIN_CORE_PROC, 25, -1}, + {26, 1, 1, 26, MAIN_CORE_PROC, 26, -1}, {27, 1, 1, 27, MAIN_CORE_PROC, 27, -1}, + {28, 1, 1, 28, MAIN_CORE_PROC, 28, -1}, {29, 1, 1, 29, MAIN_CORE_PROC, 29, -1}, + {30, 1, 1, 30, MAIN_CORE_PROC, 30, -1}, {31, 1, 1, 31, MAIN_CORE_PROC, 31, -1}, + {32, 1, 1, 32, MAIN_CORE_PROC, 32, -1}, {33, 1, 1, 33, MAIN_CORE_PROC, 33, -1}, + {34, 1, 1, 34, MAIN_CORE_PROC, 34, -1}, {35, 1, 1, 35, MAIN_CORE_PROC, 35, -1}, + {36, 1, 1, 36, MAIN_CORE_PROC, 36, -1}, {37, 1, 1, 37, MAIN_CORE_PROC, 37, -1}, + {38, 1, 1, 38, MAIN_CORE_PROC, 38, -1}, {39, 1, 1, 39, MAIN_CORE_PROC, 39, -1}, + {40, 1, 1, 40, MAIN_CORE_PROC, 40, -1}, {41, 1, 1, 41, MAIN_CORE_PROC, 41, -1}, + {42, 1, 1, 42, MAIN_CORE_PROC, 42, -1}, {43, 1, 1, 43, MAIN_CORE_PROC, 43, -1}, + {44, 1, 1, 44, MAIN_CORE_PROC, 44, -1}, {45, 1, 1, 45, MAIN_CORE_PROC, 45, -1}, + {46, 1, 1, 46, MAIN_CORE_PROC, 46, -1}, {47, 1, 1, 47, MAIN_CORE_PROC, 47, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffffff0000000000000000000000000000000000300000000" "00000000000000000000000000000000000000000000100010000000000000000000000000000000700000030000000000000000000000000" @@ -2712,25 +1443,26 @@ WinCpuMapTestCase _2sockets_48cores = { WinCpuMapTestCase _1sockets_24cores_hyperthreading_set1 = { 32, 1, + 1, 24, - {{32, 8, 16, 8}}, + {{32, 8, 16, 8, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {17, 0, 9, EFFICIENT_CORE_PROC, 8, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 8, -1}, {19, 0, 11, EFFICIENT_CORE_PROC, 8, -1}, - {20, 0, 12, EFFICIENT_CORE_PROC, 9, -1}, {21, 0, 13, EFFICIENT_CORE_PROC, 9, -1}, - {22, 0, 14, EFFICIENT_CORE_PROC, 9, -1}, {23, 0, 15, EFFICIENT_CORE_PROC, 9, -1}, - {24, 0, 16, EFFICIENT_CORE_PROC, 10, -1}, {25, 0, 17, EFFICIENT_CORE_PROC, 10, -1}, - {26, 0, 18, EFFICIENT_CORE_PROC, 10, -1}, {27, 0, 19, EFFICIENT_CORE_PROC, 10, -1}, - {28, 0, 20, EFFICIENT_CORE_PROC, 11, -1}, {29, 0, 21, EFFICIENT_CORE_PROC, 11, -1}, - {30, 0, 22, EFFICIENT_CORE_PROC, 11, -1}, {31, 0, 23, EFFICIENT_CORE_PROC, 11, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 8, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 8, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 8, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 9, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 9, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 9, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 9, -1}, + {24, 0, 0, 16, EFFICIENT_CORE_PROC, 10, -1}, {25, 0, 0, 17, EFFICIENT_CORE_PROC, 10, -1}, + {26, 0, 0, 18, EFFICIENT_CORE_PROC, 10, -1}, {27, 0, 0, 19, EFFICIENT_CORE_PROC, 10, -1}, + {28, 0, 0, 20, EFFICIENT_CORE_PROC, 11, -1}, {29, 0, 0, 21, EFFICIENT_CORE_PROC, 11, -1}, + {30, 0, 0, 22, EFFICIENT_CORE_PROC, 11, -1}, {31, 0, 0, 23, EFFICIENT_CORE_PROC, 11, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffffffff00000000000000000000000000000000300000000" "10100000000000000000000000000000000000000000100030000000000000000000000000000000200000038000000010c400000c0000002" @@ -2821,25 +1553,26 @@ WinCpuMapTestCase _1sockets_24cores_hyperthreading_set1 = { WinCpuMapTestCase _1sockets_24cores_hyperthreading_set2 = { 32, 1, + 1, 24, - {{32, 8, 16, 8}}, + {{32, 8, 16, 8, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 7, MAIN_CORE_PROC, 7, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {17, 0, 9, EFFICIENT_CORE_PROC, 8, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 8, -1}, {19, 0, 11, EFFICIENT_CORE_PROC, 8, -1}, - {20, 0, 12, EFFICIENT_CORE_PROC, 9, -1}, {21, 0, 13, EFFICIENT_CORE_PROC, 9, -1}, - {22, 0, 14, EFFICIENT_CORE_PROC, 9, -1}, {23, 0, 15, EFFICIENT_CORE_PROC, 9, -1}, - {24, 0, 16, EFFICIENT_CORE_PROC, 10, -1}, {25, 0, 17, EFFICIENT_CORE_PROC, 10, -1}, - {26, 0, 18, EFFICIENT_CORE_PROC, 10, -1}, {27, 0, 19, EFFICIENT_CORE_PROC, 10, -1}, - {28, 0, 20, EFFICIENT_CORE_PROC, 11, -1}, {29, 0, 21, EFFICIENT_CORE_PROC, 11, -1}, - {30, 0, 22, EFFICIENT_CORE_PROC, 11, -1}, {31, 0, 23, EFFICIENT_CORE_PROC, 11, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {13, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, {15, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 8, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 8, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 8, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 9, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 9, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 9, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 9, -1}, + {24, 0, 0, 16, EFFICIENT_CORE_PROC, 10, -1}, {25, 0, 0, 17, EFFICIENT_CORE_PROC, 10, -1}, + {26, 0, 0, 18, EFFICIENT_CORE_PROC, 10, -1}, {27, 0, 0, 19, EFFICIENT_CORE_PROC, 10, -1}, + {28, 0, 0, 20, EFFICIENT_CORE_PROC, 11, -1}, {29, 0, 0, 21, EFFICIENT_CORE_PROC, 11, -1}, + {30, 0, 0, 22, EFFICIENT_CORE_PROC, 11, -1}, {31, 0, 0, 23, EFFICIENT_CORE_PROC, 11, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffffffff00000000000000000000000000000000300000000" "10100000000000000000000000000000000000000000100030000000000000000000000000000000700000030000000000000000000000000" @@ -2941,20 +1674,21 @@ WinCpuMapTestCase _1sockets_24cores_hyperthreading_set2 = { WinCpuMapTestCase _1sockets_22cores_hyperthreading = { 22, 1, + 1, 16, - {{22, 6, 10, 6}}, + {{22, 6, 10, 6, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, EFFICIENT_CORE_PROC, 1, -1}, {3, 0, 2, EFFICIENT_CORE_PROC, 1, -1}, - {4, 0, 3, EFFICIENT_CORE_PROC, 1, -1}, {5, 0, 4, EFFICIENT_CORE_PROC, 1, -1}, - {6, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, {7, 0, 6, EFFICIENT_CORE_PROC, 2, -1}, - {8, 0, 7, EFFICIENT_CORE_PROC, 2, -1}, {9, 0, 8, EFFICIENT_CORE_PROC, 2, -1}, - {10, 0, 9, HYPER_THREADING_PROC, 3, -1}, {11, 0, 9, MAIN_CORE_PROC, 3, -1}, - {12, 0, 10, HYPER_THREADING_PROC, 4, -1}, {13, 0, 10, MAIN_CORE_PROC, 4, -1}, - {14, 0, 11, HYPER_THREADING_PROC, 5, -1}, {15, 0, 11, MAIN_CORE_PROC, 5, -1}, - {16, 0, 12, HYPER_THREADING_PROC, 6, -1}, {17, 0, 12, MAIN_CORE_PROC, 6, -1}, - {18, 0, 13, HYPER_THREADING_PROC, 7, -1}, {19, 0, 13, MAIN_CORE_PROC, 7, -1}, - {20, 0, 14, EFFICIENT_CORE_PROC, 8, -1}, {21, 0, 15, EFFICIENT_CORE_PROC, 8, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, EFFICIENT_CORE_PROC, 1, -1}, {3, 0, 0, 2, EFFICIENT_CORE_PROC, 1, -1}, + {4, 0, 0, 3, EFFICIENT_CORE_PROC, 1, -1}, {5, 0, 0, 4, EFFICIENT_CORE_PROC, 1, -1}, + {6, 0, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, {7, 0, 0, 6, EFFICIENT_CORE_PROC, 2, -1}, + {8, 0, 0, 7, EFFICIENT_CORE_PROC, 2, -1}, {9, 0, 0, 8, EFFICIENT_CORE_PROC, 2, -1}, + {10, 0, 0, 9, HYPER_THREADING_PROC, 3, -1}, {11, 0, 0, 9, MAIN_CORE_PROC, 3, -1}, + {12, 0, 0, 10, HYPER_THREADING_PROC, 4, -1}, {13, 0, 0, 10, MAIN_CORE_PROC, 4, -1}, + {14, 0, 0, 11, HYPER_THREADING_PROC, 5, -1}, {15, 0, 0, 11, MAIN_CORE_PROC, 5, -1}, + {16, 0, 0, 12, HYPER_THREADING_PROC, 6, -1}, {17, 0, 0, 12, MAIN_CORE_PROC, 6, -1}, + {18, 0, 0, 13, HYPER_THREADING_PROC, 7, -1}, {19, 0, 0, 13, MAIN_CORE_PROC, 7, -1}, + {20, 0, 0, 14, EFFICIENT_CORE_PROC, 8, -1}, {21, 0, 0, 15, EFFICIENT_CORE_PROC, 8, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffff3f0000000000000000000000000000000000300000000" "10100000000000000000000000000000000000000000100030000000000000000000000000000000700000030000000000000000000000000" @@ -3027,19 +1761,20 @@ WinCpuMapTestCase _1sockets_22cores_hyperthreading = { WinCpuMapTestCase _1sockets_14cores_hyperthreading_set1 = { 20, 1, + 1, 14, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 7, EFFICIENT_CORE_PROC, 6, -1}, - {14, 0, 8, EFFICIENT_CORE_PROC, 6, -1}, {15, 0, 9, EFFICIENT_CORE_PROC, 6, -1}, - {16, 0, 10, EFFICIENT_CORE_PROC, 7, -1}, {17, 0, 11, EFFICIENT_CORE_PROC, 7, -1}, - {18, 0, 12, EFFICIENT_CORE_PROC, 7, -1}, {19, 0, 13, EFFICIENT_CORE_PROC, 7, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 0, 7, EFFICIENT_CORE_PROC, 6, -1}, + {14, 0, 0, 8, EFFICIENT_CORE_PROC, 6, -1}, {15, 0, 0, 9, EFFICIENT_CORE_PROC, 6, -1}, + {16, 0, 0, 10, EFFICIENT_CORE_PROC, 7, -1}, {17, 0, 0, 11, EFFICIENT_CORE_PROC, 7, -1}, + {18, 0, 0, 12, EFFICIENT_CORE_PROC, 7, -1}, {19, 0, 0, 13, EFFICIENT_CORE_PROC, 7, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffff0f0000000000000000000000000000000000300000000" "10100000000000000000000000000000000000000000100030000000000000000000000000000000200000038000000010c400000c0000002" @@ -3098,19 +1833,20 @@ WinCpuMapTestCase _1sockets_14cores_hyperthreading_set1 = { WinCpuMapTestCase _1sockets_14cores_hyperthreading_set2 = { 20, 1, + 1, 14, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, EFFICIENT_CORE_PROC, 1, -1}, {3, 0, 2, EFFICIENT_CORE_PROC, 1, -1}, - {4, 0, 3, EFFICIENT_CORE_PROC, 1, -1}, {5, 0, 4, EFFICIENT_CORE_PROC, 1, -1}, - {6, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, {7, 0, 6, EFFICIENT_CORE_PROC, 2, -1}, - {8, 0, 7, EFFICIENT_CORE_PROC, 2, -1}, {9, 0, 8, EFFICIENT_CORE_PROC, 2, -1}, - {10, 0, 9, HYPER_THREADING_PROC, 3, -1}, {11, 0, 9, MAIN_CORE_PROC, 3, -1}, - {12, 0, 10, HYPER_THREADING_PROC, 4, -1}, {13, 0, 10, MAIN_CORE_PROC, 4, -1}, - {14, 0, 11, HYPER_THREADING_PROC, 5, -1}, {15, 0, 11, MAIN_CORE_PROC, 5, -1}, - {16, 0, 12, HYPER_THREADING_PROC, 6, -1}, {17, 0, 12, MAIN_CORE_PROC, 6, -1}, - {18, 0, 13, HYPER_THREADING_PROC, 7, -1}, {19, 0, 13, MAIN_CORE_PROC, 7, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, EFFICIENT_CORE_PROC, 1, -1}, {3, 0, 0, 2, EFFICIENT_CORE_PROC, 1, -1}, + {4, 0, 0, 3, EFFICIENT_CORE_PROC, 1, -1}, {5, 0, 0, 4, EFFICIENT_CORE_PROC, 1, -1}, + {6, 0, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, {7, 0, 0, 6, EFFICIENT_CORE_PROC, 2, -1}, + {8, 0, 0, 7, EFFICIENT_CORE_PROC, 2, -1}, {9, 0, 0, 8, EFFICIENT_CORE_PROC, 2, -1}, + {10, 0, 0, 9, HYPER_THREADING_PROC, 3, -1}, {11, 0, 0, 9, MAIN_CORE_PROC, 3, -1}, + {12, 0, 0, 10, HYPER_THREADING_PROC, 4, -1}, {13, 0, 0, 10, MAIN_CORE_PROC, 4, -1}, + {14, 0, 0, 11, HYPER_THREADING_PROC, 5, -1}, {15, 0, 0, 11, MAIN_CORE_PROC, 5, -1}, + {16, 0, 0, 12, HYPER_THREADING_PROC, 6, -1}, {17, 0, 0, 12, MAIN_CORE_PROC, 6, -1}, + {18, 0, 0, 13, HYPER_THREADING_PROC, 7, -1}, {19, 0, 0, 13, MAIN_CORE_PROC, 7, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffff0f0000000000000000000000000000000000300000000" "10100000000000000000000000000000000000000000100030000000000000000000000000000000700000030000000000000000000000000" @@ -3176,19 +1912,20 @@ WinCpuMapTestCase _1sockets_14cores_hyperthreading_set2 = { WinCpuMapTestCase _1sockets_14cores_hyperthreading_set3 = { 20, 1, + 1, 14, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 7, EFFICIENT_CORE_PROC, 6, -1}, - {14, 0, 8, EFFICIENT_CORE_PROC, 6, -1}, {15, 0, 9, EFFICIENT_CORE_PROC, 6, -1}, - {16, 0, 10, EFFICIENT_CORE_PROC, 7, -1}, {17, 0, 11, EFFICIENT_CORE_PROC, 7, -1}, - {18, 0, 12, EFFICIENT_CORE_PROC, 7, -1}, {19, 0, 13, EFFICIENT_CORE_PROC, 7, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {9, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, {11, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, EFFICIENT_CORE_PROC, 6, -1}, {13, 0, 0, 7, EFFICIENT_CORE_PROC, 6, -1}, + {14, 0, 0, 8, EFFICIENT_CORE_PROC, 6, -1}, {15, 0, 0, 9, EFFICIENT_CORE_PROC, 6, -1}, + {16, 0, 0, 10, EFFICIENT_CORE_PROC, 7, -1}, {17, 0, 0, 11, EFFICIENT_CORE_PROC, 7, -1}, + {18, 0, 0, 12, EFFICIENT_CORE_PROC, 7, -1}, {19, 0, 0, 13, EFFICIENT_CORE_PROC, 7, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ffff0f0000000000000000000000000000000000300000000" "10100000000000000000000000000000000000000000100030000000000000000000000000000000700000030000000000000000000000000" @@ -3254,21 +1991,22 @@ WinCpuMapTestCase _1sockets_14cores_hyperthreading_set3 = { WinCpuMapTestCase _1sockets_10cores_hyperthreading = { 12, 1, + 1, 10, - {{12, 2, 8, 2}}, + {{12, 2, 8, 2, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, EFFICIENT_CORE_PROC, 1, -1}, - {3, 0, 2, EFFICIENT_CORE_PROC, 1, -1}, - {4, 0, 3, EFFICIENT_CORE_PROC, 1, -1}, - {5, 0, 4, EFFICIENT_CORE_PROC, 1, -1}, - {6, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, - {7, 0, 6, EFFICIENT_CORE_PROC, 2, -1}, - {8, 0, 7, EFFICIENT_CORE_PROC, 2, -1}, - {9, 0, 8, EFFICIENT_CORE_PROC, 2, -1}, - {10, 0, 9, HYPER_THREADING_PROC, 3, -1}, - {11, 0, 9, MAIN_CORE_PROC, 3, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, EFFICIENT_CORE_PROC, 1, -1}, + {3, 0, 0, 2, EFFICIENT_CORE_PROC, 1, -1}, + {4, 0, 0, 3, EFFICIENT_CORE_PROC, 1, -1}, + {5, 0, 0, 4, EFFICIENT_CORE_PROC, 1, -1}, + {6, 0, 0, 5, EFFICIENT_CORE_PROC, 2, -1}, + {7, 0, 0, 6, EFFICIENT_CORE_PROC, 2, -1}, + {8, 0, 0, 7, EFFICIENT_CORE_PROC, 2, -1}, + {9, 0, 0, 8, EFFICIENT_CORE_PROC, 2, -1}, + {10, 0, 0, 9, HYPER_THREADING_PROC, 3, -1}, + {11, 0, 0, 9, MAIN_CORE_PROC, 3, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ff0f000000000000000000000000000000000000300000000" "10100000000000000000000000000000000000000000100030000000000000000000000000000000700000030000000000000000000000000" @@ -3315,17 +2053,18 @@ WinCpuMapTestCase _1sockets_10cores_hyperthreading = { WinCpuMapTestCase _1sockets_4cores_hyperthreading = { 8, 1, + 1, 4, - {{8, 4, 0, 4}}, + {{8, 4, 0, 4, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, }, {"0300000030000000000000000000000000000000000000000000000000000100ff00000000000000000000000000000000000000300000000" "10000000000000000000000000000000000000000000100030000000000000000000000000000000200000038000000010840000080000002" @@ -3349,7 +2088,7 @@ WinCpuMapTestCase _1sockets_4cores_hyperthreading = { "00000000000000000000000000000ff00000000000000"}, }; -TEST_P(WinCpuMapParserTests, WinCpuMap) {} +TEST_P(WinCpuMapParserTests, WinCache) {} INSTANTIATE_TEST_SUITE_P(CPUMap, WinCpuMapParserTests, diff --git a/src/inference/tests/unit/cpu_map_parser/valid_proc_check.cpp b/src/inference/tests/unit/cpu_map_parser/valid_proc_check.cpp index 89e57124cb2..7ffe8b08f3b 100644 --- a/src/inference/tests/unit/cpu_map_parser/valid_proc_check.cpp +++ b/src/inference/tests/unit/cpu_map_parser/valid_proc_check.cpp @@ -7,7 +7,7 @@ #include #include "ie_system_conf.h" -#include "streams_executor.hpp" +#include "os/cpu_map_info.hpp" using namespace testing; using namespace ov; @@ -53,366 +53,366 @@ public: LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_1 = { {}, // param[in]: The logical processors selected in this simulation case does not include the physical core of // Pcore - {{40, 20, 0, 20}, - {20, 10, 0, 10}, - {20, 10, 0, 10}}, // param[in]: The proc_type_table of simulated platform which is 2 sockets, 20 Pcores - // and 40 logical processors with hyper-threading enabled. + {{40, 20, 0, 20, -1, -1}, + {20, 10, 0, 10, 0, 0}, + {20, 10, 0, 10, 1, 1}}, // param[in]: The proc_type_table of simulated platform which is 2 sockets, 20 Pcores + // and 40 logical processors with hyper-threading enabled. { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, }, // param[in]: This simulation case select logcial processor 0, 2, 4 and 6 which is marked as logcial core of // Pcore in original cpu_mapping_table. 1, // param[expected out]: Since all selected logical processors are in one socket, the number of sockets changes // to 1. 4, // param[expected out]: Since only 4 logical processors are selected, the number of cores changes to 4. - {{4, 4, 0, 0}}, // param[expected out]: The proc_type_table changes to 4 Pcores only + {{4, 4, 0, 0, 0, 0}}, // param[expected out]: The proc_type_table changes to 4 Pcores only { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {4, 0, 4, MAIN_CORE_PROC, 4, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, }, // param[expected out]: cpu_mapping_table changes to physical core of Pcore. }; LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_2 = { {1, 3, 5, 7}, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, { - {21, 0, 1, MAIN_CORE_PROC, 1, -1}, - {23, 0, 3, MAIN_CORE_PROC, 3, -1}, - {25, 0, 5, MAIN_CORE_PROC, 5, -1}, - {27, 0, 7, MAIN_CORE_PROC, 7, -1}, + {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, }, 1, 4, - {{4, 4, 0, 0}}, + {{4, 4, 0, 0, 0, 0}}, { - {21, 0, 1, MAIN_CORE_PROC, 1, -1}, - {23, 0, 3, MAIN_CORE_PROC, 3, -1}, - {25, 0, 5, MAIN_CORE_PROC, 5, -1}, - {27, 0, 7, MAIN_CORE_PROC, 7, -1}, + {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, }, }; LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_3 = { {1, 3, 5, 7}, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {21, 0, 1, MAIN_CORE_PROC, 1, -1}, - {23, 0, 3, MAIN_CORE_PROC, 3, -1}, - {25, 0, 5, MAIN_CORE_PROC, 5, -1}, - {27, 0, 7, MAIN_CORE_PROC, 7, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, }, 1, 8, - {{8, 8, 0, 0}}, + {{8, 8, 0, 0, 0, 0}}, { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {4, 0, 4, MAIN_CORE_PROC, 4, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, - {21, 0, 1, MAIN_CORE_PROC, 1, -1}, - {23, 0, 3, MAIN_CORE_PROC, 3, -1}, - {25, 0, 5, MAIN_CORE_PROC, 5, -1}, - {27, 0, 7, MAIN_CORE_PROC, 7, -1}, + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {21, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {23, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {25, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {27, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, }, }; LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_4 = { {0, 2, 4, 6}, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, }, 1, 4, - {{8, 4, 0, 4}}, + {{8, 4, 0, 4, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, }, }; LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_5 = { {}, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {10, 1, 10, HYPER_THREADING_PROC, 10, -1}, - {12, 1, 12, HYPER_THREADING_PROC, 12, -1}, - {14, 1, 14, HYPER_THREADING_PROC, 14, -1}, - {16, 1, 16, HYPER_THREADING_PROC, 16, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, }, 2, 8, - {{8, 8, 0, 0}, {4, 4, 0, 0}, {4, 4, 0, 0}}, + {{8, 8, 0, 0, -1, -1}, {4, 4, 0, 0, 0, 0}, {4, 4, 0, 0, 1, 1}}, { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {4, 0, 4, MAIN_CORE_PROC, 4, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, - {10, 1, 10, MAIN_CORE_PROC, 10, -1}, - {12, 1, 12, MAIN_CORE_PROC, 12, -1}, - {14, 1, 14, MAIN_CORE_PROC, 14, -1}, - {16, 1, 16, MAIN_CORE_PROC, 16, -1}, + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {10, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, + {12, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, + {14, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, + {16, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, }, }; LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_6 = { {0, 2, 4, 6, 10, 12, 14, 16}, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, { - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, - {30, 1, 10, MAIN_CORE_PROC, 10, -1}, - {32, 1, 12, MAIN_CORE_PROC, 12, -1}, - {34, 1, 14, MAIN_CORE_PROC, 14, -1}, - {36, 1, 16, MAIN_CORE_PROC, 16, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, }, 2, 8, - {{8, 8, 0, 0}, {4, 4, 0, 0}, {4, 4, 0, 0}}, + {{8, 8, 0, 0, -1, -1}, {4, 4, 0, 0, 0, 0}, {4, 4, 0, 0, 1, 1}}, { - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, - {30, 1, 10, MAIN_CORE_PROC, 10, -1}, - {32, 1, 12, MAIN_CORE_PROC, 12, -1}, - {34, 1, 14, MAIN_CORE_PROC, 14, -1}, - {36, 1, 16, MAIN_CORE_PROC, 16, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, }, }; LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_7 = { {0, 2, 4, 6}, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, { - {10, 1, 10, HYPER_THREADING_PROC, 10, -1}, - {12, 1, 12, HYPER_THREADING_PROC, 12, -1}, - {14, 1, 14, HYPER_THREADING_PROC, 14, -1}, - {16, 1, 16, HYPER_THREADING_PROC, 16, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, }, 2, 8, - {{8, 8, 0, 0}, {4, 4, 0, 0}, {4, 4, 0, 0}}, + {{8, 8, 0, 0, -1, -1}, {4, 4, 0, 0, 0, 0}, {4, 4, 0, 0, 1, 1}}, { - {10, 1, 10, MAIN_CORE_PROC, 10, -1}, - {12, 1, 12, MAIN_CORE_PROC, 12, -1}, - {14, 1, 14, MAIN_CORE_PROC, 14, -1}, - {16, 1, 16, MAIN_CORE_PROC, 16, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, + {10, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, + {12, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, + {14, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, + {16, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, }, }; LinuxNumactlTestCase numactl_2sockets_20cores_hyperthreading_8 = { {0, 2, 4, 6, 10, 12, 14, 16}, - {{40, 20, 0, 20}, {20, 10, 0, 10}, {20, 10, 0, 10}}, + {{40, 20, 0, 20, -1, -1}, {20, 10, 0, 10, 0, 0}, {20, 10, 0, 10, 1, 1}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {10, 1, 10, HYPER_THREADING_PROC, 10, -1}, - {12, 1, 12, HYPER_THREADING_PROC, 12, -1}, - {14, 1, 14, HYPER_THREADING_PROC, 14, -1}, - {16, 1, 16, HYPER_THREADING_PROC, 16, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, - {30, 1, 10, MAIN_CORE_PROC, 10, -1}, - {32, 1, 12, MAIN_CORE_PROC, 12, -1}, - {34, 1, 14, MAIN_CORE_PROC, 14, -1}, - {36, 1, 16, MAIN_CORE_PROC, 16, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, }, 2, 8, - {{16, 8, 0, 8}, {8, 4, 0, 4}, {8, 4, 0, 4}}, + {{16, 8, 0, 8, -1, -1}, {8, 4, 0, 4, 0, 0}, {8, 4, 0, 4, 1, 1}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {10, 1, 10, HYPER_THREADING_PROC, 10, -1}, - {12, 1, 12, HYPER_THREADING_PROC, 12, -1}, - {14, 1, 14, HYPER_THREADING_PROC, 14, -1}, - {16, 1, 16, HYPER_THREADING_PROC, 16, -1}, - {20, 0, 0, MAIN_CORE_PROC, 0, -1}, - {22, 0, 2, MAIN_CORE_PROC, 2, -1}, - {24, 0, 4, MAIN_CORE_PROC, 4, -1}, - {26, 0, 6, MAIN_CORE_PROC, 6, -1}, - {30, 1, 10, MAIN_CORE_PROC, 10, -1}, - {32, 1, 12, MAIN_CORE_PROC, 12, -1}, - {34, 1, 14, MAIN_CORE_PROC, 14, -1}, - {36, 1, 16, MAIN_CORE_PROC, 16, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {10, 1, 1, 10, HYPER_THREADING_PROC, 10, -1}, + {12, 1, 1, 12, HYPER_THREADING_PROC, 12, -1}, + {14, 1, 1, 14, HYPER_THREADING_PROC, 14, -1}, + {16, 1, 1, 16, HYPER_THREADING_PROC, 16, -1}, + {20, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {22, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {24, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {26, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {30, 1, 1, 10, MAIN_CORE_PROC, 10, -1}, + {32, 1, 1, 12, MAIN_CORE_PROC, 12, -1}, + {34, 1, 1, 14, MAIN_CORE_PROC, 14, -1}, + {36, 1, 1, 16, MAIN_CORE_PROC, 16, -1}, }, }; LinuxNumactlTestCase numactl_1sockets_16cores_hyperthreading_1 = { {}, - {{24, 8, 8, 8}}, + {{24, 8, 8, 8, 0, 0}}, { - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, 1, 4, - {{4, 0, 4, 0}}, + {{4, 0, 4, 0, 0, 0}}, { - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, }; LinuxNumactlTestCase numactl_1sockets_16cores_hyperthreading_2 = { {}, - {{24, 8, 8, 8}}, + {{24, 8, 8, 8, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {2, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {4, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {6, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, 1, 8, - {{8, 4, 4, 0}}, + {{8, 4, 4, 0, 0, 0}}, { - {0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 2, MAIN_CORE_PROC, 2, -1}, - {4, 0, 4, MAIN_CORE_PROC, 4, -1}, - {6, 0, 6, MAIN_CORE_PROC, 6, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {4, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {6, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, }; LinuxNumactlTestCase numactl_1sockets_16cores_hyperthreading_3 = { {0, 1, 2, 3}, - {{24, 8, 8, 8}}, + {{24, 8, 8, 8, 0, 0}}, { - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, 1, 8, - {{8, 4, 4, 0}}, + {{8, 4, 4, 0, 0, 0}}, { - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, }; LinuxNumactlTestCase numactl_1sockets_16cores_hyperthreading_4 = { {0, 1, 2, 3}, - {{24, 8, 8, 8}}, + {{24, 8, 8, 8, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, 1, 8, - {{12, 4, 4, 4}}, + {{12, 4, 4, 4, 0, 0}}, { - {0, 0, 0, HYPER_THREADING_PROC, 0, -1}, - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {2, 0, 1, HYPER_THREADING_PROC, 1, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {4, 0, 2, HYPER_THREADING_PROC, 2, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {6, 0, 3, HYPER_THREADING_PROC, 3, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {2, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {4, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {6, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, }; LinuxNumactlTestCase numactl_1sockets_16cores_hyperthreading_5 = { {0, 1, 2, 3}, - {{24, 8, 8, 8}}, + {{24, 8, 8, 8, 0, 0}}, { - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, HYPER_THREADING_PROC, 4, -1}, - {10, 0, 5, HYPER_THREADING_PROC, 5, -1}, - {12, 0, 6, HYPER_THREADING_PROC, 6, -1}, - {14, 0, 7, HYPER_THREADING_PROC, 7, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, + {10, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {12, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, + {14, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, 1, 12, - {{12, 8, 4, 0}}, + {{12, 8, 4, 0, 0, 0}}, { - {1, 0, 0, MAIN_CORE_PROC, 0, -1}, - {3, 0, 1, MAIN_CORE_PROC, 1, -1}, - {5, 0, 2, MAIN_CORE_PROC, 2, -1}, - {7, 0, 3, MAIN_CORE_PROC, 3, -1}, - {8, 0, 4, MAIN_CORE_PROC, 4, -1}, - {10, 0, 5, MAIN_CORE_PROC, 5, -1}, - {12, 0, 6, MAIN_CORE_PROC, 6, -1}, - {14, 0, 7, MAIN_CORE_PROC, 7, -1}, - {16, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, - {17, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, - {18, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, - {19, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, + {1, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {3, 0, 0, 1, MAIN_CORE_PROC, 1, -1}, + {5, 0, 0, 2, MAIN_CORE_PROC, 2, -1}, + {7, 0, 0, 3, MAIN_CORE_PROC, 3, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 4, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 5, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 6, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 7, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 8, -1}, + {17, 0, 0, 9, EFFICIENT_CORE_PROC, 9, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 10, -1}, + {19, 0, 0, 11, EFFICIENT_CORE_PROC, 11, -1}, }, }; diff --git a/src/plugins/intel_cpu/src/config.h b/src/plugins/intel_cpu/src/config.h index a027844d9fe..af7e52e8c41 100644 --- a/src/plugins/intel_cpu/src/config.h +++ b/src/plugins/intel_cpu/src/config.h @@ -19,7 +19,6 @@ namespace ov { namespace intel_cpu { - struct Config { Config(); @@ -40,6 +39,12 @@ struct Config { Disable, }; + enum class LatencyThreadingMode { + PER_NUMA_NODE, + PER_SOCKET, + PER_PLATFORM, + }; + bool collectPerfCounters = false; bool exclusiveAsyncRequests = false; SnippetsMode snippetsMode = SnippetsMode::Enable; @@ -59,6 +64,7 @@ struct Config { ov::hint::SchedulingCoreType schedulingCoreType = ov::hint::SchedulingCoreType::ANY_CORE; bool enableHyperThreading = true; bool changedHyperThreading = false; + Config::LatencyThreadingMode scopeOflatencyCandidate = Config::LatencyThreadingMode::PER_SOCKET; #if defined(OPENVINO_ARCH_X86) || defined(OPENVINO_ARCH_X86_64) LPTransformsMode lpTransformsMode = LPTransformsMode::On; bool enforceBF16 = true; @@ -90,5 +96,5 @@ struct Config { #endif }; -} // namespace intel_cpu +} // namespace intel_cpu } // namespace ov diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp index 14dc6a3c13b..55dcea7781b 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp @@ -23,9 +23,12 @@ namespace ov { namespace intel_cpu { std::vector> get_streams_info_table(const int input_streams, + const bool input_streams_changed, const int input_threads, const int input_infer_requests, const int model_prefer_threads, + const std::string input_perf_hint, + const Config::LatencyThreadingMode scopeOflatencyCandidate, const std::vector> proc_type_table) { std::vector stream_info(CPU_STREAMS_TABLE_SIZE); std::vector> streams_info_table; @@ -49,7 +52,9 @@ std::vector> get_streams_info_table(const int input_streams, } }; - if (1 == input_streams) { + if (((input_streams_changed == false) && (input_perf_hint == CONFIG_VALUE(LATENCY)) && + ((scopeOflatencyCandidate == Config::LatencyThreadingMode::PER_PLATFORM) || (proc_type_table.size() == 1))) || + ((input_streams_changed == true) && (input_streams == 1))) { stream_info[NUMBER_OF_STREAMS] = 1; if (input_threads > 0) { stream_info[THREADS_PER_STREAM] = std::min(proc_type_table[0][ALL_PROC], input_threads); @@ -91,6 +96,40 @@ std::vector> get_streams_info_table(const int input_streams, } } return streams_info_table; + } else if ((input_streams_changed == false) && (input_perf_hint == CONFIG_VALUE(LATENCY))) { + stream_info[PROC_TYPE] = MAIN_CORE_PROC; + int max_per_numa_node = 0; + int numa_node_cnt = 0; + std::vector proc_per_socket; + proc_per_socket.resize(proc_type_table.size(), 0); + for (long unsigned int i = 1; i < proc_type_table.size(); i++) { + if (max_per_numa_node < proc_type_table[i][ALL_PROC]) { + max_per_numa_node = proc_type_table[i][ALL_PROC]; + numa_node_cnt = 1; + } else if (max_per_numa_node == proc_type_table[i][ALL_PROC]) { + numa_node_cnt++; + } + proc_per_socket[proc_type_table[i][PROC_SOCKET_ID]] += proc_type_table[i][ALL_PROC]; + } + if (scopeOflatencyCandidate == Config::LatencyThreadingMode::PER_NUMA_NODE) { + stream_info[NUMBER_OF_STREAMS] = numa_node_cnt; + stream_info[THREADS_PER_STREAM] = max_per_numa_node; + } else { + int max_per_socket = 0; + int socket_cnt = 0; + for (long unsigned int i = 0; i < proc_per_socket.size(); i++) { + if (max_per_socket < proc_per_socket[i]) { + max_per_socket = proc_per_socket[i]; + socket_cnt = 1; + } else if (max_per_socket == proc_per_socket[i]) { + socket_cnt++; + } + } + stream_info[NUMBER_OF_STREAMS] = socket_cnt; + stream_info[THREADS_PER_STREAM] = max_per_socket; + } + streams_info_table.push_back(stream_info); + return streams_info_table; } else { int n_streams = 0; int n_threads = 0; @@ -100,7 +139,7 @@ std::vector> get_streams_info_table(const int input_streams, n_threads = (0 == input_threads) ? proc_type_table[0][ALL_PROC] : std::min(proc_type_table[0][ALL_PROC], input_threads); - if (0 != input_streams) { + if ((input_streams_changed == true) && (input_streams > 0)) { base_type = (proc_type_table[0][MAIN_CORE_PROC] == 0) ? EFFICIENT_CORE_PROC : MAIN_CORE_PROC; n_streams = (input_infer_requests > 0) ? std::min(input_streams, input_infer_requests) : input_streams; if (n_streams >= n_threads) { @@ -292,10 +331,13 @@ void generate_stream_info(const int streams, model_prefer_threads = get_model_prefer_threads(streams, proc_type_table, ngraphFunc, executor_config); } - executor_config._streams_info_table = get_streams_info_table(streams, + executor_config._streams_info_table = get_streams_info_table(executor_config._streams, + executor_config._streams_changed, executor_config._threads, config.perfHintsConfig.ovPerfHintNumRequests, model_prefer_threads, + config.perfHintsConfig.ovPerfHint, + config.scopeOflatencyCandidate, proc_type_table); } diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp index 461ba9dcdbc..eacb606697d 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp @@ -12,6 +12,7 @@ #include #include +#include "config.h" #include "graph.h" #include "openvino/runtime/properties.hpp" @@ -19,10 +20,10 @@ namespace ov { namespace intel_cpu { /** * @brief Generate streams information table according to processors type table. - * @param[in] input_streams is the targeted number of streams set by user via ov::num_streams or hints. - * - input "0" indicates the optimal number of streams generated by the function. - * - When user sets LATENCY hint, OpenVINO runtime generate one stream per CPU node. - * @param[in] input_threads is the max number of threads set by user via ov::inference_num_threads. + * @param[in] input_streams is the targeted number of streams set by user via ov::num_streams or the default value. + * @param[in] input_streams_changed indicates if streams is set by user via ov::num_streams. + * @param[in] input_threads is the max number of threads set by user via ov::inference_num_threads or the default + * value. * - input "0" indicates that the function can use all resource in proc_type_table. * - If user limits the max number of threads, the final number of streams output cannot exceed the max * number of threads. @@ -34,15 +35,21 @@ namespace intel_cpu { * function. * - input "0" indicates that the function generates the optimal number of threads per stream based on * processors type information. + * @param[in] input_perf_hint is performance hint set by user via ov::hint::performance_mode or the default value. + * @param[in] scopeOflatencyCandidate is the scope of candidate processors per stream for latency hint + * - user can select all processors per numa node, per socket, or per platform. * @param[in] proc_type_table is currently available candidate processors. * - candidate processors have benn updated based on user input hints like ov::hint::scheduling_core_type * in previous function. * @return streams information table which will be used by StreamsExecutor. */ std::vector> get_streams_info_table(const int input_streams, + const bool input_streams_changed, const int input_threads, const int input_infer_requests, const int model_prefer_threads, + const std::string input_perf_hint, + const Config::LatencyThreadingMode scopeOflatencyCandidate, const std::vector> proc_type_table); /** * @brief Get model_prefer_threads diff --git a/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp b/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp index 31eddcede4a..0b5a480f0f5 100644 --- a/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp @@ -375,9 +375,12 @@ INSTANTIATE_TEST_SUITE_P(UseHTTable, struct StreamsCalculationTestCase { int input_streams; + bool input_streams_chaged; int input_threads; int input_infer_requests; int model_prefer_threads; + std::string input_perf_hint; + ov::intel_cpu::Config::LatencyThreadingMode scopeOflatencyCandidate; std::vector> proc_type_table; std::vector> stream_info_table; }; @@ -390,912 +393,1544 @@ public: std::vector> test_stream_info_table = ov::intel_cpu::get_streams_info_table(test_data.input_streams, + test_data.input_streams_chaged, test_data.input_threads, test_data.input_infer_requests, test_data.model_prefer_threads, + test_data.input_perf_hint, + test_data.scopeOflatencyCandidate, test_data.proc_type_table); ASSERT_EQ(test_data.stream_info_table, test_stream_info_table); } }; +StreamsCalculationTestCase _2sockets_104cores_latency_platform_1 = { + 1, // param[in]: the number of streams in this simulation. + false, // param[in]: Whether the user explicitly sets the number of streams is higher priority in streams + // calculation logic. If this param is true, the following performance hint and LatencyThreadingMode will be + // ignored. + 0, // param[in]: the number of threads in this simulation + 0, // param[in]: the number of infer requests in this simulation + 0, // param[in]: the model preferred number of threads in this simulation + "LATENCY", // param[in]: the performance hint in this simulation + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, // param[in]: the LatencyThreadingMode in this + // simulation + {{208, 104, 0, 104, -1, -1}, + {104, 52, 0, 52, 0, 0}, + {104, 52, 0, 52, 1, 1}}, // param[in]: the proc_type_table in this simulation + {{1, MAIN_CORE_PROC, 208}}, // param[expected out]: the expected result of streams_info_table in this simulation +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_platform_2 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, + {{1, MAIN_CORE_PROC, 104}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_platform_3 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, + {52, 26, 0, 26, 0, 0}, + {52, 26, 0, 26, 1, 0}, + {52, 26, 0, 26, 2, 1}, + {52, 26, 0, 26, 3, 1}}, + {{1, MAIN_CORE_PROC, 208}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_platform_4 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {26, 13, 0, 0, 0, 0}, {26, 13, 0, 0, 1, 0}, {26, 13, 0, 0, 2, 1}, {26, 13, 0, 0, 3, 1}}, + {{1, MAIN_CORE_PROC, 104}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_socket_1 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, + {{2, MAIN_CORE_PROC, 104}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_socket_2 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, + {{2, MAIN_CORE_PROC, 52}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_socket_3 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + {{208, 104, 0, 104, -1, -1}, + {52, 26, 0, 26, 0, 0}, + {52, 26, 0, 26, 1, 0}, + {52, 26, 0, 26, 2, 1}, + {52, 26, 0, 26, 3, 1}}, + {{2, MAIN_CORE_PROC, 104}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_socket_4 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + {{104, 104, 0, 0, -1, -1}, {26, 13, 0, 0, 0, 0}, {26, 13, 0, 0, 1, 0}, {26, 13, 0, 0, 2, 1}, {26, 13, 0, 0, 3, 1}}, + {{2, MAIN_CORE_PROC, 52}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_socket_5 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + {{60, 60, 0, 0, -1, -1}, {10, 10, 0, 0, 0, 0}, {10, 10, 0, 0, 1, 0}, {20, 20, 0, 0, 2, 1}, {20, 20, 0, 0, 3, 1}}, + {{1, MAIN_CORE_PROC, 40}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_socket_6 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + {{60, 60, 0, 0, -1, -1}, {10, 10, 0, 0, 0, 0}, {20, 20, 0, 0, 1, 1}, {10, 10, 0, 0, 2, 0}, {20, 20, 0, 0, 3, 1}}, + {{1, MAIN_CORE_PROC, 40}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_socket_7 = { + 1, + true, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + {{104, 104, 0, 0, -1, -1}, {26, 13, 0, 0, 0, 0}, {26, 13, 0, 0, 1, 0}, {26, 13, 0, 0, 2, 1}, {26, 13, 0, 0, 3, 1}}, + {{1, MAIN_CORE_PROC, 104}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_node_1 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, + {{2, MAIN_CORE_PROC, 104}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_node_2 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, + {{2, MAIN_CORE_PROC, 52}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_node_3 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, + {{208, 104, 0, 104, -1, -1}, + {52, 26, 0, 26, 0, 0}, + {52, 26, 0, 26, 1, 0}, + {52, 26, 0, 26, 2, 1}, + {52, 26, 0, 26, 3, 1}}, + {{4, MAIN_CORE_PROC, 52}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_node_4 = { + 1, + false, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, + {{104, 104, 0, 0, -1, -1}, {26, 13, 0, 0, 0, 0}, {26, 13, 0, 0, 1, 0}, {26, 13, 0, 0, 2, 1}, {26, 13, 0, 0, 3, 1}}, + {{4, MAIN_CORE_PROC, 26}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_node_5 = { + 1, + true, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, + {{104, 104, 0, 0, -1, -1}, {26, 13, 0, 0, 0, 0}, {26, 13, 0, 0, 1, 0}, {26, 13, 0, 0, 2, 1}, {26, 13, 0, 0, 3, 1}}, + {{1, MAIN_CORE_PROC, 104}}, +}; + StreamsCalculationTestCase _2sockets_104cores_latency_1 = { 1, + false, + 20, 0, 0, - 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, - {{1, MAIN_CORE_PROC, 208}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, + {{1, MAIN_CORE_PROC, 20}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_2 = { 1, + false, 20, + 5, 0, - 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{1, MAIN_CORE_PROC, 20}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_3 = { 1, - 20, - 5, + false, + 208, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, - {{1, MAIN_CORE_PROC, 20}}, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, + {{1, MAIN_CORE_PROC, 208}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_4 = { 1, - 208, + true, + 20, 0, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, - {{1, MAIN_CORE_PROC, 208}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, + {{1, MAIN_CORE_PROC, 20}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_5 = { 1, + true, + 20, + 5, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, + {{1, MAIN_CORE_PROC, 20}}, +}; + +StreamsCalculationTestCase _2sockets_104cores_latency_6 = { + 1, + true, + 208, 0, 0, - 0, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, - {{1, MAIN_CORE_PROC, 104}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, + {{1, MAIN_CORE_PROC, 208}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_1 = { + 1, + false, 0, 0, 0, - 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{52, MAIN_CORE_PROC, 4}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_2 = { 2, + true, 0, 0, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{2, MAIN_CORE_PROC, 104}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_3 = { - 0, + 1, + false, 20, 0, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{5, MAIN_CORE_PROC, 4}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_4 = { 2, + true, 20, 0, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{2, MAIN_CORE_PROC, 10}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_5 = { - 0, + 1, + false, 0, 0, 1, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{208, MAIN_CORE_PROC, 1}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_6 = { - 0, + 1, + false, 0, 0, 2, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{104, MAIN_CORE_PROC, 2}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_7 = { - 0, + 1, + false, 0, 0, 8, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{26, MAIN_CORE_PROC, 8}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_8 = { - 0, + 1, + false, 40, 0, 8, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{5, MAIN_CORE_PROC, 8}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_9 = { 5, + true, 20, 2, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{2, MAIN_CORE_PROC, 10}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_10 = { - 0, + 1, + false, 0, 2, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{2, MAIN_CORE_PROC, 104}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_11 = { 2, + true, 0, 5, 0, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{2, MAIN_CORE_PROC, 104}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_12 = { - 0, + 1, + false, 0, 2, 2, - {{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, {{2, MAIN_CORE_PROC, 104}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_13 = { + 1, + false, 0, 0, 0, - 0, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{26, MAIN_CORE_PROC, 4}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_14 = { 2, + true, 0, 0, 0, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{2, MAIN_CORE_PROC, 52}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_15 = { - 0, + 1, + false, 0, 0, 1, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{104, MAIN_CORE_PROC, 1}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_16 = { - 0, + 1, + false, 0, 0, 2, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{52, MAIN_CORE_PROC, 2}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_17 = { - 0, + 1, + false, 0, 0, 8, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{13, MAIN_CORE_PROC, 8}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_18 = { - 0, + 1, + false, 0, 2, 0, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{2, MAIN_CORE_PROC, 52}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_19 = { 2, + true, 0, 5, 0, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{2, MAIN_CORE_PROC, 52}}, }; StreamsCalculationTestCase _2sockets_104cores_tput_20 = { - 0, + 1, + false, 0, 2, 2, - {{104, 104, 0, 0}, {52, 52, 0, 0}, {52, 52, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, {{2, MAIN_CORE_PROC, 52}}, }; StreamsCalculationTestCase _2sockets_48cores_latency_1 = { 1, + false, 0, 0, 0, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 48}}, }; StreamsCalculationTestCase _2sockets_48cores_tput_1 = { + 1, + false, 0, 0, 0, - 0, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{12, MAIN_CORE_PROC, 4}}, }; StreamsCalculationTestCase _2sockets_48cores_tput_2 = { 100, + true, 0, 0, 0, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{48, MAIN_CORE_PROC, 1}}, }; StreamsCalculationTestCase _2sockets_48cores_tput_3 = { - 0, + 1, + false, 100, 0, 0, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{12, MAIN_CORE_PROC, 4}}, }; StreamsCalculationTestCase _2sockets_48cores_tput_4 = { 2, + true, 20, 0, 1, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{2, MAIN_CORE_PROC, 10}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_1 = { 1, + false, 0, 0, 0, - {{14, 6, 8, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, {{1, ALL_PROC, 14}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_2 = { 1, + false, 10, 0, 0, - {{20, 6, 8, 6}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, ALL_PROC, 10}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_3 = { 1, + false, 0, 0, 6, - {{20, 6, 8, 6}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 12}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_4 = { 1, + false, 0, 0, 14, - {{20, 6, 8, 6}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, ALL_PROC, 20}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_5 = { 1, + false, 0, 2, 14, - {{20, 6, 8, 6}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, ALL_PROC, 20}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_6 = { 1, + false, 0, 0, 0, - {{20, 6, 8, 6}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, ALL_PROC, 20}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_7 = { 1, + false, 0, 0, 6, - {{14, 6, 8, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, {{1, MAIN_CORE_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_8 = { 1, + false, 0, 0, 14, - {{14, 6, 8, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, {{1, ALL_PROC, 14}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_14cores_latency_9 = { 1, + false, 0, 2, 14, - {{14, 6, 8, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, + {{1, ALL_PROC, 14}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_10 = { + 1, + true, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, + {{1, ALL_PROC, 14}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_11 = { + 1, + true, + 10, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, + {{1, ALL_PROC, 10}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 4}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_12 = { + 1, + true, + 0, + 0, + 6, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, + {{1, MAIN_CORE_PROC, 12}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_13 = { + 1, + true, + 0, + 0, + 14, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, + {{1, ALL_PROC, 20}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 6}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_14 = { + 1, + true, + 0, + 2, + 14, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, + {{1, ALL_PROC, 20}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 6}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_15 = { + 1, + true, + 0, + 0, + 0, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, + {{1, ALL_PROC, 20}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 6}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_16 = { + 1, + true, + 0, + 0, + 6, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, + {{1, MAIN_CORE_PROC, 6}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_17 = { + 1, + true, + 0, + 0, + 14, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, + {{1, ALL_PROC, 14}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_latency_18 = { + 1, + true, + 0, + 2, + 14, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{14, 6, 8, 0, 0, 0}}, {{1, ALL_PROC, 14}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_1 = { + 1, + false, 0, 0, 0, - 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, EFFICIENT_CORE_PROC, 3}, {2, HYPER_THREADING_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_2 = { 2, + true, 0, 0, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 6}, {1, EFFICIENT_CORE_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_3 = { 4, + true, 0, 0, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, EFFICIENT_CORE_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_4 = { - 0, + 1, + false, 12, 0, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, EFFICIENT_CORE_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_5 = { - 0, + 1, + false, 0, 0, 1, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {4, EFFICIENT_CORE_PROC, 2}, {6, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_6 = { - 0, + 1, + false, 0, 0, 2, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{3, MAIN_CORE_PROC, 2}, {4, EFFICIENT_CORE_PROC, 2}, {3, HYPER_THREADING_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_7 = { 100, + true, 0, 0, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {8, EFFICIENT_CORE_PROC, 1}, {6, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_8 = { - 0, + 1, + false, 100, 0, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, EFFICIENT_CORE_PROC, 3}, {2, HYPER_THREADING_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_9 = { 4, + true, 0, 8, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, EFFICIENT_CORE_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_10 = { 6, + true, 0, 4, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, EFFICIENT_CORE_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_11 = { - 0, + 1, + false, 0, 2, 0, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 6}, {1, EFFICIENT_CORE_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_12 = { - 0, + 1, + false, 0, 2, 2, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 6}, {1, EFFICIENT_CORE_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_13 = { - 0, + 1, + false, 1, 0, 1, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_14 = { - 0, + 1, + false, 9, 0, 1, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {1, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_15 = { - 0, + 1, + false, 12, 0, 1, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {3, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_16 = { - 0, + 1, + false, 15, 0, 1, - {{20, 6, 8, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 8, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {4, EFFICIENT_CORE_PROC, 2}, {1, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_10cores_latency_1 = { 1, + false, 0, 0, 0, - {{12, 2, 8, 2}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, ALL_PROC, 12}, {0, MAIN_CORE_PROC, 2}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_10cores_latency_2 = { 1, + false, 8, 0, 0, - {{12, 2, 8, 2}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, ALL_PROC, 8}, {0, MAIN_CORE_PROC, 2}, {0, EFFICIENT_CORE_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_10cores_latency_3 = { 1, + false, 0, 0, 2, - {{12, 2, 8, 2}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, MAIN_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_10cores_latency_4 = { 1, + false, 0, 0, 10, - {{12, 2, 8, 2}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, ALL_PROC, 12}, {0, MAIN_CORE_PROC, 2}, {0, EFFICIENT_CORE_PROC, 8}, {0, HYPER_THREADING_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_10cores_latency_5 = { 1, + false, 0, 0, 0, - {{10, 2, 8, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{10, 2, 8, 0, 0, 0}}, {{1, ALL_PROC, 10}, {0, MAIN_CORE_PROC, 2}, {0, EFFICIENT_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_10cores_latency_6 = { 1, + false, 0, 0, 2, - {{10, 2, 8, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{10, 2, 8, 0, 0, 0}}, {{1, MAIN_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_10cores_latency_7 = { 1, + false, 0, 0, 10, - {{10, 2, 8, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{10, 2, 8, 0, 0, 0}}, {{1, ALL_PROC, 10}, {0, MAIN_CORE_PROC, 2}, {0, EFFICIENT_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_10cores_tput_1 = { + 1, + false, 0, 0, 0, - 0, - {{12, 2, 8, 2}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, MAIN_CORE_PROC, 2}, {4, EFFICIENT_CORE_PROC, 2}, {1, HYPER_THREADING_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_10cores_tput_2 = { 2, + true, 0, 0, 0, - {{12, 2, 8, 2}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, MAIN_CORE_PROC, 2}, {1, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_10cores_tput_3 = { 4, + true, 0, 0, 0, - {{12, 2, 8, 2}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, MAIN_CORE_PROC, 2}, {3, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_10cores_tput_4 = { - 0, + 1, + false, 6, 0, 0, - {{12, 2, 8, 2}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, MAIN_CORE_PROC, 2}, {2, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_10cores_tput_5 = { - 0, + 1, + false, 0, 0, 1, - {{12, 2, 8, 2}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{2, MAIN_CORE_PROC, 1}, {4, EFFICIENT_CORE_PROC, 2}, {2, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_10cores_tput_6 = { - 0, + 1, + false, 0, 0, 2, - {{12, 2, 8, 2}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 2, 8, 2, 0, 0}}, {{1, MAIN_CORE_PROC, 2}, {4, EFFICIENT_CORE_PROC, 2}, {1, HYPER_THREADING_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_8cores_latency_1 = { 1, + false, 0, 0, 0, - {{12, 4, 4, 4}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{1, ALL_PROC, 12}, {0, MAIN_CORE_PROC, 4}, {0, EFFICIENT_CORE_PROC, 4}, {0, HYPER_THREADING_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_latency_2 = { 1, + false, 100, 0, 0, - {{12, 4, 4, 4}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{1, ALL_PROC, 12}, {0, MAIN_CORE_PROC, 4}, {0, EFFICIENT_CORE_PROC, 4}, {0, HYPER_THREADING_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_latency_3 = { 1, + false, 0, 0, 4, - {{12, 4, 4, 4}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{1, MAIN_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_8cores_latency_4 = { 1, + false, 0, 0, 8, - {{12, 4, 4, 4}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{1, ALL_PROC, 12}, {0, MAIN_CORE_PROC, 4}, {0, EFFICIENT_CORE_PROC, 4}, {0, HYPER_THREADING_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_latency_5 = { 1, + false, 0, 0, 0, - {{8, 4, 4, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{8, 4, 4, 0, 0, 0}}, {{1, ALL_PROC, 8}, {0, MAIN_CORE_PROC, 4}, {0, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_latency_6 = { 1, + false, 0, 0, 4, - {{8, 4, 4, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{8, 4, 4, 0, 0, 0}}, {{1, MAIN_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_latency_7 = { 1, + false, 0, 0, 8, - {{8, 4, 4, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{8, 4, 4, 0, 0, 0}}, {{1, ALL_PROC, 8}, {0, MAIN_CORE_PROC, 4}, {0, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_1 = { + 1, + false, 0, 0, 0, - 0, - {{12, 4, 4, 4}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{1, MAIN_CORE_PROC, 4}, {1, EFFICIENT_CORE_PROC, 4}, {1, HYPER_THREADING_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_2 = { 2, + true, 0, 0, 0, - {{12, 4, 4, 4}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{1, MAIN_CORE_PROC, 4}, {1, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_3 = { 4, + true, 0, 0, 0, - {{12, 4, 4, 4}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{2, MAIN_CORE_PROC, 2}, {2, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_4 = { 6, + true, 0, 0, 0, - {{12, 4, 4, 4}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{2, MAIN_CORE_PROC, 2}, {2, EFFICIENT_CORE_PROC, 2}, {2, HYPER_THREADING_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_5 = { - 0, + 1, + false, 6, 0, 0, - {{12, 4, 4, 4}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{2, MAIN_CORE_PROC, 2}, {1, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_6 = { - 0, + 1, + false, 8, 0, 0, - {{12, 4, 4, 4}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{2, MAIN_CORE_PROC, 2}, {2, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_7 = { - 0, + 1, + false, 0, 0, 1, - {{12, 4, 4, 4}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 4, 4, 4, 0, 0}}, {{4, MAIN_CORE_PROC, 1}, {2, EFFICIENT_CORE_PROC, 2}, {4, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_8cores_tput_8 = { + 1, + false, 0, 0, 0, - 0, - {{8, 4, 4, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{8, 4, 4, 0, 0, 0}}, {{2, MAIN_CORE_PROC, 2}, {2, EFFICIENT_CORE_PROC, 2}}, }; StreamsCalculationTestCase _1sockets_6cores_latency_1 = { 1, + false, 0, 0, 0, - {{12, 6, 0, 6}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 6, 0, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 12}}, }; StreamsCalculationTestCase _1sockets_6cores_latency_2 = { 1, + false, 100, 0, 0, - {{12, 6, 0, 6}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 6, 0, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 12}}, }; StreamsCalculationTestCase _1sockets_6cores_latency_3 = { 1, + false, 0, 0, 0, - {{6, 6, 0, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{6, 6, 0, 0, 0, 0}}, {{1, MAIN_CORE_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_6cores_tput_1 = { + 1, + false, 0, 0, 0, - 0, - {{12, 6, 0, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 6, 0, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, HYPER_THREADING_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_6cores_tput_2 = { 2, + true, 0, 0, 0, - {{12, 6, 0, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 6, 0, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 6}, {1, HYPER_THREADING_PROC, 6}}, }; StreamsCalculationTestCase _1sockets_6cores_tput_3 = { - 0, + 1, + false, 8, 0, 0, - {{12, 6, 0, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 6, 0, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}}, }; StreamsCalculationTestCase _1sockets_6cores_tput_4 = { - 0, + 1, + false, 0, 0, 1, - {{12, 6, 0, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{12, 6, 0, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {6, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_ecores_latency_1 = { 1, + false, 0, 0, 0, - {{16, 0, 16, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{1, EFFICIENT_CORE_PROC, 16}}, }; StreamsCalculationTestCase _1sockets_ecores_latency_2 = { 1, + false, 4, 0, 0, - {{16, 0, 16, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{1, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_ecores_latency_3 = { 1, + false, 0, 4, 0, - {{16, 0, 16, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{1, EFFICIENT_CORE_PROC, 16}}, }; StreamsCalculationTestCase _1sockets_ecores_latency_4 = { 1, + false, 0, 0, 4, - {{16, 0, 16, 0}}, + "LATENCY", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{1, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_ecores_tput_1 = { - 0, + 1, + false, 0, 0, 1, - {{16, 0, 16, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{16, EFFICIENT_CORE_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_ecores_tput_2 = { - 0, + 1, + false, 0, 0, 4, - {{16, 0, 16, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{4, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_ecores_tput_3 = { 2, + true, 0, 0, 0, - {{16, 0, 16, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{2, EFFICIENT_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_ecores_tput_4 = { 8, + true, 0, 4, 0, - {{16, 0, 16, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{4, EFFICIENT_CORE_PROC, 4}}, }; StreamsCalculationTestCase _1sockets_ecores_tput_5 = { 2, + true, 0, 0, 4, - {{16, 0, 16, 0}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{16, 0, 16, 0, 0, 0}}, {{2, EFFICIENT_CORE_PROC, 8}}, }; StreamsCalculationTestCase _1sockets_mock_tput_1 = { - 0, + 1, + false, 15, 0, 1, - {{20, 6, 7, 6}}, + "THROUGHPUT", + ov::intel_cpu::Config::LatencyThreadingMode::PER_PLATFORM, + {{20, 6, 7, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {3, EFFICIENT_CORE_PROC, 2}, {3, HYPER_THREADING_PROC, 1}}, }; @@ -1303,11 +1938,28 @@ TEST_P(StreamsCalculationTests, StreamsCalculation) {} INSTANTIATE_TEST_SUITE_P(StreamsInfoTable, StreamsCalculationTests, - testing::Values(_2sockets_104cores_latency_1, + testing::Values(_2sockets_104cores_latency_platform_1, + _2sockets_104cores_latency_platform_2, + _2sockets_104cores_latency_platform_3, + _2sockets_104cores_latency_platform_4, + _2sockets_104cores_latency_socket_1, + _2sockets_104cores_latency_socket_2, + _2sockets_104cores_latency_socket_3, + _2sockets_104cores_latency_socket_4, + _2sockets_104cores_latency_socket_5, + _2sockets_104cores_latency_socket_6, + _2sockets_104cores_latency_socket_7, + _2sockets_104cores_latency_node_1, + _2sockets_104cores_latency_node_2, + _2sockets_104cores_latency_node_3, + _2sockets_104cores_latency_node_4, + _2sockets_104cores_latency_node_5, + _2sockets_104cores_latency_1, _2sockets_104cores_latency_2, _2sockets_104cores_latency_3, _2sockets_104cores_latency_4, _2sockets_104cores_latency_5, + _2sockets_104cores_latency_6, _2sockets_104cores_tput_1, _2sockets_104cores_tput_2, _2sockets_104cores_tput_3, @@ -1342,6 +1994,15 @@ INSTANTIATE_TEST_SUITE_P(StreamsInfoTable, _1sockets_14cores_latency_7, _1sockets_14cores_latency_8, _1sockets_14cores_latency_9, + _1sockets_14cores_latency_10, + _1sockets_14cores_latency_11, + _1sockets_14cores_latency_12, + _1sockets_14cores_latency_13, + _1sockets_14cores_latency_14, + _1sockets_14cores_latency_15, + _1sockets_14cores_latency_16, + _1sockets_14cores_latency_17, + _1sockets_14cores_latency_18, _1sockets_14cores_tput_1, _1sockets_14cores_tput_2, _1sockets_14cores_tput_3, @@ -1406,6 +2067,7 @@ INSTANTIATE_TEST_SUITE_P(StreamsInfoTable, struct StreamGenerateionTestCase { int input_stream; + bool input_stream_changed; int input_thread; int input_request; int input_model_prefer; @@ -1415,6 +2077,7 @@ struct StreamGenerateionTestCase { bool input_cpu_value; bool input_cpu_changed; ov::hint::PerformanceMode input_pm_hint; + ov::intel_cpu::Config::LatencyThreadingMode input_latency_scope; ov::threading::IStreamsExecutor::ThreadBindingType input_binding_type; std::vector> input_proc_type_table; ov::hint::SchedulingCoreType output_type; @@ -1432,7 +2095,10 @@ void make_config(StreamGenerateionTestCase& test_data, ov::intel_cpu::Config& co config.enableHyperThreading = test_data.input_ht_value; config.changedHyperThreading = test_data.input_ht_changed; config.perfHintsConfig.ovPerfHint = ov::util::to_string(test_data.input_pm_hint); + config.scopeOflatencyCandidate = test_data.input_latency_scope; config.perfHintsConfig.ovPerfHintNumRequests = test_data.input_request; + config.streamExecutorConfig._streams = test_data.input_stream; + config.streamExecutorConfig._streams_changed = test_data.input_stream_changed; config.streamExecutorConfig._threads = test_data.input_thread; config.streamExecutorConfig._threadBindingType = test_data.input_binding_type; config.streamExecutorConfig._orig_proc_type_table = test_data.input_proc_type_table; @@ -1453,7 +2119,8 @@ public: ASSERT_EQ(test_data.output_cpu_value, config.streamExecutorConfig._cpu_pinning); ASSERT_EQ(test_data.output_ht_value, config.enableHyperThreading); ASSERT_EQ(test_data.output_type, config.schedulingCoreType); - ASSERT_EQ(test_data.output_pm_hint, ov::util::from_string(config.perfHintsConfig.ovPerfHint, ov::hint::performance_mode)); + ASSERT_EQ(test_data.output_pm_hint, + ov::util::from_string(config.perfHintsConfig.ovPerfHint, ov::hint::performance_mode)); } }; @@ -1461,6 +2128,7 @@ TEST_P(StreamGenerationTests, StreamsGeneration) {} StreamGenerateionTestCase generation_latency_1sockets_14cores_1 = { 1, // param[in]: simulated settting for streams number + false, // param[in]: simulated settting for streams number changed 0, // param[in]: simulated setting for threads number 0, // param[in]: simulated setting for inference request number 0, // param[in]: simulated setting for model prefer threads number @@ -1471,16 +2139,18 @@ StreamGenerateionTestCase generation_latency_1sockets_14cores_1 = { true, // param[in]: simulated setting for enableCpuPinning true, // param[in]: simulated setting for changedCpuPinning ov::hint::PerformanceMode::LATENCY, // param[in]: simulated setting for performance mode (throughput/latency) + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, // param[in]: simulated setting for scope of candidate processors + // on latency mode ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, // param[in]: simulated setting for // threadBindingType - {{20, 6, 8, 6}}, // param[in]: simulated proc_type_table for platform which has one socket, 6 Pcores, 8 Ecores and - // hyper threading enabled + {{20, 6, 8, 6, 0, 0}}, // param[in]: simulated proc_type_table for platform which has one socket, 6 Pcores, 8 + // Ecores and hyper threading enabled ov::hint::SchedulingCoreType::ANY_CORE, // param[expected out]: scheduling core type needs to be the same as input true, // param[expected out]: enableHyperThreading needs to be the same as input true, // param[expected out]: enableCpuPinning needs to be the same as input ov::hint::PerformanceMode::LATENCY, // param[expected out]: performance mode needs to be the same as input - {{20, 6, 8, 6}}, // param[expected out]: since hyper threading is enabled and all core type is used, - // proc_type_table needs to be the same as input + {{20, 6, 8, 6, 0, 0}}, // param[expected out]: since hyper threading is enabled and all core type is used, + // proc_type_table needs to be the same as input {{1, ALL_PROC, 20}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}, @@ -1491,6 +2161,7 @@ StreamGenerateionTestCase generation_latency_1sockets_14cores_1 = { StreamGenerateionTestCase generation_latency_1sockets_14cores_2 = { 1, + false, 0, 0, 0, @@ -1500,18 +2171,20 @@ StreamGenerateionTestCase generation_latency_1sockets_14cores_2 = { true, true, ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, - {{14, 6, 8, 0}}, + {{14, 6, 8, 0, 0, 0}}, ov::hint::SchedulingCoreType::ANY_CORE, false, true, ov::hint::PerformanceMode::LATENCY, - {{14, 6, 8, 0}}, + {{14, 6, 8, 0, 0, 0}}, {{1, ALL_PROC, 14}, {0, MAIN_CORE_PROC, 6}, {0, EFFICIENT_CORE_PROC, 8}}, }; StreamGenerateionTestCase generation_latency_1sockets_14cores_3 = { 1, + false, 0, 0, 0, @@ -1521,18 +2194,20 @@ StreamGenerateionTestCase generation_latency_1sockets_14cores_3 = { false, true, ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, - {{14, 6, 8, 0}}, + {{14, 6, 8, 0, 0, 0}}, ov::hint::SchedulingCoreType::PCORE_ONLY, false, false, ov::hint::PerformanceMode::LATENCY, - {{6, 6, 0, 0}}, + {{6, 6, 0, 0, 0, 0}}, {{1, MAIN_CORE_PROC, 6}}, }; StreamGenerateionTestCase generation_latency_1sockets_14cores_4 = { 1, + false, 0, 0, 0, @@ -1542,18 +2217,20 @@ StreamGenerateionTestCase generation_latency_1sockets_14cores_4 = { false, true, ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, ov::hint::SchedulingCoreType::PCORE_ONLY, true, false, ov::hint::PerformanceMode::LATENCY, - {{12, 6, 0, 6}}, + {{12, 6, 0, 6, 0, 0}}, {{1, MAIN_CORE_PROC, 12}}, }; StreamGenerateionTestCase generation_latency_1sockets_14cores_5 = { 1, + false, 0, 0, 0, @@ -1563,18 +2240,20 @@ StreamGenerateionTestCase generation_latency_1sockets_14cores_5 = { false, true, ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, ov::hint::SchedulingCoreType::PCORE_ONLY, false, false, ov::hint::PerformanceMode::LATENCY, - {{6, 6, 0, 0}}, + {{6, 6, 0, 0, 0, 0}}, {{1, MAIN_CORE_PROC, 6}}, }; StreamGenerateionTestCase generation_latency_2sockets_48cores_6 = { 1, + false, 0, 0, 0, @@ -1584,18 +2263,20 @@ StreamGenerateionTestCase generation_latency_2sockets_48cores_6 = { false, true, ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, ov::hint::SchedulingCoreType::PCORE_ONLY, false, false, ov::hint::PerformanceMode::LATENCY, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, - {{1, MAIN_CORE_PROC, 48}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, + {{2, MAIN_CORE_PROC, 24}}, }; StreamGenerateionTestCase generation_latency_2sockets_48cores_7 = { 1, + false, 0, 0, 0, @@ -1605,18 +2286,66 @@ StreamGenerateionTestCase generation_latency_2sockets_48cores_7 = { false, true, ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, ov::hint::SchedulingCoreType::PCORE_ONLY, false, false, ov::hint::PerformanceMode::LATENCY, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, + {{2, MAIN_CORE_PROC, 24}}, +}; + +StreamGenerateionTestCase generation_latency_2sockets_48cores_8 = { + 1, + true, + 0, + 0, + 0, + ov::hint::SchedulingCoreType::PCORE_ONLY, + false, + true, + false, + true, + ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, + ov::hint::SchedulingCoreType::PCORE_ONLY, + false, + false, + ov::hint::PerformanceMode::LATENCY, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, + {{1, MAIN_CORE_PROC, 48}}, +}; + +StreamGenerateionTestCase generation_latency_2sockets_48cores_9 = { + 1, + true, + 0, + 0, + 0, + ov::hint::SchedulingCoreType::PCORE_ONLY, + true, + true, + false, + true, + ov::hint::PerformanceMode::LATENCY, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, + ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, + ov::hint::SchedulingCoreType::PCORE_ONLY, + false, + false, + ov::hint::PerformanceMode::LATENCY, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{1, MAIN_CORE_PROC, 48}}, }; StreamGenerateionTestCase generation_tput_1sockets_14cores_1 = { 0, + false, 0, 0, 0, @@ -1626,18 +2355,20 @@ StreamGenerateionTestCase generation_tput_1sockets_14cores_1 = { true, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, ov::hint::SchedulingCoreType::ANY_CORE, true, true, ov::hint::PerformanceMode::THROUGHPUT, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {2, EFFICIENT_CORE_PROC, 3}, {2, HYPER_THREADING_PROC, 3}}, }; StreamGenerateionTestCase generation_tput_1sockets_14cores_2 = { 0, + false, 0, 0, 0, @@ -1647,18 +2378,20 @@ StreamGenerateionTestCase generation_tput_1sockets_14cores_2 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, ov::hint::SchedulingCoreType::PCORE_ONLY, false, false, ov::hint::PerformanceMode::THROUGHPUT, - {{6, 6, 0, 0}}, + {{6, 6, 0, 0, 0, 0}}, {{2, MAIN_CORE_PROC, 3}}, }; StreamGenerateionTestCase generation_tput_1sockets_14cores_3 = { 10, + true, 0, 0, 0, @@ -1668,18 +2401,20 @@ StreamGenerateionTestCase generation_tput_1sockets_14cores_3 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, ov::hint::SchedulingCoreType::PCORE_ONLY, true, false, ov::hint::PerformanceMode::THROUGHPUT, - {{12, 6, 0, 6}}, + {{12, 6, 0, 6, 0, 0}}, {{6, MAIN_CORE_PROC, 1}, {4, HYPER_THREADING_PROC, 1}}, }; StreamGenerateionTestCase generation_tput_1sockets_14cores_4 = { 0, + false, 10, 0, 0, @@ -1689,18 +2424,20 @@ StreamGenerateionTestCase generation_tput_1sockets_14cores_4 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{20, 6, 8, 6}}, + {{20, 6, 8, 6, 0, 0}}, ov::hint::SchedulingCoreType::PCORE_ONLY, true, false, ov::hint::PerformanceMode::THROUGHPUT, - {{12, 6, 0, 6}}, + {{12, 6, 0, 6, 0, 0}}, {{2, MAIN_CORE_PROC, 3}, {1, HYPER_THREADING_PROC, 3}}, }; StreamGenerateionTestCase generation_tput_2sockets_48cores_5 = { 0, + false, 0, 0, 0, @@ -1710,18 +2447,20 @@ StreamGenerateionTestCase generation_tput_2sockets_48cores_5 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, ov::hint::SchedulingCoreType::ANY_CORE, true, false, ov::hint::PerformanceMode::THROUGHPUT, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, {{24, MAIN_CORE_PROC, 4}}, }; StreamGenerateionTestCase generation_tput_2sockets_48cores_6 = { 0, + false, 0, 0, 0, @@ -1731,18 +2470,20 @@ StreamGenerateionTestCase generation_tput_2sockets_48cores_6 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, ov::hint::SchedulingCoreType::ANY_CORE, false, false, ov::hint::PerformanceMode::THROUGHPUT, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{12, MAIN_CORE_PROC, 4}}, }; StreamGenerateionTestCase generation_tput_2sockets_48cores_7 = { 100, + true, 0, 0, 0, @@ -1752,18 +2493,20 @@ StreamGenerateionTestCase generation_tput_2sockets_48cores_7 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, ov::hint::SchedulingCoreType::ANY_CORE, false, false, ov::hint::PerformanceMode::THROUGHPUT, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{48, MAIN_CORE_PROC, 1}}, }; StreamGenerateionTestCase generation_tput_2sockets_48cores_8 = { 2, + true, 20, 0, 1, @@ -1773,18 +2516,20 @@ StreamGenerateionTestCase generation_tput_2sockets_48cores_8 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, ov::hint::SchedulingCoreType::ANY_CORE, false, false, ov::hint::PerformanceMode::THROUGHPUT, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{2, MAIN_CORE_PROC, 10}}, }; StreamGenerateionTestCase generation_tput_2sockets_48cores_9 = { 0, + false, 0, 0, 1, @@ -1794,13 +2539,14 @@ StreamGenerateionTestCase generation_tput_2sockets_48cores_9 = { false, true, ov::hint::PerformanceMode::THROUGHPUT, + ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, - {{96, 48, 0, 48}, {48, 24, 0, 24}, {48, 24, 0, 24}}, + {{96, 48, 0, 48, -1, -1}, {48, 24, 0, 24, 0, 0}, {48, 24, 0, 24, 1, 1}}, ov::hint::SchedulingCoreType::ANY_CORE, false, false, ov::hint::PerformanceMode::THROUGHPUT, - {{48, 48, 0, 0}, {24, 24, 0, 0}, {24, 24, 0, 0}}, + {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, {{48, MAIN_CORE_PROC, 1}}, }; @@ -1813,6 +2559,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_StreamsGeneration, generation_latency_1sockets_14cores_5, generation_latency_2sockets_48cores_6, generation_latency_2sockets_48cores_7, + generation_latency_2sockets_48cores_8, + generation_latency_2sockets_48cores_9, generation_tput_1sockets_14cores_1, generation_tput_1sockets_14cores_2, generation_tput_1sockets_14cores_3, From b4e608cf47a838cd20ec6f07341defba7de63884 Mon Sep 17 00:00:00 2001 From: Chen Xu Date: Tue, 20 Jun 2023 13:15:18 +0800 Subject: [PATCH 18/44] [Snippets] Implement shuffling based horizontal reduction emitter (#18099) --- .../src/emitters/x64/cpu_generator.cpp | 4 +- .../emitters/x64/jit_snippets_emitters.cpp | 100 ++++++++---------- .../emitters/x64/jit_snippets_emitters.hpp | 28 ++--- 3 files changed, 51 insertions(+), 81 deletions(-) diff --git a/src/plugins/intel_cpu/src/emitters/x64/cpu_generator.cpp b/src/plugins/intel_cpu/src/emitters/x64/cpu_generator.cpp index 1244fac99ad..6d776ab57eb 100644 --- a/src/plugins/intel_cpu/src/emitters/x64/cpu_generator.cpp +++ b/src/plugins/intel_cpu/src/emitters/x64/cpu_generator.cpp @@ -139,8 +139,8 @@ ov::intel_cpu::CPUTargetMachine::CPUTargetMachine(dnnl::impl::cpu::x64::cpu_isa_ jitters[ngraph::op::v7::Gelu::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_gelu_v7_emitter); jitters[snippets::op::Fill::get_type_info_static()] = CREATE_EMITTER(FillEmitter); - jitters[snippets::op::HorizonMax::get_type_info_static()] = CREATE_EMITTER(HorizonMaxEmitter); - jitters[snippets::op::HorizonSum::get_type_info_static()] = CREATE_EMITTER(HorizonSumEmitter); + jitters[snippets::op::HorizonMax::get_type_info_static()] = CREATE_EMITTER(HorizonEmitter); + jitters[snippets::op::HorizonSum::get_type_info_static()] = CREATE_EMITTER(HorizonEmitter); jitters[snippets::op::Kernel::get_type_info_static()] = CREATE_EMITTER(KernelEmitter); jitters[snippets::op::LoopBegin::get_type_info_static()] = CREATE_EMITTER(LoopBeginEmitter); diff --git a/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.cpp b/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.cpp index c339b72cfd1..09bdf0efd29 100644 --- a/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.cpp +++ b/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.cpp @@ -1334,10 +1334,18 @@ void BrgemmCopyBEmitter::execute(matmul::jit_brgemm_matmul_copy_b_t *kernel, con (*kernel)(&ctx); } -HorizonMaxEmitter::HorizonMaxEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl::cpu::x64::cpu_isa_t isa, const std::shared_ptr& n) : - jit_emitter(h, isa, n, Precision::FP32, emitter_in_out_map::vec_to_vec) {} +HorizonEmitter::HorizonEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl::cpu::x64::cpu_isa_t isa, const std::shared_ptr& n) : + jit_emitter(h, isa, n, Precision::FP32, emitter_in_out_map::vec_to_vec) { + if (ov::is_type(n)) { + m_op_type = OpType::max; + } else if (ov::is_type(n)) { + m_op_type = OpType::sum; + } else { + OPENVINO_THROW("HorizonEmitter exprects HorizonMax or HorizonSum ops"); + } +} -void HorizonMaxEmitter::emit_impl(const std::vector& in, +void HorizonEmitter::emit_impl(const std::vector& in, const std::vector& out) const { if (host_isa_ == dnnl::impl::cpu::x64::sse41) { emit_isa(in, out); @@ -1351,71 +1359,49 @@ void HorizonMaxEmitter::emit_impl(const std::vector& in, } template -void HorizonMaxEmitter::emit_isa(const std::vector &in, const std::vector &out) const { +void HorizonEmitter::emit_isa(const std::vector &in, const std::vector &out) const { using Vmm = typename dnnl::impl::utils::conditional3::type; Vmm src_vmm = Vmm(in[0]); - Xmm dst_xmm = Xmm(out[0]); - Xmm aux_xmm = Xmm(aux_vec_idxs[0]); + Vmm dst_vmm = Vmm(out[0]); + Vmm aux_vmm = Vmm(aux_vec_idxs[0]); - Reg64 aux_reg = Reg64(aux_gpr_idxs[0]); - - const size_t vlen = dnnl::impl::cpu::x64::cpu_isa_traits::vlen; - const size_t vec_size = vlen / sizeof(float); - h->sub(h->rsp, vlen); - h->uni_vmovups(h->ptr[h->rsp], src_vmm); - // Let the first value be the max - h->mov(aux_reg, h->ptr[h->rsp]); - h->vmovq(dst_xmm, aux_reg); - for (size_t i = 1; i < vec_size; i++) { - h->mov(aux_reg, h->ptr[h->rsp + i * sizeof(float)]); - h->vmovq(aux_xmm, aux_reg); - h->uni_vmaxps(dst_xmm, dst_xmm, aux_xmm); + if (in[0] != out[0]) + h->uni_vmovups(dst_vmm, src_vmm); + if (isa == dnnl::impl::cpu::x64::avx512_core) { + Zmm dst_zmm = Zmm(out[0]); + Zmm aux_zmm = Zmm(aux_vec_idxs[0]); + h->vshuff32x4(aux_zmm, dst_zmm, dst_zmm, 0x4E); + perform_op(dst_zmm, dst_zmm, aux_zmm); + h->vshuff32x4(aux_zmm, dst_zmm, dst_zmm, 0xB1); + perform_op(dst_zmm, dst_zmm, aux_zmm); + } else if (isa == dnnl::impl::cpu::x64::avx2) { + Ymm dst_ymm = Ymm(out[0]); + Ymm aux_ymm = Ymm(aux_vec_idxs[0]); + h->vperm2i128(aux_ymm, dst_ymm, dst_ymm, 0x01); + perform_op(dst_ymm, dst_ymm, aux_ymm); } - h->add(h->rsp, vlen); + h->uni_vshufps(aux_vmm, dst_vmm, dst_vmm, 0x4E); + perform_op(dst_vmm, dst_vmm, aux_vmm); + h->uni_vshufps(aux_vmm, dst_vmm, dst_vmm, 0xB1); + perform_op(dst_vmm, dst_vmm, aux_vmm); } -HorizonSumEmitter::HorizonSumEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl::cpu::x64::cpu_isa_t isa, const std::shared_ptr& n) : - jit_emitter(h, isa, n, Precision::FP32, emitter_in_out_map::vec_to_vec) {} - -void HorizonSumEmitter::emit_impl(const std::vector& in, - const std::vector& out) const { - if (host_isa_ == dnnl::impl::cpu::x64::sse41) { - emit_isa(in, out); - } else if (host_isa_ == dnnl::impl::cpu::x64::avx2) { - emit_isa(in, out); - } else if (host_isa_ == dnnl::impl::cpu::x64::avx512_core) { - emit_isa(in, out); - } else { - IE_THROW() << "HorizonSum emitter doesn't support " << host_isa_; +template +void HorizonEmitter::perform_op(const Vmm &vmm1, const Vmm &vmm2, const Vmm &vmm3) const { + switch (m_op_type) { + case OpType::max: + h->uni_vmaxps(vmm1, vmm2, vmm3); + break; + case OpType::sum: + h->uni_vaddps(vmm1, vmm2, vmm3); + break; + default: + assert(!"Unsupported horizontal operation."); } } -template -void HorizonSumEmitter::emit_isa(const std::vector &in, const std::vector &out) const { - using Vmm = typename dnnl::impl::utils::conditional3::type; - - Vmm src_vmm = Vmm(in[0]); - Xmm dst_xmm = Xmm(out[0]); - Xmm aux_xmm = Xmm(aux_vec_idxs[0]); - - Reg64 aux_reg = Reg64(aux_gpr_idxs[0]); - - const size_t vlen = dnnl::impl::cpu::x64::cpu_isa_traits::vlen; - const size_t vec_size = vlen / sizeof(float); - h->sub(h->rsp, vlen); - h->uni_vmovups(h->ptr[h->rsp], src_vmm); - h->uni_vpxor(dst_xmm, dst_xmm, dst_xmm); - for (size_t i = 0; i < vec_size; i++) { - h->mov(aux_reg, h->ptr[h->rsp + i * sizeof(float)]); - h->vmovq(aux_xmm, aux_reg); - h->uni_vaddps(dst_xmm, dst_xmm, aux_xmm); - } - h->add(h->rsp, vlen); -} - VectorBufferEmitter::VectorBufferEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl::cpu::x64::cpu_isa_t isa, const std::shared_ptr& n) : jit_emitter(h, isa, n, Precision::FP32, emitter_in_out_map::vec_to_vec) {} diff --git a/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.hpp b/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.hpp index cc4ba3a55f8..a4c3e1f835e 100644 --- a/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.hpp +++ b/src/plugins/intel_cpu/src/emitters/x64/jit_snippets_emitters.hpp @@ -417,9 +417,9 @@ private: size_t m_comp_offset = 0lu; }; -class HorizonMaxEmitter : public jit_emitter { +class HorizonEmitter : public jit_emitter { public: - HorizonMaxEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl::cpu::x64::cpu_isa_t isa, const std::shared_ptr& n); + HorizonEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl::cpu::x64::cpu_isa_t isa, const std::shared_ptr& n); size_t get_inputs_num() const override {return 1;} static std::set> get_supported_precisions(const std::shared_ptr& node = nullptr) { @@ -427,7 +427,6 @@ public: } protected: - size_t aux_gprs_count() const override {return 1;} size_t aux_vecs_count() const override {return 1;} private: @@ -436,27 +435,12 @@ private: template void emit_isa(const std::vector &in, const std::vector &out) const; -}; -class HorizonSumEmitter : public jit_emitter { -public: - HorizonSumEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl::cpu::x64::cpu_isa_t isa, const std::shared_ptr& n); + template + void perform_op(const Vmm &vmm1, const Vmm &vmm2, const Vmm &vmm3) const; - size_t get_inputs_num() const override {return 1;} - static std::set> get_supported_precisions(const std::shared_ptr& node = nullptr) { - return {{element::f32}}; - } - -protected: - size_t aux_gprs_count() const override {return 1;} - size_t aux_vecs_count() const override {return 1;} - -private: - void emit_impl(const std::vector& in, - const std::vector& out) const override; - - template - void emit_isa(const std::vector &in, const std::vector &out) const; + enum class OpType { max, sum }; + OpType m_op_type = OpType::max; }; class VectorBufferEmitter : public jit_emitter { From b7cc327cb875caa14866be6840dadddef58a7f9e Mon Sep 17 00:00:00 2001 From: Egor Duplenskii Date: Tue, 20 Jun 2023 08:01:33 +0200 Subject: [PATCH 19/44] [IE_TESTS] Correct random data generation for real numbers (#17734) --- .../functional/single_layer_tests/mvn.cpp | 1 - .../shared_test_classes/base/utils/ranges.hpp | 3 ++ .../src/base/utils/generate_inputs.cpp | 29 +++++++++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/single_layer_tests/mvn.cpp b/src/plugins/intel_cpu/tests/functional/single_layer_tests/mvn.cpp index 75998e069c1..f4b405e57a8 100644 --- a/src/plugins/intel_cpu/tests/functional/single_layer_tests/mvn.cpp +++ b/src/plugins/intel_cpu/tests/functional/single_layer_tests/mvn.cpp @@ -102,7 +102,6 @@ protected: selectedType = getPrimitiveType(); selectedType = makeSelectedTypeStr(selectedType, netPrecision); - rel_threshold = 0.015f; function = makeNgraphFunction(netPrecision, param, mvn, "mvn"); } }; diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp index 312980af3b1..8245b72fd08 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/ranges.hpp @@ -20,6 +20,9 @@ #include "ngraph/op/max.hpp" #include "ngraph/op/min.hpp" +#include +#include + namespace ov { namespace test { namespace utils { diff --git a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp index c5db6e6fa86..ad05a21f01d 100644 --- a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp +++ b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp @@ -19,16 +19,39 @@ namespace test { namespace utils { namespace { + +/** + * Sets proper range and resolution for real numbers generation + * + * range = 8 and resolution 32 + * + * The worst case scenario is 7 + 31/32 (7.96875) + * IEEE 754 representation is: + * ---------------------------------------------- + * sign | exponent | mantissa + * ---------------------------------------------- + * FP32 0 | 10000001 | 11111110000000000000000 + * FP16 0 | 10001 | 1111111000 + * BF16 0 | 10000001 | 1111111 + * ---------------------------------------------- + * + * All the generated numbers completely fit into the data type without truncation + */ +static inline void set_real_number_generation_data(InputGenerateData& inGenData) { + inGenData.range = 8; + inGenData.resolution = 32; +} + ov::runtime::Tensor generate(const std::shared_ptr& node, size_t port, const ov::element::Type& elemType, const ov::Shape& targetShape) { - size_t inNodeCnt = node->get_input_size(); InputGenerateData inGenData; if (elemType.is_real()) { - inGenData.range = 10; - inGenData.resolution = 256; + set_real_number_generation_data(inGenData); } + + const size_t inNodeCnt = node->get_input_size(); auto it = inputRanges.find(node->get_type_info()); if (it != inputRanges.end()) { const auto& ranges = it->second; From 37c538d6bd8c882fb951c50c14ee2ddf0ad2d3cc Mon Sep 17 00:00:00 2001 From: Mateusz Tabaka Date: Tue, 20 Jun 2023 10:02:56 +0200 Subject: [PATCH 20/44] Reject negative pads in SpaceToBatchFusion (#18028) --- .../space_to_batch_fusion.cpp | 32 ++++++++--- .../space_to_batch_fusion.cpp | 54 +++++++++++++++++++ 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/src/common/transformations/src/transformations/common_optimizations/space_to_batch_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/space_to_batch_fusion.cpp index fc9894a51cb..c0ab98d3a62 100644 --- a/src/common/transformations/src/transformations/common_optimizations/space_to_batch_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/space_to_batch_fusion.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -28,7 +29,7 @@ ov::pass::SpaceToBatchFusion::SpaceToBatchFusion() { auto pads_begin_pattern = pattern::wrap_type(); auto pads_end_pattern = pattern::wrap_type(); auto pad_value = pattern::wrap_type(); - auto pad_pattern = pattern::wrap_type( + auto pad_pattern = pattern::wrap_type( {reshape_or_transpose_before_pattern, pads_begin_pattern, pads_end_pattern, pad_value}); auto space_to_depth_pattern = pattern::wrap_type({pad_pattern}, pattern::has_static_shape()); auto reshape_after_pattern = @@ -60,6 +61,20 @@ ov::pass::SpaceToBatchFusion::SpaceToBatchFusion() { input_shape[2] == output_shape[2] && input_shape[3] == output_shape[3]; }; + auto pads_are_negative = [](const std::shared_ptr& pads) -> bool { + auto constant = ov::as_type_ptr(pads); + if (!constant) + return true; + + for (auto pad : constant->cast_vector()) { + if (pad < 0) { + return true; + } + } + + return false; + }; + std::shared_ptr reshape_or_trans_before = get_reshape_or_transpose(reshape_before_pattern, trans_before_pattern); if (!reshape_or_trans_before) @@ -73,7 +88,7 @@ ov::pass::SpaceToBatchFusion::SpaceToBatchFusion() { if (!check_input_output_shape(reshape_or_trans_after)) return false; - auto pad = std::dynamic_pointer_cast(pattern_map.at(pad_pattern).get_node_shared_ptr()); + auto pad = std::dynamic_pointer_cast(pattern_map.at(pad_pattern).get_node_shared_ptr()); if (!pad || pad->get_pad_mode() != op::PadMode::CONSTANT) return false; auto pad_value_const = @@ -84,6 +99,13 @@ ov::pass::SpaceToBatchFusion::SpaceToBatchFusion() { if (pad_value.size() != 1 || pad_value[0] != 0.0f) return false; + const auto pads_begin = pattern_map.at(pads_begin_pattern).get_node_shared_ptr(); + if (pads_are_negative(pads_begin)) + return false; + const auto pads_end = pattern_map.at(pads_end_pattern).get_node_shared_ptr(); + if (pads_are_negative(pads_end)) + return false; + auto space_to_depth = std::dynamic_pointer_cast( pattern_map.at(space_to_depth_pattern).get_node_shared_ptr()); if (!space_to_depth) @@ -93,10 +115,8 @@ ov::pass::SpaceToBatchFusion::SpaceToBatchFusion() { auto block_size = static_cast(space_to_depth->get_block_size()); auto block_shape = opset6::Constant::create(element::i64, Shape{4}, std::vector{1, 1, block_size, block_size}); - auto space_to_batch = register_new_node(pattern_map.at(data_pattern), - block_shape, - pattern_map.at(pads_begin_pattern), - pattern_map.at(pads_end_pattern)); + auto space_to_batch = + register_new_node(pattern_map.at(data_pattern), block_shape, pads_begin, pads_end); space_to_batch->set_friendly_name(reshape_or_trans_after->get_friendly_name()); copy_runtime_info( diff --git a/src/common/transformations/tests/common_optimizations/space_to_batch_fusion.cpp b/src/common/transformations/tests/common_optimizations/space_to_batch_fusion.cpp index 9eb1efd58be..65db0965750 100644 --- a/src/common/transformations/tests/common_optimizations/space_to_batch_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/space_to_batch_fusion.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,59 @@ TEST_F(TransformationTestsF, SpaceToBatchFusionTranspose) { } } +TEST_F(TransformationTestsF, SpaceToBatchFusionTransposePad12) { + { + auto data = std::make_shared(element::f32, Shape{12, 3, 4, 8}); + auto trans_before = + std::make_shared(data, op::Constant::create(element::i64, Shape{4}, {1, 0, 2, 3})); + auto pad = std::make_shared(trans_before, + op::Constant::create(element::i64, Shape{4}, {1, 1, 1, 1}), + op::Constant::create(element::i64, Shape{4}, {2, 2, 3, 3}), + op::Constant::create(element::f32, Shape{}, {0}), + op::PadMode::CONSTANT); + auto space_to_depth = + std::make_shared(pad, opset6::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST, 2); + auto trans_after = + std::make_shared(space_to_depth, + op::Constant::create(element::i64, Shape{4}, {1, 0, 2, 3})); + function = std::make_shared(NodeVector{trans_after}, ParameterVector{data}); + + manager.register_pass(); + } + + { + auto data = std::make_shared(element::f32, Shape{12, 3, 4, 8}); + auto space_to_batch = + std::make_shared(data, + op::Constant::create(element::i64, Shape{4}, {1, 1, 2, 2}), + op::Constant::create(element::i64, Shape{4}, {1, 1, 1, 1}), + op::Constant::create(element::i64, Shape{4}, {2, 2, 3, 3})); + + function_ref = std::make_shared(NodeVector{space_to_batch}, ParameterVector{data}); + } +} + +TEST_F(TransformationTestsF, SpaceToBatchFusionTransposeNegativePads) { + { + auto data = std::make_shared(element::f32, Shape{12, 3, 4, 8}); + auto trans_before = + std::make_shared(data, op::Constant::create(element::i64, Shape{4}, {1, 0, 2, 3})); + auto pad = std::make_shared(trans_before, + op::Constant::create(element::i64, Shape{4}, {1, 1, -1, -1}), + op::Constant::create(element::i64, Shape{4}, {2, 2, -3, -3}), + op::Constant::create(element::f32, Shape{}, {0}), + op::PadMode::CONSTANT); + auto space_to_depth = + std::make_shared(pad, opset6::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST, 4); + auto trans_after = + std::make_shared(space_to_depth, + op::Constant::create(element::i64, Shape{4}, {1, 0, 2, 3})); + function = std::make_shared(NodeVector{trans_after}, ParameterVector{data}); + + manager.register_pass(); + } +} + TEST_F(TransformationTestsF, SpaceToBatchFusionReshape) { { auto data = std::make_shared(element::f32, Shape{12, 3, 4, 8}); From a8a366de086c28a03b5d2cbb845aba1365c346a2 Mon Sep 17 00:00:00 2001 From: Ekaterina Aidova Date: Tue, 20 Jun 2023 17:31:30 +0400 Subject: [PATCH 21/44] [PT FE]: use example input for dtype and rank detection (#18083) * [PT FE]: use example input for dtype and rank detection, support unordered input dict * Apply suggestions from code review * restore old behaviour for old torch versions * move info addition after parsing --- .../src/openvino/frontend/pytorch/decoder.py | 46 +++--- .../test_mo_convert_pytorch.py | 141 ++++++++++++++---- tools/mo/openvino/tools/mo/convert_impl.py | 11 +- .../tools/mo/moc_frontend/extractor.py | 2 +- .../mo/moc_frontend/pytorch_frontend_utils.py | 106 ++++++++++++- 5 files changed, 244 insertions(+), 62 deletions(-) diff --git a/src/bindings/python/src/openvino/frontend/pytorch/decoder.py b/src/bindings/python/src/openvino/frontend/pytorch/decoder.py index e7be801ba33..0e3cc5f511e 100644 --- a/src/bindings/python/src/openvino/frontend/pytorch/decoder.py +++ b/src/bindings/python/src/openvino/frontend/pytorch/decoder.py @@ -9,6 +9,7 @@ from openvino.frontend.pytorch.py_pytorch_frontend import _Type as DecoderType from openvino.runtime import op, PartialShape, Type as OVType, OVAny, Shape import typing +from packaging.version import parse import torch import numpy as np @@ -133,24 +134,27 @@ class TorchScriptPythonDecoder (Decoder): import inspect def prepare_example_inputs(inputs, input_signature): - if inputs is not None: - if isinstance(inputs, dict): - if input_signature is not None: - ordered_inputs = [] - used_sign = [] - for key in input_signature: - if key not in inputs: - continue - ordered_inputs.append(inputs[key]) - used_sign.append(key) - inputs = ordered_inputs - input_signature = used_sign - else: - inputs = list(inputs.values()) - input_signature = input_signature[:len(inputs)] - if isinstance(inputs, torch.Tensor): - inputs = [inputs] - return inputs, input_signature + is_torch_2 = parse(torch.__version__) >= parse("2.0.0") + if isinstance(inputs, dict): + ordered_inputs = [] + if input_signature is not None: + used_sign = [] + for key in input_signature: + if key not in inputs: + continue + ordered_inputs.append(inputs[key]) + used_sign.append(key) + input_signature = used_sign + else: + ordered_inputs = list(inputs.values()) + if is_torch_2: + return {"example_kwarg_inputs": inputs}, input_signature + else: + inputs = ordered_inputs + if isinstance(inputs, torch.Tensor): + inputs = [inputs] + + return {"example_inputs": inputs}, input_signature if isinstance(pt_module, torch.nn.Module): pt_module.eval() @@ -160,14 +164,14 @@ class TorchScriptPythonDecoder (Decoder): if example_inputs is None: scripted = torch.jit.script(pt_module) else: - inputs, input_signature = prepare_example_inputs(example_inputs, input_signature) + input_parameters, input_signature = prepare_example_inputs(example_inputs, input_signature) try: - scripted = torch.jit.trace(pt_module, inputs) + scripted = torch.jit.trace(pt_module, **input_parameters) except Exception: try: scripted = torch.jit.script(pt_module) except Exception: - scripted = torch.jit.trace(pt_module, inputs, strict=False) + scripted = torch.jit.trace(pt_module, **input_parameters, strict=False) skip_freeze = False for n in scripted.inlined_graph.nodes(): # TODO: switch off freezing for all traced models diff --git a/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py b/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py index 44524cc84b5..402f0d3a907 100644 --- a/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py +++ b/tests/layer_tests/mo_python_api_tests/test_mo_convert_pytorch.py @@ -62,6 +62,26 @@ def make_pt_model_two_inputs(): return NeuralNetwork() +def make_pt_model_with_optional_input(): + from torch import nn + + class NeuralNetwork(nn.Module): + def __init__(self): + super(NeuralNetwork, self).__init__() + self.linear_relu_stack = nn.Sequential( + nn.ReLU(), + nn.Sigmoid(), + ) + + def forward(self, x, y=None, z=None): + if y is None: + logits = self.linear_relu_stack(x + z) + if z is None: + logits = self.linear_relu_stack(x * y) + return logits + + return NeuralNetwork() + def make_ref_pt_model_one_input(shape, dtype=np.float32): shape = PartialShape(shape) param1 = ov.opset8.parameter(shape, name="input_0", dtype=dtype) @@ -96,16 +116,37 @@ def make_ref_pt_model_two_inputs(shape, dtype=np.float32): return model +def make_ref_pt_model_with_optional_inputs(shape, dtype=np.float32, z_exist=False): + if len(shape) == 2: + param1 = ov.opset8.parameter(PartialShape( + shape[0]), name="input_0", dtype=dtype) + param2 = ov.opset8.parameter(PartialShape( + shape[1]), name="input_1", dtype=dtype) + else: + shape = PartialShape(shape) + param1 = ov.opset8.parameter(shape, name="input_0", dtype=dtype) + param2 = ov.opset8.parameter(shape, name="input_1", dtype=dtype) + + op = ov.opset8.multiply(param1, param2) if not z_exist else ov.opset8.add(param1, param2) + relu = ov.opset8.relu(op) + if dtype != np.float32: + relu = ov.opset8.convert(relu, np.float32) + sigm = ov.opset8.sigmoid(relu) + + parameter_list = [param1, param2] + model = Model([sigm], parameter_list, "test") + return model + + def create_pytorch_nn_module_case1(tmp_dir): pt_model = make_pt_model_two_inputs() - ref_model = make_ref_pt_model_two_inputs([-1, 3, -1, -1]) + ref_model = make_ref_pt_model_two_inputs([-1, -1, -1, -1]) sample_input1 = torch.zeros(1, 3, 10, 10) sample_input2 = torch.zeros(1, 3, 10, 10) sample_input = sample_input1, sample_input2 - return pt_model, ref_model, {'input': [([-1, 3, -1, -1], np.float32), ([-1, 3, -1, -1], np.float32)], - 'example_input': sample_input} + return pt_model, ref_model, {'example_input': sample_input} def create_pytorch_nn_module_case2(tmp_dir): @@ -117,7 +158,6 @@ def create_pytorch_nn_module_case2(tmp_dir): sample_input = sample_input1, sample_input2 return pt_model, ref_model, {'input_shape': ["[?,3,?,?]", PartialShape([-1, 3, -1, -1])], - 'input': [np.float32, np.float32], 'example_input': sample_input} @@ -130,7 +170,6 @@ def create_pytorch_nn_module_case3(tmp_dir): sample_input = tuple([sample_input1, sample_input2]) return pt_model, ref_model, {'input_shape': "[?,3,?,?],[?,3,?,?]", - 'input': [np.float32, np.float32], 'example_input': sample_input} @@ -139,10 +178,9 @@ def create_pytorch_nn_module_case4(tmp_dir): sample_input = torch.zeros(1, 3, 10, 10) - ref_model = make_ref_pt_model_one_input(PartialShape.dynamic()) + ref_model = make_ref_pt_model_one_input(PartialShape([1, 3, 20, 20])) - return pt_model, ref_model, {'input': [np.float32], - 'example_input': sample_input} + return pt_model, ref_model, {'example_input': sample_input, "input_shape": [1, 3, 20, 20]} def create_pytorch_nn_module_case5(tmp_dir): @@ -163,6 +201,15 @@ def create_pytorch_nn_module_case6(tmp_dir): return pt_model, ref_model, {'input': (shape, np.float32)} +def create_pytorch_nn_module_case7(tmp_dir): + pt_model = make_pt_model_one_input() + + sample_input = torch.zeros(1, 3, 10, 10, dtype=torch.int32) + + ref_model = make_ref_pt_model_one_input(PartialShape([1, 3, 20, 20]), dtype=np.int32) + + return pt_model, ref_model, {'example_input': sample_input, "input": ([1, 3, 20, 20], np.int32)} + def create_pytorch_nn_module_torch_size(tmp_dir): pt_model = make_pt_model_one_input() ref_model = make_ref_pt_model_one_input([1, 3, 2, 10]) @@ -176,7 +223,7 @@ def create_pytorch_nn_module_sample_input_int32(tmp_dir): sample_input = torch.zeros(1, 3, 10, 10, dtype=torch.int32) - ref_model = make_ref_pt_model_one_input(shape, dtype=numpy.int32) + ref_model = make_ref_pt_model_one_input(shape, dtype=np.int32) return pt_model, ref_model, {'example_input': sample_input, 'input': (shape, np.int32)} @@ -216,7 +263,7 @@ def create_pytorch_jit_script_function(tmp_dir): inp_shape = PartialShape([Dimension(1, -1), Dimension(-1, 5), 10]) ref_model = make_ref_pt_model_two_inputs(inp_shape) - return scripted_fn, ref_model, {'input': [(inp_shape, np.float32), (inp_shape, np.float32)]} + return scripted_fn, ref_model, {'input': [(inp_shape), (inp_shape)]} @@ -232,7 +279,6 @@ def create_pytorch_nn_module_layout_list(tmp_dir): return pt_model, ref_model, { 'input_shape': [shape, shape], 'layout': ['nchw', Layout('nhwc')], - 'input': [np.float32, np.float32] } @@ -247,8 +293,7 @@ def create_pytorch_nn_module_layout_list_case2(tmp_dir): ref_model.inputs[1].node.layout = Layout('nhwc') return pt_model, ref_model, { - 'input_shape': [shape, shape], 'layout': ('nchw', Layout('nhwc')), - 'input': [np.float32, np.float32]} + 'input_shape': [shape, shape], 'layout': ('nchw', Layout('nhwc'))} def create_pytorch_nn_module_mean_list(tmp_dir): @@ -270,8 +315,7 @@ def create_pytorch_nn_module_mean_list(tmp_dir): ref_model = Model([sigm], parameter_list, "test") return pt_model, ref_model, { - 'input_shape': [shape, shape], 'mean_values': [[0, 0, 0], [0, 0, 0]], 'compress_to_fp16': False, - 'input': [np.float32, np.float32]} + 'input_shape': [shape, shape], 'mean_values': [[0, 0, 0], [0, 0, 0]], 'compress_to_fp16': False} def create_pytorch_nn_module_mean_list_default_no_compression(tmp_dir): @@ -293,7 +337,7 @@ def create_pytorch_nn_module_mean_list_default_no_compression(tmp_dir): parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") - return pt_model, ref_model, {'input_shape': [shape, shape], 'mean_values': [[0, 0, 0], [0, 0, 0]], 'input': [np.float32, np.float32]} + return pt_model, ref_model, {'input_shape': [shape, shape], 'mean_values': [[0, 0, 0], [0, 0, 0]]} def create_pytorch_nn_module_mean_list_compression_enabled(tmp_dir): @@ -316,7 +360,7 @@ def create_pytorch_nn_module_mean_list_compression_enabled(tmp_dir): return pt_model, ref_model, { 'input_shape': [shape, shape], 'mean_values': [[0, 0, 0], [0, 0, 0]], - 'compress_to_fp16': False, 'input': [np.float32, np.float32]} + 'compress_to_fp16': False} def create_pytorch_nn_module_scale_list(tmp_dir): @@ -337,7 +381,7 @@ def create_pytorch_nn_module_scale_list(tmp_dir): parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") - return pt_model, ref_model, {'input_shape': [shape, shape], 'scale_values': [[1, 1, 1], [1, 1, 1]], 'compress_to_fp16': False, 'input': [np.float32, np.float32]} + return pt_model, ref_model, {'input_shape': [shape, shape], 'scale_values': [[1, 1, 1], [1, 1, 1]], 'compress_to_fp16': False} def create_pytorch_nn_module_scale_list_default_no_compression(tmp_dir): @@ -359,7 +403,7 @@ def create_pytorch_nn_module_scale_list_default_no_compression(tmp_dir): parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") - return pt_model, ref_model, {'input_shape': [shape, shape], 'scale_values': [[1, 1, 1], [1, 1, 1]], 'input': [np.float32, np.float32]} + return pt_model, ref_model, {'input_shape': [shape, shape], 'scale_values': [[1, 1, 1], [1, 1, 1]]} def create_pytorch_nn_module_scale_list_compression_enabled(tmp_dir): @@ -382,7 +426,7 @@ def create_pytorch_nn_module_scale_list_compression_enabled(tmp_dir): parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") - return pt_model, ref_model, {'input_shape': [shape, shape], 'scale_values': [[1, 1, 1], [1, 1, 1]], 'input': [np.float32, np.float32], + return pt_model, ref_model, {'input_shape': [shape, shape], 'scale_values': [[1, 1, 1], [1, 1, 1]], 'compress_to_fp16': True} @@ -390,7 +434,7 @@ def create_pytorch_nn_module_shapes_list_static(tmp_dir): pt_model = make_pt_model_two_inputs() ref_model = make_ref_pt_model_two_inputs([1, 3, 20, 20]) - return pt_model, ref_model, {'input_shape': [[1, 3, 20, 20], [1, 3, 20, 20]], 'input': [np.float32, np.float32]} + return pt_model, ref_model, {'input_shape': [[1, 3, 20, 20], [1, 3, 20, 20]]} def create_pytorch_nn_module_shapes_list_static_via_input(tmp_dir): @@ -415,7 +459,7 @@ def create_pytorch_nn_module_shapes_list_dynamic(tmp_dir): parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") - return pt_model, ref_model, {'input_shape': inp_shapes, 'input': [np.float32, np.float32]} + return pt_model, ref_model, {'input_shape': inp_shapes} def create_pytorch_nn_module_shapes_list_dynamic_via_input(tmp_dir): @@ -433,14 +477,14 @@ def create_pytorch_nn_module_shapes_list_dynamic_via_input(tmp_dir): parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") - return pt_model, ref_model, {'input': [(inp_shapes[0], np.float32), (inp_shapes[1], np.float32)]} + return pt_model, ref_model, {'input': [(inp_shapes[0],), (inp_shapes[1],)]} def create_pytorch_nn_module_shapes_list_dynamic_single_input(tmp_dir): pt_model = make_pt_model_one_input() inp_shapes = [[Dimension(-1), 3, 20, Dimension(20, -1)]] ref_model = make_ref_pt_model_one_input(inp_shapes[0]) - return pt_model, ref_model, {'input_shape': inp_shapes, 'input': np.float32} + return pt_model, ref_model, {'input_shape': inp_shapes} def create_pytorch_nn_module_shapes_list_dynamic_single_input_via_input(tmp_dir): @@ -454,7 +498,7 @@ def create_pytorch_nn_module_shapes_list_static_single_input(tmp_dir): pt_model = make_pt_model_one_input() inp_shapes = [[1, 3, 20, 20]] ref_model = make_ref_pt_model_one_input(inp_shapes[0]) - return pt_model, ref_model, {'input_shape': inp_shapes, 'input': np.float32} + return pt_model, ref_model, {'input_shape': inp_shapes} def create_pytorch_nn_module_shapes_list_static_single_input_via_input(tmp_dir): @@ -548,8 +592,7 @@ def create_pytorch_jit_script_module_convert_pytorch_frontend(tmp_dir): parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") return scripted_model, ref_model, { - "example_input": {"x": torch.zeros((1, 3, 10, 10)), "y": torch.ones((1, 3, 10, 10))}, - 'input': [InputCutInfo(shape=[-1, -1, -1, -1], type="f32"), InputCutInfo(shape=[-1, -1, -1, -1], type="f32")]} + "example_input": [torch.zeros((1, 3, 10, 10)), torch.ones((1, 3, 10, 10))]} def create_pytorch_jit_trace_module_convert_pytorch_frontend(tmp_dir): @@ -567,8 +610,7 @@ def create_pytorch_jit_trace_module_convert_pytorch_frontend(tmp_dir): sigm = ov.opset10.sigmoid(relu) parameter_list = [param1, param2] ref_model = Model([sigm], parameter_list, "test") - return scripted_model, ref_model, {"example_input": example_input, 'input': [ - InputCutInfo(shape=[-1, -1, -1, -1], type="f32"), InputCutInfo(shape=[-1, -1, -1, -1], type="f32")]} + return scripted_model, ref_model, {"example_input": example_input} def create_pytorch_module_convert_pytorch_frontend_oob(tmp_dir): @@ -595,6 +637,39 @@ def create_pytorch_module_convert_pytorch_frontend_oob(tmp_dir): return net, ref_model, {} +def create_pytorch_module_with_optional_inputs_case1(tmp_dir): + net = make_pt_model_with_optional_input() + example_input = {"x": torch.zeros((1,3,10,10)), "y": torch.ones((1,3,10,10))} + ref_model = make_ref_pt_model_with_optional_inputs([-1, -1, -1, -1]) + return net, ref_model, {"example_input": example_input} + + +def create_pytorch_module_with_optional_inputs_case2(tmp_dir): + net = make_pt_model_with_optional_input() + example_input = {"x": torch.zeros((1,3,10,10)), "z": torch.ones((1,3,10,10))} + ref_model = make_ref_pt_model_with_optional_inputs([-1, -1, -1, -1], z_exist=True) + return net, ref_model, {"example_input": example_input} + + +def create_pytorch_module_with_optional_inputs_case3(tmp_dir): + net = make_pt_model_with_optional_input() + example_input = {"x": torch.zeros((1,3,10,10)), "z": torch.ones((1,3,10,10))} + ref_model = make_ref_pt_model_with_optional_inputs([3, 3, 3, 3], z_exist=True) + return net, ref_model, {"example_input": example_input, "input_shape": [[3, 3, 3, 3], [3, 3, 3, 3]]} + + +def create_pytorch_module_with_optional_inputs_case4(tmp_dir): + net = make_pt_model_with_optional_input() + ref_model = make_ref_pt_model_with_optional_inputs([3, 3, 3, 3], z_exist=True) + return net, ref_model, {"input": [("x", [3, 3, 3, 3]), ("z", [3, 3, 3, 3])]} + + +def create_pytorch_module_with_optional_inputs_case5(tmp_dir): + net = make_pt_model_with_optional_input() + ref_model = make_ref_pt_model_with_optional_inputs([1, 3, -1, -1], z_exist=True) + return net, ref_model, {"input": ["x", "z"], "input_shape": [[1, 3, -1, -1], [1, 3, -1, -1]]} + + class TestMoConvertPyTorch(CommonMOConvertTest): test_data = [ create_pytorch_nn_module_case1, @@ -603,6 +678,7 @@ class TestMoConvertPyTorch(CommonMOConvertTest): create_pytorch_nn_module_case4, create_pytorch_nn_module_case5, create_pytorch_nn_module_case6, + create_pytorch_nn_module_case7, create_pytorch_nn_module_torch_size, create_pytorch_nn_module_sample_input_int32, create_pytorch_nn_module_sample_input_int32_two_inputs, @@ -630,7 +706,12 @@ class TestMoConvertPyTorch(CommonMOConvertTest): create_pytorch_nn_module_convert_pytorch_frontend4, create_pytorch_jit_script_module_convert_pytorch_frontend, create_pytorch_jit_trace_module_convert_pytorch_frontend, - create_pytorch_module_convert_pytorch_frontend_oob + create_pytorch_module_convert_pytorch_frontend_oob, + create_pytorch_module_with_optional_inputs_case1, + create_pytorch_module_with_optional_inputs_case2, + create_pytorch_module_with_optional_inputs_case3, + create_pytorch_module_with_optional_inputs_case4, + create_pytorch_module_with_optional_inputs_case5 ] @ pytest.mark.parametrize("create_model", test_data) diff --git a/tools/mo/openvino/tools/mo/convert_impl.py b/tools/mo/openvino/tools/mo/convert_impl.py index 44028578caf..ab00c552cdc 100644 --- a/tools/mo/openvino/tools/mo/convert_impl.py +++ b/tools/mo/openvino/tools/mo/convert_impl.py @@ -48,7 +48,7 @@ from openvino.tools.mo.utils.utils import refer_to_faq_msg, check_values_equal from openvino.tools.mo.utils.telemetry_utils import send_params_info, send_framework_info, send_conversion_result, \ get_tid from openvino.tools.mo.moc_frontend.check_config import legacy_extensions_used -from openvino.tools.mo.moc_frontend.pytorch_frontend_utils import get_pytorch_decoder +from openvino.tools.mo.moc_frontend.pytorch_frontend_utils import get_pytorch_decoder, extract_input_info_from_example from openvino.tools.mo.moc_frontend.paddle_frontend_utils import paddle_frontend_converter from openvino.tools.mo.moc_frontend.shape_utils import parse_input_shapes @@ -760,6 +760,9 @@ def python_api_params_parsing(argv: argparse.Namespace): argv.placeholder_shapes = shape_list if shape_list else None argv.placeholder_data_types = data_type_list if data_type_list else {} + if argv.framework == "pytorch" and getattr(argv, "example_input", None) is not None: + extract_input_info_from_example(argv, inputs) + def pack_params_to_args_namespace(args: dict, cli_parser: argparse.ArgumentParser): if len(args) > 0: @@ -838,9 +841,7 @@ def _convert(cli_parser: argparse.ArgumentParser, framework, args, python_api_us elif 'example_inputs' in args: raise AssertionError("'example_inputs' argument is not recognized, maybe you meant to provide 'example_input'?") - decoder = get_pytorch_decoder(args['input_model'], parse_input_shapes(args), example_inputs, args.get("input")) - args['input_model'] = decoder - args['framework'] = model_framework + decoder = get_pytorch_decoder(args['input_model'], parse_input_shapes(args), example_inputs, args) if model_framework == "paddle": example_inputs = None if 'example_input' in args and args['example_input'] is not None: @@ -950,6 +951,6 @@ def _convert(cli_parser: argparse.ArgumentParser, framework, args, python_api_us send_conversion_result('fail') if python_api_used: - raise e.with_traceback(None) + raise e#.with_traceback(None) else: return None, argv diff --git a/tools/mo/openvino/tools/mo/moc_frontend/extractor.py b/tools/mo/openvino/tools/mo/moc_frontend/extractor.py index 7b93dca7ab6..97effaeaa7a 100644 --- a/tools/mo/openvino/tools/mo/moc_frontend/extractor.py +++ b/tools/mo/openvino/tools/mo/moc_frontend/extractor.py @@ -399,7 +399,7 @@ def convert_params_lists_to_dicts(input_model, # this cycle adds each unnamed type to dictionary using name from model_inputs for idx, node_type in enumerate(input_user_data_types): - assert isinstance(node_type, (type, Type)), "Got incorrect format of input types. " \ + assert isinstance(node_type, (type, np.dtype, Type)), "Got incorrect format of input types. " \ "Expected numpy type or openvino.runtime.Type, " \ "got {}.".format(type(node_type)) diff --git a/tools/mo/openvino/tools/mo/moc_frontend/pytorch_frontend_utils.py b/tools/mo/openvino/tools/mo/moc_frontend/pytorch_frontend_utils.py index 9de19af062f..f8419ae4edb 100644 --- a/tools/mo/openvino/tools/mo/moc_frontend/pytorch_frontend_utils.py +++ b/tools/mo/openvino/tools/mo/moc_frontend/pytorch_frontend_utils.py @@ -5,21 +5,111 @@ import logging as log import numpy as np from openvino.tools.mo.moc_frontend.shape_utils import get_static_shape from openvino.tools.mo.utils.error import Error -from openvino.runtime import Tensor, Type +from openvino.runtime import Tensor, Type, PartialShape from openvino.runtime.utils.types import get_element_type_str from openvino.tools.mo.utils.cli_parser import input_to_input_cut_info, input_shape_to_input_cut_info -def get_pytorch_decoder(model, input_shape, example_inputs, input_info): +def get_pytorch_decoder(model, input_shape, example_inputs, args): try: from openvino.frontend.pytorch.decoder import TorchScriptPythonDecoder except Exception as e: log.error("PyTorch frontend loading failed") raise e - inputs = prepare_torch_inputs(example_inputs, input_shape, input_info, allow_none=True) + inputs = prepare_torch_inputs(example_inputs, input_shape, args.get("input"), allow_none=True) decoder = TorchScriptPythonDecoder(model, example_input=inputs) + args['input_model'] = decoder + args["framework"] = "pytorch" + args["example_input"] = inputs - return decoder + return args + + +def update_list_or_dict(container, name, idx, value): + if isinstance(container, dict): + if name is None: + name = list(container)[idx] + container[name] = value + return + if idx == len(container): + container.append(value) + elif idx > len(container): + raise Error(f"Wrong {idx}") + else: + container[idx] = value + return + + +def get_value_from_list_or_dict(container, name, idx): + if isinstance(container, dict): + if name is None: + if idx < len(container): + name = list(container)[idx] + return None + return container.get(name) + if idx < len(container): + return container[idx] + return None + + +def extract_input_info_from_example(args, inputs): + try: + from openvino.frontend.pytorch.decoder import pt_to_ov_type_map + except Exception as e: + log.error("PyTorch frontend loading failed") + raise e + example_inputs = args.example_input + data_types = args.placeholder_data_types or {} + input_shapes = args.placeholder_shapes or {} + is_dict_input = isinstance(example_inputs, dict) + list_inputs = list(example_inputs.values()) if is_dict_input else example_inputs + input_names = None if not is_dict_input else list(example_inputs) + if not isinstance(list_inputs, (list, tuple)): + list_inputs = [list_inputs] + if not data_types and input_names is None: + data_types = [] + if not input_shapes and input_names is None: + input_shapes = [] + if inputs: + for input_id, input_info in enumerate(inputs): + input_name = input_info.name + if is_dict_input and input_name in example_inputs: + example_input = example_inputs[input_name] + else: + example_input = list_inputs[input_id] + if is_dict_input and input_name is None: + input_name = input_names[input_id] + dtype = getattr(example_input, "dtype", type(example_input)) + example_dtype = pt_to_ov_type_map.get(str(dtype)) + user_dtype = get_value_from_list_or_dict(data_types, input_name, input_id) + if user_dtype is not None and example_dtype.to_dtype() != user_dtype: + raise Error(f"Defined input type {user_dtype} is not equal to provided example_input type {example_dtype.to_dtype()}") + + data_rank = getattr(example_input, "ndim", 0) + user_input_shape = get_value_from_list_or_dict(input_shapes, input_name, input_id) + if user_input_shape.rank.get_length() != data_rank: + raise Error( + f"Requested input shape {user_input_shape.rank.get_length()} rank" + f" is not equal to provided example_input rank {data_rank}") + + input_shape = user_input_shape if user_input_shape is not None else PartialShape([-1] * data_rank) + update_list_or_dict(data_types, input_name, input_id, example_dtype.to_dtype()) + update_list_or_dict(input_shapes, input_name, input_id, input_shape) + else: + for input_id, example_input in enumerate(list_inputs): + dtype = getattr(example_input, "dtype", type(example_input)) + ov_dtype = pt_to_ov_type_map.get(str(dtype)) + data_rank = getattr(example_input, "ndim", 0) + input_shape = PartialShape([-1] * data_rank) + input_name = input_names[input_id] if input_names else None + update_list_or_dict(input_shapes, input_name, input_id, input_shape) + update_list_or_dict(data_types, input_name, input_id, ov_dtype.to_dtype()) + + args.placeholder_data_types = data_types + args.placeholder_shapes = input_shapes + if not args.input and input_names: + args.input_list = input_names + args.input = ",".join(input_names) def to_torch_tensor(tensor): @@ -91,6 +181,7 @@ def prepare_torch_inputs(example_inputs, input_shape, input_info=None, allow_non input_info = input_to_input_cut_info(input_info) or [] input_shape_to_input_cut_info(input_shape, input_info) inputs = [] + inputs_with_names = {} for inp in input_info: shape = inp.shape if shape is None: @@ -100,9 +191,14 @@ def prepare_torch_inputs(example_inputs, input_shape, input_info=None, allow_non break dtype = get_torch_dtype(inp.type) static_shape = get_static_shape(shape, dynamic_value=1) - inputs.append(torch.zeros(static_shape, dtype=dtype)) + input_tensor = torch.zeros(static_shape, dtype=dtype) + if inp.name is not None: + inputs_with_names[inp.name] = input_tensor + inputs.append(input_tensor) if isinstance(inputs, list): inputs = tuple(inputs) + if inputs is not None and len(inputs) == len(inputs_with_names): + inputs = inputs_with_names else: if not allow_none: raise Error("Please provide input_shape or example_input for converting PyTorch model.") From c05d8862cf5dec0f9b5f7a8af395b5c001b52351 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 20 Jun 2023 19:40:35 +0400 Subject: [PATCH 22/44] Added ocl-icd as dependency for GPU to install_dependencies.sh (#18123) --- .../install_openvino_dependencies.sh | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/install_dependencies/install_openvino_dependencies.sh b/scripts/install_dependencies/install_openvino_dependencies.sh index 04436842663..d805bad1cd9 100755 --- a/scripts/install_dependencies/install_openvino_dependencies.sh +++ b/scripts/install_dependencies/install_openvino_dependencies.sh @@ -54,13 +54,14 @@ fi # Selftest if [ -n "$selftest" ] ; then - for image in centos7 centos8 rhel8 rhel9.1 \ - almalinux8.7 amzn2 \ - fedora34 fedora35 fedora36 fedora37 fedora38 \ - raspbian9 debian9 ubuntu18.04 \ - raspbian10 debian10 ubuntu20.04 ubuntu20.10 ubuntu21.04 \ - raspbian11 debian11 ubuntu21.10 ubuntu22.04 \ - raspbian12 debian12 ubuntu22.10 ubuntu23.04 ; do + for image in centos:7 centos:8 rhel:8 rhel:9.1 \ + almalinux:8.7 amazonlinux:2 \ + fedora:34 fedora:35 fedora:36 fedora:37 fedora:38 \ + opensuse/leap:15.3 \ + raspbian:9 debian:9 ubuntu:18.04 \ + raspbian:10 debian:10 ubuntu:20.04 ubuntu:20.10 ubuntu:21.04 \ + raspbian:11 debian:11 ubuntu:21.10 ubuntu:22.04 \ + raspbian:12 debian:12 ubuntu:22.10 ubuntu:23.04 ; do for opt in "-h" "-p" "-e -p" "-n" "-n -e" "-y" "-y -e" ; do echo "||" echo "|| Test $image / '$opt'" @@ -118,14 +119,14 @@ if [ "$os" == "raspbian9" ] || [ "$os" == "debian9" ] ; then # which are not supported by OpenVINO pkgs_core=(libpugixml1v5) - pkgs_gpu=() + pkgs_gpu=(ocl-icd-libopencl1) pkgs_python=() pkgs_dev=(pkg-config g++ gcc libc6-dev libgflags-dev zlib1g-dev nlohmann-json-dev make curl sudo) elif [ "$os" == "ubuntu18.04" ] ; then pkgs_core=(libtbb2 libpugixml1v5) - pkgs_gpu=() + pkgs_gpu=(ocl-icd-libopencl1) pkgs_python=(python3.8 libpython3.8 python3.8-venv python3-pip) pkgs_dev=(cmake pkg-config g++ gcc libc6-dev libgflags-dev zlib1g-dev nlohmann-json-dev make curl sudo) @@ -134,7 +135,7 @@ elif [ "$os" == "ubuntu20.04" ] || [ "$os" == "debian10" ] || [ "$os" == "raspbi [ "$os" == "ubuntu22.10" ] || [ "$os" == "ubuntu23.04" ] || [ "$os" == "debian12" ] || [ "$os" == "raspbian12" ]; then pkgs_core=(libpugixml1v5) - pkgs_gpu=() + pkgs_gpu=(ocl-icd-libopencl1) pkgs_python=(python3 python3-venv python3-pip) pkgs_dev=(cmake pkg-config g++ gcc libc6-dev libgflags-dev zlib1g-dev nlohmann-json3-dev make curl sudo) @@ -195,6 +196,7 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || if [ "$os" == "centos7" ] || [ "$os" == "amzn2" ] ; then pkgs_core=("tbb.$arch" "pugixml.$arch" "gflags.$arch") + pkgs_gpu+=("ocl-icd.$arch") pkgs_dev+=("gflags-devel.$arch") extra_repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm") elif [ "$os" == "centos8" ] || [ "$os" == "rhel8" ] || [ "$os" == "almalinux8.7" ] ; then @@ -203,9 +205,7 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || "https://download-ib01.fedoraproject.org/pub/epel/8/Everything/$arch/Packages/p/pugixml-1.13-1.el8.$arch.rpm" "https://vault.centos.org/centos/8/PowerTools/$arch/os/Packages/gflags-2.1.2-6.el8.$arch.rpm" ) - pkgs_gpu+=( - "http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/ocl-icd-2.2.12-1.el8.x86_64.rpm" - ) + pkgs_gpu+=("http://mirror.centos.org/centos/8-stream/AppStream/$arch/os/Packages/ocl-icd-2.2.12-1.el8.$arch.rpm") pkgs_python+=(python38 python38-pip) pkgs_dev+=( "https://vault.centos.org/centos/8/PowerTools/$arch/os/Packages/gflags-devel-2.1.2-6.el8.$arch.rpm" @@ -218,13 +218,14 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || "https://download-ib01.fedoraproject.org/pub/epel/9/Everything/$arch/Packages/p/pugixml-1.13-1.el9.$arch.rpm" "https://download-ib01.fedoraproject.org/pub/epel/9/Everything/$arch/Packages/g/gflags-2.2.2-9.el9.$arch.rpm" ) + pkgs_gpu+=("https://mirror.stream.centos.org/9-stream/AppStream/$arch/os/Packages/ocl-icd-2.2.13-4.el9.$arch.rpm") pkgs_python=(python3 python3-pip) pkgs_dev+=("https://download-ib01.fedoraproject.org/pub/epel/9/Everything/$arch/Packages/g/gflags-devel-2.2.2-9.el9.$arch.rpm") extra_repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm") fi elif [ "$os" == "opensuse-leap15.3" ] ; then pkgs_core=(libtbb2 libtbbmalloc2 libpugixml1) - pkgs_gpu=() + pkgs_gpu=(libOpenCL1) pkgs_python=(python39-base python39 python39-venv python39-pip) pkgs_dev=(cmake pkg-config gcc-c++ gcc gflags-devel-static zlib-devel nlohmann_json-devel make curl sudo) else From 05e8bd375eda542f7df1631e4fc6aaf8da55db74 Mon Sep 17 00:00:00 2001 From: yanlan song Date: Wed, 21 Jun 2023 00:10:59 +0800 Subject: [PATCH 23/44] Bell/auto api 2.0 (#17805) * 2.0 innitial Signed-off-by: fishbell * enable all tests Signed-off-by: fishbell * remove unecessary files Signed-off-by: fishbell * move container header to auto foler, remove uncessary macro define Signed-off-by: fishbell * enable caching Signed-off-by: fishbell * enable query_model Signed-off-by: fishbell * support loaded_from_cache property Signed-off-by: fishbell * fix some build warning Signed-off-by: fishbell fake inputs/outputs if needed Signed-off-by: fishbell * resolve conflict Signed-off-by: fishbell * skip unsupported test Signed-off-by: fishbell * use mock icore from common foler Signed-off-by: fishbell * fix failure for remote tensors Signed-off-by: fishbell * apply ppp related fix in auto Signed-off-by: fishbell * fix build warning on windows Signed-off-by: fishbell * fix ppp output layout issue Signed-off-by: fishbell * fix ppp output layout issue Signed-off-by: fishbell * clean up headers Signed-off-by: fishbell * log formatting Signed-off-by: fishbell * enable fps logging for binder mode Signed-off-by: fishbell * apply review comments apply review comments Signed-off-by: fishbell * remove all legacy namings, exenetwork/network/metric/IE etc Signed-off-by: fishbell * update readme Signed-off-by: fishbell * fix build lto issue Signed-off-by: fishbell * minor wording Signed-off-by: fishbell * case fix Signed-off-by: fishbell --------- Signed-off-by: fishbell Co-authored-by: Chen Peter --- .ci/azure/linux.yml | 4 +- .ci/azure/windows.yml | 4 +- .../threading/thread_safe_containers.hpp | 144 +++ src/plugins/auto/README.md | 6 +- src/plugins/auto/docs/tests.md | 10 +- src/plugins/auto/src/async_infer_request.cpp | 39 +- src/plugins/auto/src/async_infer_request.hpp | 36 +- src/plugins/auto/src/auto_compiled_model.cpp | 252 ++++ src/plugins/auto/src/auto_compiled_model.hpp | 38 + .../auto/src/auto_executable_network.cpp | 283 ----- .../auto/src/auto_executable_network.hpp | 39 - src/plugins/auto/src/auto_schedule.cpp | 1023 +++++------------ src/plugins/auto/src/auto_schedule.hpp | 121 +- src/plugins/auto/src/bind_multi_schedule.cpp | 98 -- src/plugins/auto/src/bind_multi_schedule.hpp | 28 - src/plugins/auto/src/common.hpp | 266 +++-- src/plugins/auto/src/compiled_model.cpp | 87 ++ src/plugins/auto/src/compiled_model.hpp | 37 + .../auto/src/cumulative_compiled_model.cpp | 157 +++ .../auto/src/cumulative_compiled_model.hpp | 38 + src/plugins/auto/src/cumulative_schedule.cpp | 254 ++++ src/plugins/auto/src/cumulative_schedule.hpp | 29 + src/plugins/auto/src/executable_network.cpp | 44 - src/plugins/auto/src/executable_network.hpp | 34 - src/plugins/auto/src/infer_request.cpp | 225 ++-- src/plugins/auto/src/infer_request.hpp | 58 +- src/plugins/auto/src/itt.hpp | 13 +- src/plugins/auto/src/plugin.cpp | 1019 ++++++++-------- src/plugins/auto/src/plugin.hpp | 105 +- src/plugins/auto/src/plugin_config.cpp | 18 +- src/plugins/auto/src/plugin_config.hpp | 76 +- src/plugins/auto/src/schedule.cpp | 306 +++++ src/plugins/auto/src/schedule.hpp | 61 +- src/plugins/auto/src/utils/log.cpp | 11 +- src/plugins/auto/src/utils/log.hpp | 144 +-- src/plugins/auto/src/utils/log_util.hpp | 66 +- src/plugins/auto/src/utils/non_copyable.hpp | 13 +- src/plugins/auto/src/utils/singleton.hpp | 13 +- src/plugins/auto/src/utils/time_utils.cpp | 20 +- src/plugins/auto/src/utils/time_utils.hpp | 27 +- src/plugins/auto/tests/unit/CMakeLists.txt | 2 +- .../unit/auto_async_infer_request_test.cpp | 129 --- .../auto/tests/unit/auto_ctput_call_multi.cpp | 236 ---- .../auto/tests/unit/auto_ctput_test.cpp | 277 ----- .../tests/unit/auto_dynamic_output_test.cpp | 105 -- .../unit/auto_infer_request_test_base.cpp | 107 -- .../auto_load_network_properties_test.cpp | 334 ------ .../tests/unit/auto_release_helper_test.cpp | 208 ---- .../tests/unit/auto_runtime_fallback_test.cpp | 457 -------- .../tests/unit/auto_set_log_level_test.cpp | 138 --- .../auto_startup_fallback_properties_test.cpp | 147 --- .../auto/tests/unit/auto_unit_test.cpp | 158 +++ .../tests/unit/compile_model_metric_test.cpp | 431 +++++++ .../unit/compile_model_property_test.cpp | 184 +++ src/plugins/auto/tests/unit/ctput_test.cpp | 219 ++++ ...nt_test.cpp => default_perf_hint_test.cpp} | 244 +--- .../auto/tests/unit/dynamic_output_test.cpp | 99 ++ .../tests/unit/exec_network_get_metrics.cpp | 535 --------- .../auto/tests/unit/get_device_list.cpp | 81 +- .../include/auto_infer_request_test_base.hpp | 138 --- .../tests/unit/include/auto_unit_test.hpp | 65 ++ .../auto/tests/unit/include/gmock_plugin.hpp | 28 + .../unit/include/mock_auto_device_plugin.hpp | 26 - .../auto/tests/unit/include/mock_common.hpp | 50 +- .../tests/unit/include/mock_log_utils.hpp | 25 +- .../tests/unit/key_network_priority_test.cpp | 108 +- .../auto/tests/unit/log_utils_format_test.cpp | 13 +- .../auto/tests/unit/log_utils_test.cpp | 20 +- src/plugins/auto/tests/unit/mock_common.cpp | 45 + .../tests/unit/parse_meta_device_test.cpp | 163 +-- .../auto/tests/unit/release_helper_test.cpp | 118 ++ .../auto/tests/unit/runtime_fallback_test.cpp | 340 ++++++ ...test.cpp => select_device_failed_test.cpp} | 153 +-- .../auto/tests/unit/select_device_test.cpp | 154 +-- .../auto/tests/unit/set_log_level_test.cpp | 81 ++ .../unit/startup_fallback_property_test.cpp | 81 ++ .../skip_tests_config.cpp | 5 +- .../skip_tests_config.cpp | 8 + 78 files changed, 4884 insertions(+), 6074 deletions(-) create mode 100644 src/inference/dev_api/openvino/runtime/threading/thread_safe_containers.hpp create mode 100644 src/plugins/auto/src/auto_compiled_model.cpp create mode 100644 src/plugins/auto/src/auto_compiled_model.hpp delete mode 100644 src/plugins/auto/src/auto_executable_network.cpp delete mode 100644 src/plugins/auto/src/auto_executable_network.hpp delete mode 100644 src/plugins/auto/src/bind_multi_schedule.cpp delete mode 100644 src/plugins/auto/src/bind_multi_schedule.hpp create mode 100644 src/plugins/auto/src/compiled_model.cpp create mode 100644 src/plugins/auto/src/compiled_model.hpp create mode 100644 src/plugins/auto/src/cumulative_compiled_model.cpp create mode 100644 src/plugins/auto/src/cumulative_compiled_model.hpp create mode 100644 src/plugins/auto/src/cumulative_schedule.cpp create mode 100644 src/plugins/auto/src/cumulative_schedule.hpp delete mode 100644 src/plugins/auto/src/executable_network.cpp delete mode 100644 src/plugins/auto/src/executable_network.hpp create mode 100644 src/plugins/auto/src/schedule.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_async_infer_request_test.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_ctput_call_multi.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_ctput_test.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_dynamic_output_test.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_infer_request_test_base.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_load_network_properties_test.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_release_helper_test.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_runtime_fallback_test.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_set_log_level_test.cpp delete mode 100644 src/plugins/auto/tests/unit/auto_startup_fallback_properties_test.cpp create mode 100644 src/plugins/auto/tests/unit/auto_unit_test.cpp create mode 100644 src/plugins/auto/tests/unit/compile_model_metric_test.cpp create mode 100644 src/plugins/auto/tests/unit/compile_model_property_test.cpp create mode 100644 src/plugins/auto/tests/unit/ctput_test.cpp rename src/plugins/auto/tests/unit/{auto_default_perf_hint_test.cpp => default_perf_hint_test.cpp} (57%) create mode 100644 src/plugins/auto/tests/unit/dynamic_output_test.cpp delete mode 100644 src/plugins/auto/tests/unit/exec_network_get_metrics.cpp delete mode 100644 src/plugins/auto/tests/unit/include/auto_infer_request_test_base.hpp create mode 100644 src/plugins/auto/tests/unit/include/auto_unit_test.hpp create mode 100644 src/plugins/auto/tests/unit/include/gmock_plugin.hpp delete mode 100644 src/plugins/auto/tests/unit/include/mock_auto_device_plugin.hpp create mode 100644 src/plugins/auto/tests/unit/release_helper_test.cpp create mode 100644 src/plugins/auto/tests/unit/runtime_fallback_test.cpp rename src/plugins/auto/tests/unit/{auto_select_device_failed_test.cpp => select_device_failed_test.cpp} (64%) create mode 100644 src/plugins/auto/tests/unit/set_log_level_test.cpp create mode 100644 src/plugins/auto/tests/unit/startup_fallback_property_test.cpp diff --git a/.ci/azure/linux.yml b/.ci/azure/linux.yml index 3bbdb183c5d..5dca04732af 100644 --- a/.ci/azure/linux.yml +++ b/.ci/azure/linux.yml @@ -408,8 +408,8 @@ jobs: displayName: 'GNA UT' enabled: 'false' # TODO: fix - - script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieMultiPluginUnitTests.xml - displayName: 'MULTI UT' + - script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_auto_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ov_auto_unit_tests.xml + displayName: 'AUTO UT' - script: $(RUN_PREFIX) $(INSTALL_TEST_DIR)/ov_auto_batch_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ov_auto_batch_unit_tests.xml displayName: 'AutoBatch UT' diff --git a/.ci/azure/windows.yml b/.ci/azure/windows.yml index ee20bc4b100..fe67b1045d2 100644 --- a/.ci/azure/windows.yml +++ b/.ci/azure/windows.yml @@ -306,8 +306,8 @@ jobs: - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_gna_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ov_gna_unit_tests.xml displayName: 'GNA UT' - - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieMultiPluginUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ieMultiPluginUnitTests.xml - displayName: 'MULTI UT' + - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_auto_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ov_auto_unit_tests.xml + displayName: 'AUTO UT' - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_auto_batch_unit_tests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ov_auto_batch_unit_tests.xml displayName: 'AutoBatch UT' diff --git a/src/inference/dev_api/openvino/runtime/threading/thread_safe_containers.hpp b/src/inference/dev_api/openvino/runtime/threading/thread_safe_containers.hpp new file mode 100644 index 00000000000..b39e6c79e81 --- /dev/null +++ b/src/inference/dev_api/openvino/runtime/threading/thread_safe_containers.hpp @@ -0,0 +1,144 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include +#include +#include +#include +#include + +#include "openvino/core/parallel.hpp" + +#if ((OV_THREAD == OV_THREAD_TBB) || (OV_THREAD == OV_THREAD_TBB_AUTO)) +# include +# include +#endif + +namespace ov { +namespace threading { + +template +class ThreadSafeQueueWithSize { +public: + void push(T value) { + std::lock_guard lock(_mutex); + _queue.push(std::move(value)); + } + bool try_pop(T& value) { + std::lock_guard lock(_mutex); + if (!_queue.empty()) { + value = std::move(_queue.front()); + _queue.pop(); + return true; + } else { + return false; + } + } + size_t size() { + std::lock_guard lock(_mutex); + return _queue.size(); + } + +protected: + std::queue _queue; + std::mutex _mutex; +}; +#if ((OV_THREAD == OV_THREAD_TBB) || (OV_THREAD == OV_THREAD_TBB_AUTO)) +template +using ThreadSafeQueue = tbb::concurrent_queue; +template +using ThreadSafeBoundedQueue = tbb::concurrent_bounded_queue; +template +class ThreadSafeBoundedPriorityQueue { +public: + ThreadSafeBoundedPriorityQueue() = default; + bool try_push(T&& value) { + if (_capacity) { + _pqueue.push(std::move(value)); + return true; + } + return false; + } + bool try_pop(T& value) { + return _capacity ? _pqueue.try_pop(value) : false; + } + void set_capacity(std::size_t newCapacity) { + _capacity = newCapacity; + } + +protected: + tbb::concurrent_priority_queue> _pqueue; + std::atomic_bool _capacity{false}; +}; +#else +template +using ThreadSafeQueue = ThreadSafeQueueWithSize; +template +class ThreadSafeBoundedQueue { +public: + ThreadSafeBoundedQueue() = default; + bool try_push(T value) { + std::lock_guard lock(_mutex); + if (_capacity) { + _queue.push(std::move(value)); + } + return _capacity; + } + bool try_pop(T& value) { + std::lock_guard lock(_mutex); + if (_capacity && !_queue.empty()) { + value = std::move(_queue.front()); + _queue.pop(); + return true; + } else { + return false; + } + } + void set_capacity(std::size_t newCapacity) { + std::lock_guard lock(_mutex); + _capacity = newCapacity; + } + +protected: + std::queue _queue; + std::mutex _mutex; + bool _capacity = false; +}; +template +class ThreadSafeBoundedPriorityQueue { +public: + ThreadSafeBoundedPriorityQueue() = default; + bool try_push(T value) { + std::lock_guard lock(_mutex); + if (_capacity) { + _queue.push(std::move(value)); + } + return _capacity; + } + bool try_pop(T& value) { + std::lock_guard lock(_mutex); + if (_capacity && !_queue.empty()) { + value = std::move(_queue.top()); + _queue.pop(); + return true; + } else { + return false; + } + } + void set_capacity(std::size_t newCapacity) { + std::lock_guard lock(_mutex); + _capacity = newCapacity; + } + +protected: + std::priority_queue, std::greater> _queue; + std::mutex _mutex; + bool _capacity = false; +}; +#endif +} // namespace threading +} // namespace ov \ No newline at end of file diff --git a/src/plugins/auto/README.md b/src/plugins/auto/README.md index dd1940d9a90..1a1485b1e86 100644 --- a/src/plugins/auto/README.md +++ b/src/plugins/auto/README.md @@ -3,9 +3,9 @@ The main responsibility of the AUTO plugin is to provide a unified device that enables developers to code deep learning applications once and deploy them anywhere. Other capabilities of the AUTO plugin include: -* Static device selection, which intelligently loads a network to one device or multiple devices. -* CPU acceleration to start inferencing while the target device is still loading the network. -* Model priority support for loading multiple networks to multiple devices. +* Static device selection, which intelligently compiles a model to one device or multiple devices. +* CPU acceleration to start inferencing while the target device is still compiling the model. +* Model priority support for compiling multiple models to multiple devices. The component is written in `C++`. If you want to contribute to the AUTO plugin, follow [the common coding style rules](../../../docs/dev/coding_style.md). diff --git a/src/plugins/auto/docs/tests.md b/src/plugins/auto/docs/tests.md index 976afd2c94f..08ec2ce9ad1 100644 --- a/src/plugins/auto/docs/tests.md +++ b/src/plugins/auto/docs/tests.md @@ -18,25 +18,25 @@ Auto unit test is a set of unit tests using gmock, each of which is for testing 2. Build ```bash - make ieMultiPluginUnitTests + make ov_auto_unit_tests ``` -3. You can find `ieMultiPluginUnitTests` in *bin* directory after build +3. You can find `ov_auto_unit_tests` in *bin* directory after build ### Run unit test -You can run _`ieMultiPluginUnitTests`_ in *bin* directory which is the output of OpenVINO build +You can run _`ov_auto_unit_tests`_ in *bin* directory which is the output of OpenVINO build If you want to run a specific unit test, you can use `gtest_filter` option as follows: ``` -./ieMultiPluginUnitTests --gtest_filter='*filter_name*' +./ov_auto_unit_tests --gtest_filter='*filter_name*' ``` Then, you can get the result similar to: ```bash -openvino/bin/intel64/Release$ ./ieMultiPluginUnitTests --gtest_filter=*AutoReleaseHelperTest*cpuLoadFailure_accelerateorLoadFailure* +openvino/bin/intel64/Release$ ./ov_auto_unit_tests --gtest_filter=*AutoReleaseHelperTest*cpuLoadFailure_accelerateorLoadFailure* Running main() from /home/openvino/thirdparty/gtest/gtest/googletest/src/gtest_main.cc Note: Google Test filter = *AutoReleaseHelperTest*cpuLoadFailure_accelerateorLoadFailure* [==========] Running 1 test from 1 test suite. diff --git a/src/plugins/auto/src/async_infer_request.cpp b/src/plugins/auto/src/async_infer_request.cpp index 6cb7e57764c..25c363af299 100644 --- a/src/plugins/auto/src/async_infer_request.cpp +++ b/src/plugins/auto/src/async_infer_request.cpp @@ -4,33 +4,28 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #include "async_infer_request.hpp" - -namespace MultiDevicePlugin { -AsyncInferRequest::AsyncInferRequest(const Schedule::Ptr& schedule, - const IInferPtr& inferRequest, - const IE::ITaskExecutor::Ptr& callbackExecutor): - AsyncInferRequestThreadSafeDefault(inferRequest, nullptr, callbackExecutor), - _schedule(schedule), - _inferRequest(inferRequest) { - auto pipeline = _schedule->GetPipeline(_inferRequest, &_workerInferRequest); +ov::auto_plugin::AsyncInferRequest::AsyncInferRequest(const Schedule::Ptr& schedule, + const std::shared_ptr& request, + const std::shared_ptr& callback_executor) : + IAsyncInferRequest(request, nullptr, callback_executor), + m_schedule(schedule), + m_inferrequest(request) { + auto pipeline = m_schedule->get_async_pipeline(m_inferrequest, &m_worker_inferrequest); if (pipeline.size() > 0) { - _pipeline = std::move(pipeline); + m_pipeline = std::move(pipeline); } } -void AsyncInferRequest::Infer_ThreadUnsafe() { - InferUsingAsync(); +std::vector ov::auto_plugin::AsyncInferRequest::get_profiling_info() const { + check_state(); + auto scheduled_request = std::dynamic_pointer_cast(m_inferrequest); + return scheduled_request->get_profiling_info(); } -std::map -AsyncInferRequest::GetPerformanceCounts() const { - CheckState(); - auto multiDeviceInfer = std::dynamic_pointer_cast(_inferRequest); - return multiDeviceInfer->GetPerformanceCounts(); +void ov::auto_plugin::AsyncInferRequest::infer_thread_unsafe() { + start_async_thread_unsafe(); } -AsyncInferRequest::~AsyncInferRequest() { - StopAndWait(); -} - -} // namespace MultiDevicePlugin +ov::auto_plugin::AsyncInferRequest::~AsyncInferRequest() { + stop_and_wait(); +} \ No newline at end of file diff --git a/src/plugins/auto/src/async_infer_request.hpp b/src/plugins/auto/src/async_infer_request.hpp index 72f0417fe27..06add94b339 100644 --- a/src/plugins/auto/src/async_infer_request.hpp +++ b/src/plugins/auto/src/async_infer_request.hpp @@ -8,27 +8,23 @@ #include "schedule.hpp" #include "infer_request.hpp" -#ifdef MULTIUNITTEST -#define MOCKTESTMACRO virtual -#define MultiDevicePlugin MockMultiDevicePlugin -#else -#define MOCKTESTMACRO -#endif - -namespace MultiDevicePlugin { -class AsyncInferRequest : public IE::AsyncInferRequestThreadSafeDefault { +namespace ov { +namespace auto_plugin { +// ! [async_infer_request:header] +class AsyncInferRequest : public ov::IAsyncInferRequest { public: - using Ptr = std::shared_ptr; - explicit AsyncInferRequest(const Schedule::Ptr& schedule, const IInferPtr& inferRequest, - const IE::ITaskExecutor::Ptr& callbackExecutor); - void Infer_ThreadUnsafe() override; - std::map GetPerformanceCounts() const override; - ~AsyncInferRequest(); + AsyncInferRequest(const Schedule::Ptr& schedule, + const std::shared_ptr& request, + const std::shared_ptr& callback_executor); -protected: - Schedule::Ptr _schedule; - WorkerInferRequest* _workerInferRequest = nullptr; - IInferPtr _inferRequest; + ~AsyncInferRequest(); + void infer_thread_unsafe() override; + std::vector get_profiling_info() const override; +private: + Schedule::Ptr m_schedule; + WorkerInferRequest* m_worker_inferrequest = nullptr; + ISyncInferPtr m_inferrequest; }; -} // namespace MultiDevicePlugin +} // namespace auto_plugin +} // namespace ov diff --git a/src/plugins/auto/src/auto_compiled_model.cpp b/src/plugins/auto/src/auto_compiled_model.cpp new file mode 100644 index 00000000000..62b5b75ea12 --- /dev/null +++ b/src/plugins/auto/src/auto_compiled_model.cpp @@ -0,0 +1,252 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#include "auto_compiled_model.hpp" +#include "common.hpp" +#include + +#include "async_infer_request.hpp" +#include "itt.hpp" +#include "openvino/runtime/exec_model_info.hpp" +#include "openvino/runtime/properties.hpp" +#include "plugin.hpp" + +namespace ov { +namespace auto_plugin { +AutoCompiledModel::AutoCompiledModel(const std::shared_ptr& model, + const std::shared_ptr& plugin, + ScheduleContext::Ptr context, + Schedule::Ptr scheduler) + : CompiledModel(model, plugin, context, scheduler), + m_model(model), + m_context(context) { + m_scheduler = std::dynamic_pointer_cast(scheduler); +} + +void AutoCompiledModel::set_property(const ov::AnyMap& properties) { + OPENVINO_NOT_IMPLEMENTED; +} + +std::shared_ptr AutoCompiledModel::get_runtime_model() const { + OPENVINO_ASSERT(m_context->m_hw_compiled_model); + return m_context->m_hw_compiled_model->get_runtime_model(); +} + +ov::Any AutoCompiledModel::get_property(const std::string& name) const { + const auto& add_ro_properties = [](const std::string& name, std::vector& properties) { + properties.emplace_back(ov::PropertyName{name, ov::PropertyMutability::RO}); + }; + const auto& default_ro_properties = []() { + std::vector ro_properties{ov::model_name, + ov::supported_properties, + ov::execution_devices, + ov::hint::performance_mode, + ov::optimal_number_of_infer_requests, + ov::device::priorities, + ov::device::properties, + ov::hint::model_priority, + ov::loaded_from_cache}; + return ro_properties; + }; + const auto& default_rw_properties = []() { + std::vector rw_properties{}; + return rw_properties; + }; + const auto& to_string_vector = [](const std::vector& properties) { + std::vector ret; + for (const auto& property : properties) { + ret.emplace_back(property); + } + return ret; + }; + if (name == ov::supported_properties) { + auto ro_properties = default_ro_properties(); + auto rw_properties = default_rw_properties(); + + std::vector supported_properties; + supported_properties.reserve(ro_properties.size() + rw_properties.size()); + supported_properties.insert(supported_properties.end(), ro_properties.begin(), ro_properties.end()); + supported_properties.insert(supported_properties.end(), rw_properties.begin(), rw_properties.end()); + return decltype(ov::supported_properties)::value_type(supported_properties); + } else if (name == ov::hint::performance_mode) { + return m_context->m_performance_hint; + } else if (name == ov::device::priorities) { + // device priority does not support change on-the-fly + return decltype(ov::device::priorities)::value_type(m_context->m_str_devices); + } else if (name == ov::device::properties) { + ov::AnyMap all_devices = {}; + { + std::lock_guard lock(m_context->m_fallback_mutex); + if (m_scheduler->m_compile_context[FALLBACKDEVICE].m_is_already) { + all_devices = get_device_supported_properties(m_scheduler->m_compile_context[FALLBACKDEVICE]); + } + } + std::lock_guard lock(m_context->m_mutex); + if (m_scheduler->m_compile_context[ACTUALDEVICE].m_is_already) { + all_devices = get_device_supported_properties(m_scheduler->m_compile_context[ACTUALDEVICE]); + } else { + all_devices = get_device_supported_properties(m_scheduler->m_compile_context[CPU]); + } + return all_devices; + } else if (name == ov::hint::model_priority) { + auto value = m_context->m_model_priority; + if (m_context->m_ov_core->is_new_api()) { + return value ? ((value > 1) ? ov::hint::Priority::LOW : + ov::hint::Priority::MEDIUM) : ov::hint::Priority::HIGH; + } else { + OPENVINO_SUPPRESS_DEPRECATED_START + return value ? ((value > 1) ? CONFIG_VALUE(MODEL_PRIORITY_LOW) : CONFIG_VALUE( + MODEL_PRIORITY_MED)) : CONFIG_VALUE(MODEL_PRIORITY_HIGH); + OPENVINO_SUPPRESS_DEPRECATED_END + } + } else if (name == ov::optimal_number_of_infer_requests) { + const unsigned int default_num_for_tput = 4u; + const unsigned int default_num_for_latency = 1u; + unsigned int real = 0; + if (m_scheduler->m_compile_context[ACTUALDEVICE].m_is_already) { + real = m_scheduler->m_compile_context[ACTUALDEVICE]. + m_compiled_model->get_property(name).as(); + } else { + OPENVINO_ASSERT(m_scheduler->m_compile_context[CPU].m_is_already == true); + std::unique_lock lock(m_context->m_mutex); + auto device_info = m_scheduler->m_compile_context[ACTUALDEVICE].m_device_info; + lock.unlock(); + unsigned int optimal_batch_size = 0; + unsigned int requests = 0; + bool tput_enabled_in_plugin = false; + auto actual_dev_supported_properties = m_context->m_ov_core->get_property(device_info.device_name, ov::supported_properties); + try { + // for benchmark through AUTO:CPU,GPU + // SetConfig directly set to CPU/GPU in this case + if (std::find(actual_dev_supported_properties.begin(), actual_dev_supported_properties.end(), ov::hint::performance_mode) + != actual_dev_supported_properties.end()) + tput_enabled_in_plugin = + m_context->m_ov_core->get_property(device_info.device_name, + ov::hint::performance_mode)== ov::hint::PerformanceMode::THROUGHPUT; + } catch (const ov::Exception&) { + LOG_DEBUG_TAG("get_property:%s for %s", "PERF_HINT config not supported", + device_info.device_name.c_str()); + } + const auto& mode = device_info.config.find(ov::hint::performance_mode.name()); + if (tput_enabled_in_plugin || + (mode != device_info.config.end() && mode->second == ov::hint::PerformanceMode::THROUGHPUT)) { + unsigned int upper_bound_streams_num = 0; + if (std::find(actual_dev_supported_properties.begin(), actual_dev_supported_properties.end(), ov::range_for_streams) + != actual_dev_supported_properties.end()) { + try { + auto range_of_streams = m_context->m_ov_core->get_property(device_info.device_name, + ov::range_for_streams); + upper_bound_streams_num = std::get<1>(range_of_streams); + } catch (const ov::Exception&) { + LOG_DEBUG_TAG("get_property range_for_streams failed"); + } + } + if (!m_context->m_batching_disabled) { + if (std::find(actual_dev_supported_properties.begin(), actual_dev_supported_properties.end(), ov::optimal_batch_size) + != actual_dev_supported_properties.end()) { + try { + optimal_batch_size = m_context->m_ov_core->get_property(device_info.device_name, + ov::optimal_batch_size, {ov::hint::model(m_model)}); + LOG_DEBUG_TAG("BATCHING:%s:%ld", "optimal batch size", + optimal_batch_size); + } catch (const ov::Exception&) { + LOG_DEBUG_TAG("BATCHING:%s", "property optimal_batch_size not supported"); + } + } + } + if (optimal_batch_size > 1) { + // batching is supported with the device + // go with auto-batching + try { + // check if app have set preferred value + requests = + m_context->m_ov_core->get_property(device_info.device_name, ov::hint::num_requests); + const auto& reqs = device_info.config.find(ov::hint::num_requests.name()); + if (reqs != device_info.config.end()) { + requests = reqs->second.as(); + } + LOG_DEBUG_TAG("BATCHING:%s:%ld", "user requested size", requests); + if (!requests) { // no limitations from user + requests = optimal_batch_size * upper_bound_streams_num * 2; + LOG_DEBUG_TAG("BATCHING:%s:%ld", "deduced size:", requests); + } + } catch (const ov::Exception& iie) { + LOG_WARNING_TAG("deduce optimal infer requset num for auto-batch failed :%s", + iie.what()); + } + real = (std::max)(requests, optimal_batch_size); + } else if (device_info.device_name.find("VPUX") != std::string::npos) { + real = 8u; + } else { + real = upper_bound_streams_num ? 2 * upper_bound_streams_num : default_num_for_tput; + } + } else { + real = default_num_for_latency; + } + } + return decltype(ov::optimal_number_of_infer_requests)::value_type {real}; + } else if (name == ov::execution_devices) { + ov::Any execution_devices; + auto get_execution_devices = [&execution_devices](std::string exe_devices_string) { + std::vector exe_devices = {}; + if (exe_devices_string == "CPU_HELP") + exe_devices_string = "(CPU)"; + exe_devices.push_back(exe_devices_string); + execution_devices = decltype(ov::execution_devices)::value_type {exe_devices}; + }; + { + std::lock_guard lock(m_context->m_mutex); + for (int i = 0; i < CONTEXTNUM; i++) { + if (m_scheduler->m_compile_context[i].m_is_enabled && m_scheduler->m_compile_context[i].m_is_already) { + if (i == 0 && !m_scheduler->m_compile_context[CPU].m_compiled_model._ptr) { + continue; + } else { + get_execution_devices(m_scheduler->m_compile_context[i].m_worker_name); + break; + } + } + } + } + return execution_devices; + } else if (name == ov::model_name) { + std::lock_guard lock(m_context->m_mutex); + { + if (m_scheduler->m_compile_context[CPU].m_is_enabled && m_scheduler->m_compile_context[CPU].m_is_already) + return m_scheduler->m_compile_context[CPU].m_compiled_model->get_property(name); + return m_scheduler->m_compile_context[ACTUALDEVICE].m_compiled_model->get_property(name); + } + OPENVINO_SUPPRESS_DEPRECATED_START + } else if (name == METRIC_KEY(SUPPORTED_METRICS)) { + auto ro_properties = default_ro_properties(); + add_ro_properties(METRIC_KEY(SUPPORTED_METRICS), ro_properties); + add_ro_properties(METRIC_KEY(SUPPORTED_CONFIG_KEYS), ro_properties); + return to_string_vector(ro_properties); + } else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) { + auto rw_properties = default_rw_properties(); + return to_string_vector(rw_properties); + OPENVINO_SUPPRESS_DEPRECATED_END + } else if (name == ov::loaded_from_cache) { + std::lock_guard lock(m_context->m_fallback_mutex); + if (m_scheduler->m_compile_context[FALLBACKDEVICE].m_is_already) { + return m_scheduler->m_compile_context[FALLBACKDEVICE].m_compiled_model->get_property(name).as(); + } + if (m_scheduler->m_compile_context[ACTUALDEVICE].m_is_already) { + return m_scheduler->m_compile_context[ACTUALDEVICE]. + m_compiled_model->get_property(name).as(); + } else { + OPENVINO_ASSERT(m_scheduler->m_compile_context[CPU].m_is_already == true); + std::lock_guard lock(m_context->m_mutex); + return m_scheduler->m_compile_context[CPU]. + m_compiled_model->get_property(name).as(); + } + } + OPENVINO_THROW(get_log_tag(), ": not supported property ", name); +} + +void AutoCompiledModel::export_model(std::ostream& model_stream) const { + OPENVINO_NOT_IMPLEMENTED; +} +} // namespace auto_plugin +} // namespace ov diff --git a/src/plugins/auto/src/auto_compiled_model.hpp b/src/plugins/auto/src/auto_compiled_model.hpp new file mode 100644 index 00000000000..eefc2cd5873 --- /dev/null +++ b/src/plugins/auto/src/auto_compiled_model.hpp @@ -0,0 +1,38 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "compiled_model.hpp" +#include "auto_schedule.hpp" + +namespace ov { +namespace auto_plugin { + +class AutoCompiledModel : public CompiledModel { +public: + AutoCompiledModel(const std::shared_ptr& model, + const std::shared_ptr& plugin, + ScheduleContext::Ptr context, + Schedule::Ptr scheduler); + + // implement pure virtual methods from a base class ov::ICompiledModel + void export_model(std::ostream& model) const override; + + std::shared_ptr get_runtime_model() const override; + + void set_property(const ov::AnyMap& properties) override; + + ov::Any get_property(const std::string& name) const override; + +private: + friend class InferRequest; + friend class Plugin; + std::shared_ptr m_model; + ScheduleContext::Ptr m_context; + AutoSchedule::Ptr m_scheduler; +}; +} // namespace auto_plugin +} // namespace ov diff --git a/src/plugins/auto/src/auto_executable_network.cpp b/src/plugins/auto/src/auto_executable_network.cpp deleted file mode 100644 index aad0ea5c3a2..00000000000 --- a/src/plugins/auto/src/auto_executable_network.cpp +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -#include -#include "ie_performance_hints.hpp" -#include "auto_executable_network.hpp" - -// ------------------------------AutoExecutableNetwork---------------------------- -// -namespace MultiDevicePlugin { -AutoExecutableNetwork::AutoExecutableNetwork(AutoScheduleContext::Ptr& context, const AutoSchedule::Ptr& schedule) - :ExecutableNetwork(schedule, context), - _autoSContext(context), - _autoSchedule(schedule) { -} - -std::shared_ptr AutoExecutableNetwork::GetContext() const { - if (_autoSchedule->_pCTPUTLoadContext) { - for (size_t i = 0; i < _autoSchedule->_nCTputDeviceNums; i++) { - if (_autoSchedule->_pCTPUTLoadContext[i].isAlready) { - return _autoSchedule->_pCTPUTLoadContext[i].executableNetwork->GetContext(); - } - } - return nullptr; - } else { - std::lock_guard lock(_autoSContext->_fallbackMutex); - if (_autoSchedule->_loadContext[FALLBACKDEVICE].isAlready) { - return _autoSchedule->_loadContext[FALLBACKDEVICE].executableNetwork->GetContext(); - } else { - _autoSchedule->WaitActualNetworkReady(); - return _autoSchedule->_loadContext[ACTUALDEVICE].executableNetwork->GetContext(); - } - } -} - -void AutoExecutableNetwork::SetConfig(const std::map - & config) { - IE_THROW(NotImplemented); -} - -IE::Parameter AutoExecutableNetwork::GetConfig(const std::string& name) const { - IE_THROW(NotFound) << name << " not found in the ExecutableNetwork config"; -} - -IE::Parameter AutoExecutableNetwork::GetMetric(const std::string& name) const { - if (name == ov::supported_properties) { - return decltype(ov::supported_properties)::value_type { - // Metrics - ov::PropertyName{ov::supported_properties.name(), ov::PropertyMutability::RO}, - ov::PropertyName{ov::hint::performance_mode.name(), ov::PropertyMutability::RO}, - ov::PropertyName{ov::model_name.name(), ov::PropertyMutability::RO}, - ov::PropertyName{ov::optimal_number_of_infer_requests.name(), ov::PropertyMutability::RO}, - ov::PropertyName{ov::hint::model_priority.name(), ov::PropertyMutability::RO}, - ov::PropertyName{ov::device::priorities.name(), ov::PropertyMutability::RO}, - ov::PropertyName{ov::device::properties.name(), ov::PropertyMutability::RO}, - ov::PropertyName{ov::execution_devices.name(), ov::PropertyMutability::RO}}; - } else if (name == ov::hint::performance_mode) { - auto value = _autoSContext->_performanceHint; - if (!_autoSContext->_core->isNewAPI()) - return value; - if (value == InferenceEngine::PluginConfigParams::THROUGHPUT) { - return ov::hint::PerformanceMode::THROUGHPUT; - } else if (value == InferenceEngine::PluginConfigParams::LATENCY) { - return ov::hint::PerformanceMode::LATENCY; - } else if (value == InferenceEngine::PluginConfigParams::CUMULATIVE_THROUGHPUT) { - return ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT; - } else if (value == "UNDEFINED") { - OPENVINO_SUPPRESS_DEPRECATED_START - return ov::hint::PerformanceMode::UNDEFINED; - OPENVINO_SUPPRESS_DEPRECATED_END - } else { - OPENVINO_THROW("Unsupported value of ov::hint::PerformanceMode"); - } - } else if (name == ov::device::priorities) { - auto value = _autoSContext->_config.find(ov::device::priorities.name()); - return decltype(ov::device::priorities)::value_type {value->second.as()}; - } else if (name == ov::device::properties) { - ov::AnyMap all_devices = {}; - auto get_device_supported_metrics = [&all_devices] (const AutoLoadContext& context) { - ov::AnyMap device_properties = {}; - auto device_supported_metrics = context.executableNetwork->GetMetric(METRIC_KEY(SUPPORTED_METRICS)); - for (auto&& property_name : device_supported_metrics.as>()) { - device_properties[property_name] = context.executableNetwork->GetMetric(property_name); - } - auto device_supported_configs = context.executableNetwork->GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS)); - for (auto&& property_name : device_supported_configs.as>()) { - device_properties[property_name] = context.executableNetwork->GetConfig(property_name); - } - all_devices[context.deviceInfo.deviceName] = device_properties; - }; - if (_autoSchedule->_pCTPUTLoadContext) { - for (size_t i = 0; i < _autoSchedule->_nCTputDeviceNums; i++) { - if (_autoSchedule->_pCTPUTLoadContext[i].isAlready) { - get_device_supported_metrics(_autoSchedule->_pCTPUTLoadContext[i]); - } - } - } else { - { - std::lock_guard lock(_autoSContext->_fallbackMutex); - if (_autoSchedule->_loadContext[FALLBACKDEVICE].isAlready) { - get_device_supported_metrics(_autoSchedule->_loadContext[FALLBACKDEVICE]); - } - } - std::lock_guard lock(_autoSContext->_confMutex); - if (_autoSchedule->_loadContext[ACTUALDEVICE].isAlready) { - get_device_supported_metrics(_autoSchedule->_loadContext[ACTUALDEVICE]); - } else { - get_device_supported_metrics(_autoSchedule->_loadContext[CPU]); - } - } - return all_devices; - } else if (name == ov::hint::model_priority) { - auto value = _autoSContext->_modelPriority; - if (_autoSContext->_core->isNewAPI()) { - return value ? ((value > 1) ? ov::hint::Priority::LOW : - ov::hint::Priority::MEDIUM) : ov::hint::Priority::HIGH; - } else { - return value ? ((value > 1) ? CONFIG_VALUE(MODEL_PRIORITY_LOW) : CONFIG_VALUE( - MODEL_PRIORITY_MED)) : CONFIG_VALUE(MODEL_PRIORITY_HIGH); - } - } else if (name == ov::optimal_number_of_infer_requests) { - const unsigned int defaultNumForTPUT = 4u; - const unsigned int defaultNumForLatency = 1u; - unsigned int real = 0; - if (_autoSchedule->_pCTPUTLoadContext) { - std::lock_guard lock(_autoSContext->_fallbackMutex); - unsigned int res = 0u; - for (size_t i = 0; i < _autoSchedule->_nCTputDeviceNums; i++) { - try { - if (_autoSchedule->_pCTPUTLoadContext[i].isAlready) { - res += (_autoSchedule->_pCTPUTLoadContext[i]) - .executableNetwork->GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)) - .as(); - } - } catch (const IE::Exception& iie) { - IE_THROW() - << "Every device used in cumulative mode should " - << "support OPTIMAL_NUMBER_OF_INFER_REQUESTS ExecutableNetwork metric. " - << "Failed to query the metric for with error:" << - iie.what(); - } - } - return decltype(ov::optimal_number_of_infer_requests)::value_type {res}; - } - if (_autoSchedule->_loadContext[ACTUALDEVICE].isAlready) { - real = _autoSchedule->_loadContext[ACTUALDEVICE]. - executableNetwork->GetMetric(name).as(); - } else { - IE_ASSERT(_autoSchedule->_loadContext[CPU].isAlready == true); - std::unique_lock lock(_autoSContext->_confMutex); - auto deviceInfo = _autoSchedule->_loadContext[ACTUALDEVICE].deviceInfo; - lock.unlock(); - unsigned int optimalBatchSize = 0; - unsigned int requests = 0; - bool bThroughputEnabledInPlugin = false; - try { - // for benchmark through AUTO:CPU,GPU - // SetConfig directly set to CPU/GPU in this case - bThroughputEnabledInPlugin = - _autoSContext->_core->GetConfig(deviceInfo.deviceName, - CONFIG_KEY(PERFORMANCE_HINT)).as() == CONFIG_VALUE(THROUGHPUT); - } catch (const IE::Exception&) { - LOG_DEBUG_TAG("GetMetric:%s for %s", "PERF_HINT config not supported", - deviceInfo.deviceName.c_str()); - } - const auto& mode = deviceInfo.config.find(CONFIG_KEY(PERFORMANCE_HINT)); - if (bThroughputEnabledInPlugin || - (mode != deviceInfo.config.end() && mode->second == CONFIG_VALUE(THROUGHPUT))) { - unsigned int upperBoundStreamsNum = 0; - std::map options; - options["MODEL_PTR"] = std::const_pointer_cast - (_autoSContext->_network.getFunction()); - try { - auto rangeOfStreams = _autoSContext->_core->GetMetric(deviceInfo.deviceName, - METRIC_KEY(RANGE_FOR_STREAMS), - options).as>(); - upperBoundStreamsNum = std::get<1>(rangeOfStreams); - } catch (const IE::Exception&) { - LOG_DEBUG_TAG("GetMetric RANGE_FOR_STREAMS failed"); - } - if (!_autoSContext->_batchingDisabled) { - try { - optimalBatchSize = _autoSContext->_core->GetMetric(deviceInfo.deviceName, - METRIC_KEY(OPTIMAL_BATCH_SIZE), options).as(); - LOG_DEBUG_TAG("BATCHING:%s:%ld", "optimal batch size", - optimalBatchSize); - } catch (const IE::Exception&) { - LOG_DEBUG_TAG("BATCHING:%s", "metric OPTIMAL_BATCH_SIZE not supported"); - } - } - if (optimalBatchSize > 1) { - // batching is supported with the device - // go with auto-batching - try { - // check if app have set preferred value - auto res = - _autoSContext->_core->GetConfig(deviceInfo.deviceName, - CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)).as(); - requests = IE::PerfHintsConfig::CheckPerformanceHintRequestValue(res); - const auto& reqs = deviceInfo.config.find(CONFIG_KEY( - PERFORMANCE_HINT_NUM_REQUESTS)); - if (reqs != deviceInfo.config.end()) { - requests = static_cast - (IE::PerfHintsConfig::CheckPerformanceHintRequestValue(reqs->second)); - } - LOG_DEBUG_TAG("BATCHING:%s:%ld", "user requested size", requests); - if (!requests) { // no limitations from user - requests = optimalBatchSize * upperBoundStreamsNum * 2; - LOG_DEBUG_TAG("BATCHING:%s:%ld", "deduced size:", requests); - } - } catch (const IE::Exception& iie) { - LOG_WARNING_TAG("deduce optimal infer requset num for auto-batch failed :%s", - iie.what()); - } - real = (std::max)(requests, optimalBatchSize); - } else if (deviceInfo.deviceName.find("VPUX") != std::string::npos) { - real = 8u; - } else { - real = upperBoundStreamsNum ? 2 * upperBoundStreamsNum : defaultNumForTPUT; - } - } else { - real = defaultNumForLatency; - } - } - return decltype(ov::optimal_number_of_infer_requests)::value_type {real}; - } else if (name == ov::execution_devices) { - ov::Any execution_devices; - auto GetExecutionDevices = [&execution_devices](std::string ExeDevicesString) { - std::vector exeDevices = {}; - if (ExeDevicesString == "CPU_HELP") - ExeDevicesString = "(CPU)"; - exeDevices.push_back(ExeDevicesString); - execution_devices = decltype(ov::execution_devices)::value_type {exeDevices}; - }; - if (_autoSchedule->_pCTPUTLoadContext) { - std::vector exeDevices = {}; - std::lock_guard lock(_autoSContext->_fallbackMutex); - for (auto const & n : _autoSContext->_devicePriorities) { - exeDevices.push_back(n.deviceName); - } - execution_devices = decltype(ov::execution_devices)::value_type {exeDevices}; - } else { - std::lock_guard lock(_autoSContext->_confMutex); - for (int i = 0; i < CONTEXTNUM; i++) { - if (_autoSchedule->_loadContext[i].isEnabled && _autoSchedule->_loadContext[i].isAlready) { - if (i == 0 && !_autoSchedule->_loadContext[CPU].executableNetwork._ptr) { - continue; - } else { - GetExecutionDevices(_autoSchedule->_loadContext[i].workName); - break; - } - } - } - } - return execution_devices; - } else if (name == ov::model_name) { - std::lock_guard lock(_autoSContext->_confMutex); - if (_autoSchedule->_pCTPUTLoadContext) { - for (size_t i = 0; i < _autoSchedule->_nCTputDeviceNums; i++) { - if (_autoSchedule->_pCTPUTLoadContext[i].isAlready) { - return _autoSchedule->_pCTPUTLoadContext[i].executableNetwork->GetMetric(name); - } - } - IE_THROW() << "No valid executable network found to get" << name; - } else { - if (_autoSchedule->_loadContext[CPU].isEnabled && _autoSchedule->_loadContext[CPU].isAlready) - return _autoSchedule->_loadContext[CPU].executableNetwork->GetMetric(name); - return _autoSchedule->_loadContext[ACTUALDEVICE].executableNetwork->GetMetric(name); - } - } else if (name == METRIC_KEY(SUPPORTED_METRICS)) { - IE_SET_METRIC_RETURN(SUPPORTED_METRICS, - {METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS), - METRIC_KEY(SUPPORTED_METRICS), - METRIC_KEY(NETWORK_NAME), - METRIC_KEY(SUPPORTED_CONFIG_KEYS)}); - } else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) { - IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, {}); - } - IE_THROW() << "Unsupported metric key: " << name; -} -} // namespace MultiDevicePlugin diff --git a/src/plugins/auto/src/auto_executable_network.hpp b/src/plugins/auto/src/auto_executable_network.hpp deleted file mode 100644 index d3c312b76f5..00000000000 --- a/src/plugins/auto/src/auto_executable_network.hpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma once - -#include -#include - -#include "auto_schedule.hpp" -#include "executable_network.hpp" - -#ifdef MULTIUNITTEST -#define MOCKTESTMACRO virtual -#define MultiDevicePlugin MockMultiDevicePlugin -#else -#define MOCKTESTMACRO -#endif - -namespace MultiDevicePlugin { -class AutoExecutableNetwork : public ExecutableNetwork { - friend IInferPtr AutoSchedule::CreateInferRequest(); -public: - using Ptr = std::shared_ptr; - - explicit AutoExecutableNetwork(AutoScheduleContext::Ptr& context, const AutoSchedule::Ptr& schedule); - - void SetConfig(const std::map& config) override; - IE::Parameter GetConfig(const std::string& name) const override; - IE::Parameter GetMetric(const std::string& name) const override; - std::shared_ptr GetContext() const override; - virtual ~AutoExecutableNetwork() = default; - -private: - AutoScheduleContext::Ptr _autoSContext; - AutoSchedule::Ptr _autoSchedule; -}; -} // namespace MultiDevicePlugin diff --git a/src/plugins/auto/src/auto_schedule.cpp b/src/plugins/auto/src/auto_schedule.cpp index f648b2ce497..1022e0111de 100644 --- a/src/plugins/auto/src/auto_schedule.cpp +++ b/src/plugins/auto/src/auto_schedule.cpp @@ -5,514 +5,191 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #include "auto_schedule.hpp" #include "async_infer_request.hpp" -#include "auto_executable_network.hpp" #include "plugin.hpp" // ------------------------------AutoSchedule---------------------------- -namespace MultiDevicePlugin { - -namespace { -std::string GetNetworkPrecision(const IE::CNNNetwork& network) { - auto nGraphFunc = network.getFunction(); - bool isINTModel = ov::op::util::has_op_with_type - (nGraphFunc); - if (isINTModel) { - return METRIC_VALUE(INT8); - } - for (auto& node : nGraphFunc->get_ordered_ops()) { - if (std::dynamic_pointer_cast(node) || - std::dynamic_pointer_cast(node) || - std::dynamic_pointer_cast(node) || - std::dynamic_pointer_cast(node)) { - auto layerType = node->input(1).get_element_type().get_type_name(); - if (layerType == "f32") { - return METRIC_VALUE(FP32); - } - if (layerType == "f16") { - return METRIC_VALUE(FP16); - } - } - } - return METRIC_VALUE(FP32); -} -} // namespace - -thread_local WorkerInferRequest* AutoSchedule::_thisWorkerInferRequest = nullptr; -// TODO: revert to the plain variable (see header file), when we moved to the next CentOS 8.x in our support matrix -thread_local const char* AutoSchedule::_thisPreferredDeviceName = ""; - -Pipeline AutoSchedule::GetPipeline(const IInferPtr& syncInferRequest, WorkerInferRequest** workerInferRequest) { - Pipeline pipeline; - if (_passthroughExeNet) { - struct RequestExecutor : ITaskExecutor { - explicit RequestExecutor(InferenceEngine::SoIInferRequestInternal& inferRequest) : _inferRequest(inferRequest) { - _inferRequest->SetCallback([this](std::exception_ptr exceptionPtr) mutable { - _exceptionPtr = exceptionPtr; - auto capturedTask = std::move(_task); - capturedTask(); - }); - } - void run(InferenceEngine::Task task) override { - _task = std::move(task); - _inferRequest->StartAsync(); - }; - InferenceEngine::SoIInferRequestInternal& _inferRequest; - std::exception_ptr _exceptionPtr; - InferenceEngine::Task _task; - }; - auto requestExecutor = - std::make_shared(std::static_pointer_cast(syncInferRequest)->GetSharedRequest()); - pipeline.emplace_back(requestExecutor, [requestExecutor] { - if (nullptr != requestExecutor->_exceptionPtr) { - std::rethrow_exception(requestExecutor->_exceptionPtr); - } - }); - } else { - MultiImmediateExecutor::Ptr _firstExecutor = std::make_shared(); - pipeline = { - // if the request is coming with device-specific remote blobs make sure it is scheduled to the specific device only: - Stage { - /*TaskExecutor*/ _firstExecutor, /*task*/ [this, &syncInferRequest]() { - // by default, no preferred device: - _thisPreferredDeviceName = ""; - auto execNetwork = _autoSContext->_executableNetwork.lock(); - // if any input is remote (e.g. was set with SetBlob), let' use the corresponding device - for (const auto& it : execNetwork->GetInputsInfo()) { - auto b = syncInferRequest->GetBlob(it.first); - auto r = b->as(); - if (r) { - const auto name = r->getDeviceName(); - const auto res = std::find_if( - _autoSContext->_devicePrioritiesInitial.cbegin(), - _autoSContext->_devicePrioritiesInitial.cend(), - [&name](const MultiDevicePlugin::DeviceInformation & d) { - return (d.defaultDeviceID.empty() ? d.deviceName : (d.deviceName + "." + - d.defaultDeviceID)) == name; - }); - if (_autoSContext->_devicePrioritiesInitial.cend() == res) { - IE_THROW() << - "None of the devices (for which current MULTI-device configuration was " - "initialized) supports a remote blob created on the device named " << name; - } else { - // it is ok to take the c_str() here (as pointed in the executable_network.hpp we need to use const char*) - // as the original strings are from the "persistent" vector (with the right lifetime) - _thisPreferredDeviceName = res->deviceName.c_str(); - break; - } - } - } - }}, - // as the scheduling algo may select any device, this stage accepts the scheduling decision (actual workerRequest) - // then sets the device-agnostic blobs to the actual (device-specific) request - Stage { - /*TaskExecutor*/std::dynamic_pointer_cast(shared_from_this()), /*task*/ [&syncInferRequest, workerInferRequest]() { - *workerInferRequest = _thisWorkerInferRequest; - auto multiSyncInferRequest = std::dynamic_pointer_cast(syncInferRequest); - multiSyncInferRequest->SetBlobsToAnotherRequest(_thisWorkerInferRequest->_inferRequest); - INFO_RUN([workerInferRequest]() { - (*workerInferRequest)->_startTimes.push_back(std::chrono::steady_clock::now()); - }); - }}, - // final task in the pipeline: - Stage { - /*TaskExecutor*/std::make_shared(workerInferRequest, _firstExecutor), /*task*/ - [this, &syncInferRequest, workerInferRequest]() { - INFO_RUN([workerInferRequest]() { - (*workerInferRequest)->_endTimes.push_back(std::chrono::steady_clock::now()); - }); - std::exception_ptr eptr = (*workerInferRequest)->_exceptionPtr; - if (nullptr != eptr) { - std::rethrow_exception(eptr); - } - if (_autoSContext->_needPerfCounters) { - auto multiSyncInferRequest = std::dynamic_pointer_cast - (syncInferRequest); - multiSyncInferRequest->_scheduledRequest = - (*workerInferRequest)->_inferRequest; - } - }} - }; - } - return pipeline; -} - -void AutoSchedule::GenerateWorkers(const std::string& device, - const SoExecNetwork& executableNetwork) { - std::string realDeviceName; - if (device == "CPU_HELP") { - realDeviceName = "CPU"; - } else { - realDeviceName = device; - } - auto itNumRequests = deviceChecker().checkAndReturnIfDeviceInList(realDeviceName, _autoSContext->_devicePriorities, true); - unsigned int optimalNum = 0; - try { - optimalNum = executableNetwork->GetMetric(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)).as(); - } catch (const IE::Exception& iie) { - IE_THROW() - << "Every device used with the Multi-Device should " - << "support OPTIMAL_NUMBER_OF_INFER_REQUESTS ExecutableNetwork metric. " - << "Failed to query the metric for the " << device << " with error:" << - iie.what(); - } - const auto numRequests = (_autoSContext->_devicePriorities.end() == itNumRequests || - itNumRequests->numRequestsPerDevices == -1) ? optimalNum : itNumRequests->numRequestsPerDevices; - auto& workerRequests = _workerRequests[device]; - auto& idleWorkerRequests = _idleWorkerRequests[device]; - workerRequests.resize(numRequests); - _inferPipelineTasksDeviceSpecific[device] = std::unique_ptr>(new IE::ThreadSafeQueue); - auto* idleWorkerRequestsPtr = &(idleWorkerRequests); - idleWorkerRequests.set_capacity(numRequests); - int num = 0; - for (auto&& workerRequest : workerRequests) { - workerRequest._inferRequest = {executableNetwork->CreateInferRequest(), executableNetwork._so}; - auto* workerRequestPtr = &workerRequest; - workerRequestPtr->_index = num++; - IE_ASSERT(idleWorkerRequests.try_push(std::make_pair(workerRequestPtr->_index, workerRequestPtr)) == true); - workerRequest._inferRequest->SetCallback( - [workerRequestPtr, this, device, idleWorkerRequestsPtr](std::exception_ptr exceptionPtr) mutable { - IdleGuard idleGuard{workerRequestPtr, *idleWorkerRequestsPtr}; - workerRequestPtr->_exceptionPtr = exceptionPtr; - { - auto stopRetryAndContinue = [workerRequestPtr]() { - auto capturedTask = std::move(workerRequestPtr->_task); - capturedTask(); - }; - // will fallback to other devices if enable _runtimeFallback - if (workerRequestPtr->_exceptionPtr != nullptr && _autoSContext->_runtimeFallback) { - bool selectOtherDeviceFlag = false; - // select other device - try { - selectOtherDeviceFlag = selectOtherDevice(device); - } catch (const IE::Exception& iie) { - LOG_DEBUG_TAG("select other devices with error: %s", iie.what()); - selectOtherDeviceFlag = false; - } - if (selectOtherDeviceFlag) { - // Add end time to current workerRequest and restart the task in pipeline - workerRequestPtr->_endTimes.push_back(std::chrono::steady_clock::now()); - workerRequestPtr->_fallbackExec->_task(); - } else { - // continue to run the task in pipeline - stopRetryAndContinue(); - } - } else { - stopRetryAndContinue(); - } - // try to return the request to the idle list (fails if the overall object destruction has began) - if (idleGuard.Release()->try_push(std::make_pair(workerRequestPtr->_index, workerRequestPtr))) { - // let's try to pop a task, as we know there is at least one idle request, schedule if succeeded - // if no device-agnostic tasks, let's try pop the device specific task, schedule if succeeded - IE::Task t; - do { - _inferPipelineTasks.try_pop(t); - } while (t && ScheduleToWorkerInferRequest(std::move(t))); - do { - _inferPipelineTasksDeviceSpecific[device]->try_pop(t); - } while (t && ScheduleToWorkerInferRequest(std::move(t), device)); - } - } - }); - } -} - -bool AutoSchedule::selectOtherDevice(const std::string& currentDeviceName) { +namespace ov { +namespace auto_plugin { +bool AutoSchedule::select_other_device(const std::string& cur_dev_name) { { - std::lock_guard lock(_autoSContext->_fallbackMutex); + std::lock_guard lock(m_context->m_fallback_mutex); // a recursive function to select other devices - std::function getExecutionDevices; - getExecutionDevices = [&](const std::string& deviceName) { - std::string realDeviceName; - bool isCPUHelp = false; - if (_autoSContext->_modelPath.empty()) - _loadContext[FALLBACKDEVICE].networkPrecision = GetNetworkPrecision(_autoSContext->_network); - if (deviceName == "CPU_HELP") { - // if infer failed in CPU_HELP, we will remove CPU from _devicePriorities - // and re-run infer request when _loadContext[ACTUALDEVICE] is ready - realDeviceName = "CPU"; - isCPUHelp = true; - WaitActualNetworkReady(); + std::function get_execution_devices; + get_execution_devices = [&](const std::string& device_name) { + std::string real_device_name; + bool is_cpuhelp = false; + m_compile_context[FALLBACKDEVICE].m_model_precision = m_context->m_model_precision; + if (device_name == "CPU_HELP") { + // if infer failed in CPU_HELP, we will remove CPU from m_device_priorities + // and re-run infer request when m_compile_context[ACTUALDEVICE] is ready + real_device_name = "CPU"; + is_cpuhelp = true; + wait_actual_compiled_model_ready(); } else { - realDeviceName = deviceName; + real_device_name = device_name; } - const auto CurrentDeviceIter = deviceChecker().checkAndReturnIfDeviceInList(realDeviceName, _autoSContext->_devicePriorities); - if (CurrentDeviceIter != _autoSContext->_devicePriorities.end()) { - if (_autoSContext->_devicePriorities.size() == 1) { - LOG_INFO_TAG("No other devices in _devicePriorities"); + const auto current_device_iter = deviceChecker().check_and_return_if_device_in_list + (real_device_name, m_context->m_device_priorities); + if (current_device_iter != m_context->m_device_priorities.end()) { + if (m_context->m_device_priorities.size() == 1) { + LOG_INFO_TAG("No other devices in m_device_priorities"); return false; } - _autoSContext->_devicePriorities.erase(CurrentDeviceIter); - if (isCPUHelp) { + m_context->m_device_priorities.erase(current_device_iter); + if (is_cpuhelp) { return true; } } else { LOG_DEBUG_TAG("Already selected the fallback device"); - return _loadContext[FALLBACKDEVICE].isReloadSuccess ? true : false; + return m_compile_context[FALLBACKDEVICE].m_is_reload_success ? true : false; } - _loadContext[FALLBACKDEVICE].metaDevices = _autoSContext->_devicePriorities; - _loadContext[FALLBACKDEVICE].isLoadSuccess = false; - _loadContext[FALLBACKDEVICE].workName = ""; - _loadContext[FALLBACKDEVICE].isReloadSuccess = false; - _loadContext[FALLBACKDEVICE].deviceInfo = - _autoSContext->_plugin->SelectDevice(_autoSContext->_devicePriorities, - _loadContext[FALLBACKDEVICE].networkPrecision, - _autoSContext->_modelPriority); + m_compile_context[FALLBACKDEVICE].m_meta_devices = m_context->m_device_priorities; + m_compile_context[FALLBACKDEVICE].m_is_load_success = false; + m_compile_context[FALLBACKDEVICE].m_worker_name = ""; + m_compile_context[FALLBACKDEVICE].m_is_reload_success = false; + m_compile_context[FALLBACKDEVICE].m_device_info = + m_plugin->select_device(m_context->m_device_priorities, + m_compile_context[FALLBACKDEVICE].m_model_precision, + m_context->m_model_priority); try { - _loadContext[FALLBACKDEVICE].task(); + m_compile_context[FALLBACKDEVICE].m_task(); // FALLBACKDEVICE need to be load again if infer failed, so reset promise here - _loadContext[FALLBACKDEVICE].promise = {}; - _loadContext[FALLBACKDEVICE].future = _loadContext[FALLBACKDEVICE].promise.get_future(); - } catch (const IE::Exception& iie) { + m_compile_context[FALLBACKDEVICE].m_promise = {}; + m_compile_context[FALLBACKDEVICE].m_future = m_compile_context[FALLBACKDEVICE].m_promise.get_future(); + } catch (const ov::Exception& iie) { LOG_DEBUG_TAG("Load context in FALLBACKDEVICE with error: %s", iie.what()); } - if (_loadContext[FALLBACKDEVICE].isReloadSuccess) { - _loadContext[ACTUALDEVICE].isEnabled = false; - _loadContext[ACTUALDEVICE].isLoadSuccess = false; - _loadContext[ACTUALDEVICE].isAlready = false; - LOG_INFO_TAG("Select fallback device:%s", _loadContext[FALLBACKDEVICE].deviceInfo.deviceName.c_str()); + if (m_compile_context[FALLBACKDEVICE].m_is_reload_success) { + m_compile_context[ACTUALDEVICE].m_is_enabled = false; + m_compile_context[ACTUALDEVICE].m_is_load_success = false; + m_compile_context[ACTUALDEVICE].m_is_already = false; + LOG_INFO_TAG("Select fallback device:%s", m_compile_context[FALLBACKDEVICE].m_device_info.device_name.c_str()); return true; } else { // load failed or generate works failed, so reselect other devices - return getExecutionDevices(_loadContext[FALLBACKDEVICE].deviceInfo.deviceName.c_str()); + return get_execution_devices(m_compile_context[FALLBACKDEVICE].m_device_info.device_name.c_str()); } }; - auto removeInferFailDevice = [&](const std::string& deviceName) { - if (_autoSContext->_devicePriorities.size() > 1) { - const auto CurrentDeviceIter = - deviceChecker().checkAndReturnIfDeviceInList(deviceName, _autoSContext->_devicePriorities); - if (CurrentDeviceIter != _autoSContext->_devicePriorities.end()) { - _autoSContext->_devicePriorities.erase(CurrentDeviceIter); - return true; - } - } - return false; - }; - - if (_pCTPUTLoadContext) { - return removeInferFailDevice(currentDeviceName); - } - - return getExecutionDevices(currentDeviceName); + return get_execution_devices(cur_dev_name); } } -void AutoSchedule::init(const ScheduleContext::Ptr& sContext) { - _LogTag = sContext->_LogTag; - LOG_INFO_TAG("ExecutableNetwork start"); +void AutoSchedule::init() { + if (m_context->m_bind_buffer) { + LOG_INFO_TAG("bind buffer supported only under cumulative mode, ignoring"); + } // initialize cpuHelpReleasetime - _cpuHelpReleaseTime = std::chrono::steady_clock::now(); - _autoSContext = std::dynamic_pointer_cast(sContext); - if (_autoSContext->_core == nullptr) { - IE_THROW() << "Please, work with Auto device via InferencEngine::Core object"; - } - if (_autoSContext->_modelPath.empty() && _autoSContext->_network.getFunction() == nullptr) { - IE_THROW() << "AUTO device supports just ngraph network representation"; - } - _autoSContext->_config[IE::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES] = _autoSContext->_strDevices; + m_cpuhelp_release_time = std::chrono::steady_clock::now(); std::string profilingTask = "AutoSchedule::AutoSchedule:AutoMode"; // loadContext[ACTUALDEVICE] is always enabled, // when there is CPU and there are more than two devices, loadContext[CPU] is enabled - _loadContext[ACTUALDEVICE].isEnabled = true; - if (_autoSContext->_runtimeFallback) { - _loadContext[FALLBACKDEVICE].isEnabled = true; - } - if (_autoSContext->_modelPath.empty()) - _loadContext[ACTUALDEVICE].networkPrecision = GetNetworkPrecision(_autoSContext->_network); - _loadContext[ACTUALDEVICE].metaDevices = _autoSContext->_devicePriorities; - bool isCumulative = - (_autoSContext->_performanceHint == IE::PluginConfigParams::CUMULATIVE_THROUGHPUT) ? true : false; - if (isCumulative) { - const auto& validDevices = _autoSContext->_devicePriorities; - // When the hint is ctput and there is only one device, the single-device logic is used - if (validDevices.size() == 1) { - _loadContext[ACTUALDEVICE].deviceInfo = validDevices.front(); - _loadContext[ACTUALDEVICE].deviceInfo.config[CONFIG_KEY(PERFORMANCE_HINT)] = - IE::PluginConfigParams::THROUGHPUT; - } else if (validDevices.size() > 1) { - _loadContext[ACTUALDEVICE].isEnabled = false; - // Total number of devices in CTPUT - _nCTputDeviceNums = validDevices.size(); - // Generate contexts for loading each device - _pCTPUTLoadContext.reset(new AutoLoadContext[_nCTputDeviceNums]); - int idx = 0; - DeviceInformation cpuDeviceInformation; - for (auto& device : validDevices) { - if (device.deviceName.find("CPU") == std::string::npos) { - _pCTPUTLoadContext[idx].deviceInfo = device; - _pCTPUTLoadContext[idx].deviceInfo.config[CONFIG_KEY(PERFORMANCE_HINT)] = - IE::PluginConfigParams::THROUGHPUT; - idx++; - } else { - cpuDeviceInformation = device; - cpuDeviceInformation.config.insert( - {ov::affinity.name(), ov::Any(ov::Affinity::CORE).as()}); - } - } - if (!cpuDeviceInformation.deviceName.empty()) { - _pCTPUTLoadContext[idx].deviceInfo = cpuDeviceInformation; - _pCTPUTLoadContext[idx].deviceInfo.config[CONFIG_KEY(PERFORMANCE_HINT)] = - IE::PluginConfigParams::THROUGHPUT; - } - } - if (_autoSContext->_LogTag == "MULTI") { - // MULTI's performance hint always is tput - _autoSContext->_performanceHint = IE::PluginConfigParams::THROUGHPUT; - } - } else { - _loadContext[ACTUALDEVICE].deviceInfo = - _autoSContext->_plugin->SelectDevice(_autoSContext->_devicePriorities, - _loadContext[ACTUALDEVICE].networkPrecision, - _autoSContext->_modelPriority); + m_compile_context[ACTUALDEVICE].m_is_enabled = true; + if (m_context->m_runtime_fallback) { + m_compile_context[FALLBACKDEVICE].m_is_enabled = true; } + m_compile_context[ACTUALDEVICE].m_model_precision = m_context->m_model_precision; + m_compile_context[ACTUALDEVICE].m_meta_devices = m_context->m_device_priorities; + m_compile_context[ACTUALDEVICE].m_device_info = + m_plugin->select_device(m_context->m_device_priorities, + m_compile_context[ACTUALDEVICE].m_model_precision, + m_context->m_model_priority); - auto loadDeviceTask = [&](AutoLoadContext* contextPtr, - const std::string& modelPath, - const IE::CNNNetwork& network, - bool isCumulative) { - TryToLoadNetWork(*contextPtr, modelPath, network, isCumulative); - if (contextPtr->isLoadSuccess) { - if (contextPtr->workName.empty()) { - contextPtr->workName = contextPtr->deviceInfo.deviceName; + auto load_device_task = [&](AutoCompileContext* context_ptr, const std::shared_ptr& model) { + try_to_compile_model(*context_ptr, model); + if (context_ptr->m_is_load_success) { + if (context_ptr->m_worker_name.empty()) { + context_ptr->m_worker_name = context_ptr->m_device_info.device_name; } - GenerateWorkers(contextPtr->workName, contextPtr->executableNetwork); - // need lock - { - std::lock_guard lock(_autoSContext->_confMutex); - _autoSContext->_config.insert(contextPtr->deviceInfo.config.begin(), - contextPtr->deviceInfo.config.end()); - } - contextPtr->isAlready = true; - // reloadsuccess flag only for _loadContext[FALLBACKDEVICE] - contextPtr->isReloadSuccess = true; - auto& deviceName = contextPtr->deviceInfo.deviceName; - LOG_INFO_TAG("device:%s loading Network finished", deviceName.c_str()); - auto supported_config_keys = _autoSContext->_core->GetMetric(deviceName, METRIC_KEY(SUPPORTED_CONFIG_KEYS)) - .as>(); - DEBUG_RUN([this, &contextPtr, &deviceName, &supported_config_keys] { - std::lock_guard lock(_autoSContext->_confMutex); + generate_workers(context_ptr->m_worker_name, context_ptr->m_compiled_model); + context_ptr->m_is_already = true; + // reloadsuccess flag only for m_compile_context[FALLBACKDEVICE] + context_ptr->m_is_reload_success = true; + auto& device_name = context_ptr->m_device_info.device_name; + LOG_INFO_TAG("device:%s compiling model finished", device_name.c_str()); + DEBUG_RUN([this, &context_ptr, &device_name] { + auto supported_config_keys = context_ptr->m_compiled_model->get_property(ov::supported_properties.name()).as>(); + std::lock_guard lock(m_context->m_mutex); for (const auto& cfg : supported_config_keys) { try { LOG_DEBUG_TAG("device:%s, GetConfig:%s=%s", - deviceName.c_str(), + device_name.c_str(), cfg.c_str(), - contextPtr->executableNetwork->GetConfig(cfg).as().c_str()); - } catch (const IE::Exception&) { + context_ptr->m_compiled_model->get_property(cfg).as().c_str()); + } catch (const ov::Exception&) { } } }); } - // Handle device load failure in case of ctput - if (isCumulative && !contextPtr->isLoadSuccess) { - std::string failedDeviceName = contextPtr->deviceInfo.deviceName; - std::lock_guard lock(_autoSContext->_fallbackMutex); - const auto DeviceIter = deviceChecker().checkAndReturnIfDeviceInList(failedDeviceName, _autoSContext->_devicePriorities); - // Remove failed device from _devicePriorities - if (DeviceIter != _autoSContext->_devicePriorities.end()) { - _autoSContext->_devicePriorities.erase(DeviceIter); - } - // Remove failed device from ov::device::priorities in config - auto it_prior = _autoSContext->_config.find(ov::device::priorities.name()); - if (it_prior != _autoSContext->_config.end()) { - auto priorities = it_prior->second.as(); - size_t nPos = priorities.find(failedDeviceName); - if (nPos != std::string::npos) { - // If need to delete failed device and "," then length plus 1 - size_t nNameLen = (nPos + failedDeviceName.length()) == priorities.length() - ? failedDeviceName.length() - : failedDeviceName.length() + 1; - priorities.erase(nPos, nNameLen); - it_prior->second = priorities; - } - } - } - contextPtr->promise.set_value(); - // the first load network process finished - std::call_once(_firstLoadOC, [this]() { - _firstLoadPromise.set_value(); + context_ptr->m_promise.set_value(); + // the first compile model process finished + std::call_once(m_firstload_oc, [this]() { + m_firstload_promise.set_value(); }); }; - if (_loadContext[ACTUALDEVICE].isEnabled) { - LOG_INFO_TAG("select device:%s", _loadContext[ACTUALDEVICE].deviceInfo.deviceName.c_str()); - bool isActualDevCPU = _loadContext[ACTUALDEVICE].deviceInfo.deviceName.find("CPU") != std::string::npos; - // if Actual device is CPU or perf_hint is cumulative, disabled _loadContext[CPU], only use - // _loadContext[ACTUALDEVICE] - if (isActualDevCPU || !_autoSContext->_startupfallback) { - _loadContext[CPU].isEnabled = false; + if (m_compile_context[ACTUALDEVICE].m_is_enabled) { + LOG_INFO_TAG("select device:%s", m_compile_context[ACTUALDEVICE].m_device_info.device_name.c_str()); + bool is_actual_cpu = m_compile_context[ACTUALDEVICE].m_device_info.device_name.find("CPU") != std::string::npos; + // if Actual device is CPU or perf_hint is cumulative, disabled m_compile_context[CPU], only use + // m_compile_context[ACTUALDEVICE] + if (is_actual_cpu || !m_context->m_startup_fallback) { + m_compile_context[CPU].m_is_enabled = false; } else { - const auto CPUIter = deviceChecker().checkAndReturnIfDeviceInList("CPU", _autoSContext->_devicePriorities); - // if have CPU Device, enable _loadContext[CPU] - if (CPUIter != _autoSContext->_devicePriorities.end()) { - _loadContext[CPU].isEnabled = true; - _loadContext[CPU].deviceInfo = *CPUIter; - _loadContext[CPU].deviceInfo.config[CONFIG_KEY(PERFORMANCE_HINT)] = IE::PluginConfigParams::LATENCY; - _loadContext[CPU].workName = "CPU_HELP"; + const auto cpu_iter = deviceChecker().check_and_return_if_device_in_list("CPU", m_context->m_device_priorities); + // if have CPU Device, enable m_compile_context[CPU] + if (cpu_iter != m_context->m_device_priorities.end()) { + m_compile_context[CPU].m_is_enabled = true; + m_compile_context[CPU].m_device_info = *cpu_iter; + m_compile_context[CPU].m_device_info.config[ov::hint::performance_mode.name()] = ov::hint::PerformanceMode::LATENCY; + m_compile_context[CPU].m_worker_name = "CPU_HELP"; LOG_INFO_TAG("will load CPU for accelerator"); } else { - _loadContext[CPU].isEnabled = false; + m_compile_context[CPU].m_is_enabled = false; } } // initialize the rest members of load context for (int i = 0; i < CONTEXTNUM; i++) { - if (_loadContext[i].isEnabled) { - _loadContext[i].future = _loadContext[i].promise.get_future(); - auto* contextPtr = &_loadContext[i]; - auto modelPath = _autoSContext->_modelPath; - auto network = _autoSContext->_network; - _loadContext[i].task = std::bind(loadDeviceTask, contextPtr, modelPath, network, isCumulative); + if (m_compile_context[i].m_is_enabled) { + m_compile_context[i].m_future = m_compile_context[i].m_promise.get_future(); + auto* context_ptr = &m_compile_context[i]; + auto model = m_context->m_model; + m_compile_context[i].m_task = std::bind(load_device_task, context_ptr, model); } } } - std::vector otherDevicesloads; - std::vector cpuLoads; - if (_pCTPUTLoadContext) { - for (size_t i = 0; i < _nCTputDeviceNums; i++) { - auto* contextPtr = &_pCTPUTLoadContext[i]; - auto modelPath = _autoSContext->_modelPath; - auto network = _autoSContext->_network; - _pCTPUTLoadContext[i].task = std::bind(loadDeviceTask, contextPtr, modelPath, network, isCumulative); - if (i == _nCTputDeviceNums - 1 && - _pCTPUTLoadContext[i].deviceInfo.deviceName.find("CPU") != std::string::npos) { - cpuLoads.push_back(_pCTPUTLoadContext[i].task); - } else { - otherDevicesloads.push_back(_pCTPUTLoadContext[i].task); - } - } - } - OV_ITT_SCOPED_TASK(itt::domains::MULTIPlugin, - openvino::itt::handle(profilingTask)); - if (_loadContext[CPU].isEnabled) { - _firstLoadFuture = _firstLoadPromise.get_future(); - // will not wait for loading accelerator network, + OV_ITT_SCOPED_TASK(itt::domains::AutoPlugin, openvino::itt::handle(profilingTask)); + if (m_compile_context[CPU].m_is_enabled) { + m_firstload_future = m_firstload_promise.get_future(); + // will not wait for compiling accelerator model, // so the executor can't be destroyed before finished the task, // so use executor as a member of AutoSchedule. - _executor = _autoSContext->_plugin->executorManager()->getIdleCPUStreamsExecutor( - IE::IStreamsExecutor::Config{"AutoDeviceAsyncLoad", + m_executor = m_plugin->get_executor_manager()->get_idle_cpu_streams_executor( + ov::threading::IStreamsExecutor::Config{"AutoDeviceAsyncCompile", static_cast(std::thread::hardware_concurrency()) /* max possible #streams*/, 0 /*default threads per stream, workaround for ticket 62376*/, - IE::IStreamsExecutor::ThreadBindingType::NONE}); - for (auto&& device : _autoSContext->_devicePriorities) { + ov::threading::IStreamsExecutor::ThreadBindingType::NONE}); + for (auto&& device : m_context->m_device_priorities) { // initialize containers before run async task - _idleWorkerRequests[device.deviceName]; - _workerRequests[device.deviceName]; - _inferPipelineTasksDeviceSpecific[device.deviceName] = nullptr; + m_idle_worker_requests[device.device_name]; + m_worker_requests[device.device_name]; + m_infer_pipeline_tasks_device_specific[device.device_name] = nullptr; } - _idleWorkerRequests["CPU_HELP"]; - _workerRequests["CPU_HELP"]; - _inferPipelineTasksDeviceSpecific["CPU_HELP"] = nullptr; - _executor->run(_loadContext[CPU].task); - _executor->run(_loadContext[ACTUALDEVICE].task); + m_idle_worker_requests["CPU_HELP"]; + m_worker_requests["CPU_HELP"]; + m_infer_pipeline_tasks_device_specific["CPU_HELP"] = nullptr; + m_executor->run(m_compile_context[CPU].m_task); + m_executor->run(m_compile_context[ACTUALDEVICE].m_task); auto recycleTask = [this]() mutable { - WaitActualNetworkReady(); - while (!_exitFlag && _loadContext[ACTUALDEVICE].isAlready) { + wait_actual_compiled_model_ready(); + while (!m_exitflag && m_compile_context[ACTUALDEVICE].m_is_already) { // handle the case of ACTUAL faster than CPU - _loadContext[CPU].future.wait(); + m_compile_context[CPU].m_future.wait(); // clean up helper infer requests // first, wait for all the remaining requests to finish - for (auto& iter : _workerRequests["CPU_HELP"]) { + for (auto& iter : m_worker_requests["CPU_HELP"]) { try { - iter._inferRequest._ptr->Wait(IE::InferRequest::WaitMode::RESULT_READY); - } catch (const IE::Exception& iie) { + iter.m_inferrequest._ptr->wait(); + } catch (const ov::Exception& iie) { LOG_DEBUG_TAG("No infer results expected, infer in CPU_HELP throw some errors: %s", iie.what()); } } @@ -520,156 +197,135 @@ void AutoSchedule::init(const ScheduleContext::Ptr& sContext) { // second, check the idle queue if all requests are in place size_t destroynum = 0; std::pair worker; - std::list