From 41c140056a31ccff4e5a312a7f0f8cd189abd76f Mon Sep 17 00:00:00 2001 From: "jag.Xu" Date: Wed, 13 Nov 2024 14:48:13 +0800 Subject: [PATCH 01/28] fix assertion failed on lockable_mem when using devicemem (#27297) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Details: - *The issue caused by the memory select of the input. In the changed behavior called locked memory will put the input into host memory if any the implementation of  its users is CPU.* - *when the input is set to "use_device_mem" by benchmark_app, the locked memory will ignore the memory, which will trigger the assertion failure.* - *fixed just ignore "need_lockable_mem" option in case of remote tensors, because the data could be cloned implicitly at attempt to access device buffer from the host side to have this copy* ### Tickets: - *CSV-152365* --- src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp b/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp index 985336b801b9d3..6d48849102765e 100644 --- a/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp +++ b/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp @@ -782,7 +782,7 @@ std::vector SyncInferRequest::prepare_input(const std::string auto device_tensor_et = convert_to_supported_device_type(element_type); bool convert_needed = is_convert_required(element_type, device_tensor_et); - if (is_remote_tensor_impl && !need_lockable_mem) { + if (is_remote_tensor_impl) { if (convert_needed) { m_plugin_inputs[input_idx] = { create_device_tensor(pshape, cldnn::element_type_to_data_type(element_type), From 79dd358b756999aabfb4c140318d6a97da61a650 Mon Sep 17 00:00:00 2001 From: Ooi Boon Sin Date: Wed, 13 Nov 2024 16:39:39 +0800 Subject: [PATCH 02/28] Add parameter to execute inference requests at a fixed frequency (#26820) ### Details: - Add parameter to execute inference requests at a fixed frequency ### Tickets: - *ticket-id* --------- Signed-off-by: Maciej Falkowski Signed-off-by: Ooi, Boon Sin Co-authored-by: Maciej Falkowski --- .../openvino-samples/benchmark-tool.rst | 12 +++++++++- samples/cpp/benchmark_app/benchmark_app.hpp | 10 ++++++++ samples/cpp/benchmark_app/main.cpp | 7 ++++++ .../smoke_tests/test_benchmark_app.py | 12 +++++++++- .../openvino/tools/benchmark/benchmark.py | 23 ++++++++++++++++--- .../openvino/tools/benchmark/main.py | 3 ++- .../openvino/tools/benchmark/parameters.py | 4 ++++ 7 files changed, 65 insertions(+), 6 deletions(-) mode change 100644 => 100755 tests/samples_tests/smoke_tests/test_benchmark_app.py mode change 100644 => 100755 tools/benchmark_tool/openvino/tools/benchmark/main.py diff --git a/docs/articles_en/learn-openvino/openvino-samples/benchmark-tool.rst b/docs/articles_en/learn-openvino/openvino-samples/benchmark-tool.rst index 19c4a013c54aae..390fe00605f2c6 100644 --- a/docs/articles_en/learn-openvino/openvino-samples/benchmark-tool.rst +++ b/docs/articles_en/learn-openvino/openvino-samples/benchmark-tool.rst @@ -245,6 +245,13 @@ There are several options for setting the number of inference iterations: The more iterations a model runs, the better the statistics will be for determining average latency and throughput. +Maximum inference rate +++++++++++++++++++++++ + +By default, the benchmarking app will run inference at maximum rate based on device capabilities. +The maximum inferance rate can be configured by ``-max_irate `` option. +Tweaking this value allow better accuracy in power usage measurement by limiting the number of executions. + Inputs ++++++++++++++++++++ @@ -337,7 +344,7 @@ following usage message: [Step 1/11] Parsing and validating input arguments [ INFO ] Parsing input parameters usage: benchmark_app.py [-h [HELP]] [-i PATHS_TO_INPUT [PATHS_TO_INPUT ...]] -m PATH_TO_MODEL [-d TARGET_DEVICE] - [-hint {throughput,cumulative_throughput,latency,none}] [-niter NUMBER_ITERATIONS] [-t TIME] [-b BATCH_SIZE] [-shape SHAPE] + [-hint {throughput,cumulative_throughput,latency,none}] [-niter NUMBER_ITERATIONS] [-max_irate MAXIMUM_INFERENCE_RATE] [-t TIME] [-b BATCH_SIZE] [-shape SHAPE] [-data_shape DATA_SHAPE] [-layout LAYOUT] [-extensions EXTENSIONS] [-c PATH_TO_CLDNN_CONFIG] [-cdir CACHE_DIR] [-lfile [LOAD_FROM_FILE]] [-api {sync,async}] [-nireq NUMBER_INFER_REQUESTS] [-nstreams NUMBER_STREAMS] [-inference_only [INFERENCE_ONLY]] [-infer_precision INFER_PRECISION] [-ip {bool,f16,f32,f64,i8,i16,i32,i64,u8,u16,u32,u64}] @@ -536,6 +543,9 @@ following usage message: 'none': no device performance mode will be set. Using explicit 'nstreams' or other device-specific options, please set hint to 'none' -niter Optional. Number of iterations. If not specified, the number of iterations is calculated depending on a device. + -max_irate Optional. Maximum inference rate by frame per second. + If not specified, default value is 0, the inference will run at maximium rate depending on a device capabilities. + Tweaking this value allow better accuracy in power usage measurement by limiting the execution. -t Optional. Time in seconds to execute topology. Input shapes diff --git a/samples/cpp/benchmark_app/benchmark_app.hpp b/samples/cpp/benchmark_app/benchmark_app.hpp index 99cbd7edff8856..cf38ff6708ad29 100644 --- a/samples/cpp/benchmark_app/benchmark_app.hpp +++ b/samples/cpp/benchmark_app/benchmark_app.hpp @@ -65,6 +65,12 @@ static const char cache_dir_message[] = "Optional. Enables caching of loaded mod static const char load_from_file_message[] = "Optional. Loads model from file directly without read_model." " All CNNNetwork options (like re-shape) will be ignored"; +/// @brief message for maximum inference rate +static const char maximum_inference_rate_message[] = + "Optional. Maximum inference rate by frame per second" + "If not specified, default value is 0, the inference will run at maximium rate depending on a device capabilities. " + "Tweaking this value allow better accuracy in power usage measurement by limiting the execution."; + /// @brief message for execution time static const char execution_time_message[] = "Optional. Time in seconds to execute topology."; @@ -307,6 +313,9 @@ DEFINE_string(api, "async", api_message); /// @brief Number of infer requests in parallel DEFINE_uint64(nireq, 0, infer_requests_count_message); +/// @brief Execute infer requests at a fixed frequency +DEFINE_double(max_irate, 0, maximum_inference_rate_message); + /// @brief Number of streams to use for inference on the CPU (also affects Hetero cases) DEFINE_string(nstreams, "", infer_num_streams_message); @@ -388,6 +397,7 @@ static void show_usage() { std::cout << " -hint (latency or throughput or cumulative_throughput or none) " << hint_message << std::endl; std::cout << " -niter " << iterations_count_message << std::endl; + std::cout << " -max_irate \"\" " << maximum_inference_rate_message << std::endl; std::cout << " -t " << execution_time_message << std::endl; std::cout << std::endl; std::cout << "Input shapes" << std::endl; diff --git a/samples/cpp/benchmark_app/main.cpp b/samples/cpp/benchmark_app/main.cpp index 4dcc1e82924efd..1f1b89c2427e67 100644 --- a/samples/cpp/benchmark_app/main.cpp +++ b/samples/cpp/benchmark_app/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -1157,6 +1158,12 @@ int main(int argc, char* argv[]) { execTime = std::chrono::duration_cast(Time::now() - startTime).count(); processedFramesN += batchSize; + + if (FLAGS_max_irate > 0) { + auto nextRunFinishTime = 1 / FLAGS_max_irate * processedFramesN * 1.0e9; + std::this_thread::sleep_for( + std::chrono::nanoseconds(static_cast(nextRunFinishTime - execTime))); + } } // wait the latest inference executions diff --git a/tests/samples_tests/smoke_tests/test_benchmark_app.py b/tests/samples_tests/smoke_tests/test_benchmark_app.py old mode 100644 new mode 100755 index f9b37e87614d42..3be4f4b88eaab8 --- a/tests/samples_tests/smoke_tests/test_benchmark_app.py +++ b/tests/samples_tests/smoke_tests/test_benchmark_app.py @@ -38,13 +38,16 @@ def create_random_4bit_bin_file(tmp_path, shape, name): f.write(raw_data) -def verify(sample_language, device, api=None, nireq=None, shape=None, data_shape=None, nstreams=None, layout=None, pin=None, cache=None, tmp_path=None, model='bvlcalexnet-12.onnx', inp='dog-224x224.bmp', batch='1', niter='10', tm=None): +def verify(sample_language, device, api=None, nireq=None, shape=None, data_shape=None, nstreams=None, + layout=None, pin=None, cache=None, tmp_path=None, model='bvlcalexnet-12.onnx', + inp='dog-224x224.bmp', batch='1', niter='10', max_irate=None, tm=None): output = get_cmd_output( get_executable(sample_language), *prepend(cache, inp, model, tmp_path), *('-nstreams', nstreams) if nstreams else '', *('-layout', layout) if layout else '', *('-nireq', nireq) if nireq else '', + *('-max_irate', max_irate) if max_irate else '', *('-shape', shape) if shape else '', *('-data_shape', data_shape) if data_shape else '', *('-hint', 'none') if nstreams or pin else '', @@ -84,6 +87,13 @@ def test_nireq(sample_language, api, nireq, device, cache, tmp_path): verify(sample_language, device, api=api, nireq=nireq, cache=cache, tmp_path=tmp_path) +@pytest.mark.parametrize('sample_language', ['C++', 'Python']) +@pytest.mark.parametrize('max_irate', ['', '0', '10']) +@pytest.mark.parametrize('device', get_devices()) +def test_max_irate(sample_language, device, max_irate, cache, tmp_path): + verify(sample_language, device, max_irate=max_irate, cache=cache, tmp_path=tmp_path) + + @pytest.mark.skipif('CPU' not in get_devices(), reason='affinity is a CPU property') @pytest.mark.parametrize('sample_language', ['C++', 'Python']) @pytest.mark.parametrize('pin', ['YES', 'NO', 'NUMA', 'HYBRID_AWARE']) diff --git a/tools/benchmark_tool/openvino/tools/benchmark/benchmark.py b/tools/benchmark_tool/openvino/tools/benchmark/benchmark.py index adba697b598b4a..fb6f5a8ecd7a6d 100644 --- a/tools/benchmark_tool/openvino/tools/benchmark/benchmark.py +++ b/tools/benchmark_tool/openvino/tools/benchmark/benchmark.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 import os +import time from datetime import datetime from math import ceil from openvino.runtime import Core, get_version, AsyncInferQueue @@ -15,7 +16,8 @@ def percentile(values, percent): class Benchmark: def __init__(self, device: str, number_infer_requests: int = 0, number_iterations: int = None, - duration_seconds: int = None, api_type: str = 'async', inference_only = None): + duration_seconds: int = None, api_type: str = 'async', inference_only = None, + maximum_inference_rate: float = 0): self.device = device self.core = Core() self.nireq = number_infer_requests if api_type == 'async' else 1 @@ -24,6 +26,7 @@ def __init__(self, device: str, number_infer_requests: int = 0, number_iteration self.api_type = api_type self.inference_only = inference_only self.latency_groups = [] + self.max_irate = maximum_inference_rate def __del__(self): del self.core @@ -83,13 +86,21 @@ def first_infer(self, requests): requests.wait_all() return requests[id].latency + def inference_rate_delay(self, processed_frames, exec_time): + if self.max_irate > 0: + nextRunFinishTime = 1 / self.max_irate * processed_frames + delay = nextRunFinishTime - exec_time + time.sleep(delay if delay > 0 else 0) + def sync_inference(self, request, data_queue): + processed_frames = 0 exec_time = 0 iteration = 0 times = [] start_time = datetime.utcnow() while (self.niter and iteration < self.niter) or \ (self.duration_seconds and exec_time < self.duration_seconds): + processed_frames += data_queue.get_next_batch_size() if self.inference_only == False: request.set_input_tensors(data_queue.get_next_input()) request.infer() @@ -97,10 +108,12 @@ def sync_inference(self, request, data_queue): iteration += 1 exec_time = (datetime.utcnow() - start_time).total_seconds() + self.inference_rate_delay(processed_frames, exec_time) total_duration_sec = (datetime.utcnow() - start_time).total_seconds() return sorted(times), total_duration_sec, iteration - def async_inference_only(self, infer_queue): + def async_inference_only(self, infer_queue, data_queue): + processed_frames = 0 exec_time = 0 iteration = 0 times = [] @@ -109,6 +122,7 @@ def async_inference_only(self, infer_queue): while (self.niter and iteration < self.niter) or \ (self.duration_seconds and exec_time < self.duration_seconds) or \ (iteration % self.nireq): + processed_frames += data_queue.get_next_batch_size() idle_id = infer_queue.get_idle_request_id() if idle_id in in_fly: times.append(infer_queue[idle_id].latency) @@ -118,6 +132,8 @@ def async_inference_only(self, infer_queue): iteration += 1 exec_time = (datetime.utcnow() - start_time).total_seconds() + self.inference_rate_delay(processed_frames, exec_time) + infer_queue.wait_all() total_duration_sec = (datetime.utcnow() - start_time).total_seconds() for infer_request_id in in_fly: @@ -149,6 +165,7 @@ def async_inference_full_mode(self, infer_queue, data_queue, pcseq): iteration += 1 exec_time = (datetime.utcnow() - start_time).total_seconds() + self.inference_rate_delay(processed_frames, exec_time) infer_queue.wait_all() total_duration_sec = (datetime.utcnow() - start_time).total_seconds() @@ -164,7 +181,7 @@ def main_loop(self, requests, data_queue, batch_size, latency_percentile, pcseq) times, total_duration_sec, iteration = self.sync_inference(requests[0], data_queue) fps = len(batch_size) * iteration / total_duration_sec elif self.inference_only: - times, total_duration_sec, iteration = self.async_inference_only(requests) + times, total_duration_sec, iteration = self.async_inference_only(requests, data_queue) fps = len(batch_size) * iteration / total_duration_sec else: times, total_duration_sec, processed_frames, iteration = self.async_inference_full_mode(requests, data_queue, pcseq) diff --git a/tools/benchmark_tool/openvino/tools/benchmark/main.py b/tools/benchmark_tool/openvino/tools/benchmark/main.py old mode 100644 new mode 100755 index c77b50a7fd4721..acec4d17bdc377 --- a/tools/benchmark_tool/openvino/tools/benchmark/main.py +++ b/tools/benchmark_tool/openvino/tools/benchmark/main.py @@ -88,7 +88,8 @@ def is_flag_set_in_command_line(flag): next_step(step_id=2) benchmark = Benchmark(args.target_device, args.number_infer_requests, - args.number_iterations, args.time, args.api_type, args.inference_only) + args.number_iterations, args.time, args.api_type, + args.inference_only, args.maximum_inference_rate) if args.extensions: benchmark.add_extension(path_to_extensions=args.extensions) diff --git a/tools/benchmark_tool/openvino/tools/benchmark/parameters.py b/tools/benchmark_tool/openvino/tools/benchmark/parameters.py index aa79767cecc397..dac2b1490bf534 100644 --- a/tools/benchmark_tool/openvino/tools/benchmark/parameters.py +++ b/tools/benchmark_tool/openvino/tools/benchmark/parameters.py @@ -72,6 +72,10 @@ def parse_args(): args.add_argument('-niter', '--number_iterations', type=check_positive, required=False, default=None, help='Optional. Number of iterations. ' 'If not specified, the number of iterations is calculated depending on a device.') + args.add_argument('-max_irate', '--maximum_inference_rate', type=float, required=False, default=0, + help='Optional. Maximum inference rate by frame per second. ' + 'If not specified, default value is 0, the inference will run at maximium rate depending on a device capabilities. ' + 'Tweaking this value allow better accuracy in power usage measurement by limiting the execution.') args.add_argument('-t', '--time', type=check_positive, required=False, default=None, help='Optional. Time in seconds to execute topology.') From a58202ff10f9f1b8b6bf3345cba09a8dc163724d Mon Sep 17 00:00:00 2001 From: Tomasz Krupa Date: Wed, 13 Nov 2024 08:50:45 +0000 Subject: [PATCH 03/28] Enable weightless caching with compile_model() API without providing weights_path property (#27407) Requested in https://jira.devtools.intel.com/browse/CVS-126606?focusedId=25564110&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-25564110 --- src/inference/src/dev/core_impl.cpp | 12 +++++++ src/plugins/intel_gpu/src/plugin/plugin.cpp | 3 +- .../tests/functional/behavior/model_cache.cpp | 31 ++++++++++++++++--- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/inference/src/dev/core_impl.cpp b/src/inference/src/dev/core_impl.cpp index 32b43f346e9e44..244d27b5eebb67 100644 --- a/src/inference/src/dev/core_impl.cpp +++ b/src/inference/src/dev/core_impl.cpp @@ -1447,6 +1447,18 @@ ov::SoPtr ov::CoreImpl::load_model_from_cache( ov::AnyMap update_config = config; update_config[ov::loaded_from_cache.name()] = true; + + if (util::contains(plugin.get_property(ov::supported_properties), ov::weights_path)) { + std::string weights_path = cacheContent.modelPath; + auto pos = weights_path.rfind('.'); + if (pos != weights_path.npos && weights_path.substr(pos) == ".xml") { + weights_path = weights_path.substr(0, pos); + weights_path += ".bin"; + } + if (ov::util::file_exists(weights_path)) { + update_config[ov::weights_path.name()] = weights_path; + } + } compiled_model = context ? plugin.import_model(networkStream, context, update_config) : plugin.import_model(networkStream, update_config); }); diff --git a/src/plugins/intel_gpu/src/plugin/plugin.cpp b/src/plugins/intel_gpu/src/plugin/plugin.cpp index 7d010a9b590e2e..b1cc946559ee94 100644 --- a/src/plugins/intel_gpu/src/plugin/plugin.cpp +++ b/src/plugins/intel_gpu/src/plugin/plugin.cpp @@ -596,7 +596,8 @@ std::vector Plugin::get_supported_properties() const { ov::PropertyName{ov::hint::enable_cpu_pinning.name(), PropertyMutability::RW}, ov::PropertyName{ov::device::id.name(), PropertyMutability::RW}, ov::PropertyName{ov::hint::dynamic_quantization_group_size.name(), PropertyMutability::RW}, - ov::PropertyName{ov::hint::activations_scale_factor.name(), PropertyMutability::RW} + ov::PropertyName{ov::hint::activations_scale_factor.name(), PropertyMutability::RW}, + ov::PropertyName{ov::weights_path.name(), PropertyMutability::RO}, }; return supported_properties; diff --git a/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp b/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp index 880868d8666560..839b2640ca180c 100644 --- a/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp +++ b/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp @@ -34,12 +34,22 @@ #include "openvino/pass/serialize.hpp" namespace { -class CheckWeightlessCacheAccuracy : public ::testing::Test { +class CheckWeightlessCacheAccuracy : public ::testing::Test, + public ::testing::WithParamInterface { +public: + static std::string get_test_case_name(::testing::TestParamInfo obj) { + bool use_compile_model_api = obj.param; + + std::ostringstream result; + result << "use_compile_model_api=" << use_compile_model_api; + return result.str(); + } protected: std::shared_ptr model; std::string xml_path; std::string bin_path; std::string cache_path; + bool use_compile_model_api; // for loading from cache void SetUp() override; void TearDown() override; @@ -51,6 +61,7 @@ void CheckWeightlessCacheAccuracy::SetUp() { xml_path = filePrefix + ".xml"; bin_path = filePrefix + ".bin"; cache_path = filePrefix + ".blob"; + use_compile_model_api = GetParam(); } void CheckWeightlessCacheAccuracy::TearDown() { @@ -74,7 +85,13 @@ void CheckWeightlessCacheAccuracy::run() { auto ifstr = std::ifstream(cache_path, std::ifstream::binary); ov::CompiledModel imported_model; - OV_ASSERT_NO_THROW(imported_model = core->import_model(ifstr, ov::test::utils::DEVICE_GPU, config_with_weights_path)); + if (use_compile_model_api) { + OV_ASSERT_NO_THROW(imported_model = + core->compile_model(xml_path, ov::test::utils::DEVICE_GPU, config)); + } else { + OV_ASSERT_NO_THROW(imported_model = + core->import_model(ifstr, ov::test::utils::DEVICE_GPU, config_with_weights_path)); + } ifstr.close(); auto orig_req = compiled_model.create_infer_request(); @@ -98,19 +115,23 @@ void CheckWeightlessCacheAccuracy::run() { } } -TEST_F(CheckWeightlessCacheAccuracy, ReadConcatSplitAssign) { +TEST_P(CheckWeightlessCacheAccuracy, ReadConcatSplitAssign) { model = ov::test::utils::make_read_concat_split_assign({1, 1, 2, 4}, ov::element::f16); run(); } -TEST_F(CheckWeightlessCacheAccuracy, SingleConcatWithConstant) { +TEST_P(CheckWeightlessCacheAccuracy, SingleConcatWithConstant) { model = ov::test::utils::make_single_concat_with_constant({1, 1, 2, 4}, ov::element::f16); run(); } -TEST_F(CheckWeightlessCacheAccuracy, TiWithLstmCell) { +TEST_P(CheckWeightlessCacheAccuracy, TiWithLstmCell) { model = ov::test::utils::make_ti_with_lstm_cell(ov::element::f16); run(); } +INSTANTIATE_TEST_SUITE_P(smoke_CheckWeightlessCacheAccuracy, CheckWeightlessCacheAccuracy, + ::testing::Bool(), + CheckWeightlessCacheAccuracy::get_test_case_name); + } // namespace From 291d3e1a5e8cba2e1ed0638d5440af40ef1f9cab Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Wed, 13 Nov 2024 10:21:04 +0100 Subject: [PATCH 04/28] [Templ test] GroupConvolutionBackpropData: Enable whole Tensor comparison (#27379) ### Details: - Enabled whole tensor comparison. ### Tickets: - CVS-137167 Signed-off-by: Tomasz Jankowski --- .../op_reference/group_convolution_backprop.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp b/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp index cc2162d4d95829..0e3c5de6289f99 100644 --- a/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp +++ b/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp @@ -104,14 +104,13 @@ class ReferenceGroupConvolutionBackpropDataLayerTest public CommonReferenceTest { public: void SetUp() override { - legacy_compare = true; - auto params = GetParam(); + const auto& params = GetParam(); function = CreateFunction(params); inputData = {params.inputData, params.filterData}; refOutData = {params.refData}; } static std::string getTestCaseName(const testing::TestParamInfo& obj) { - auto param = obj.param; + const auto& param = obj.param; std::ostringstream result; result << "inputShape=" << param.inputShape << "_"; result << "filterShape=" << param.filterShape << "_"; @@ -163,14 +162,13 @@ class ReferenceGroupConvolutionBackpropDataLayerOutShapeTest public CommonReferenceTest { public: void SetUp() override { - legacy_compare = true; - auto params = GetParam(); + const auto& params = GetParam(); function = CreateFunction(params); inputData = {params.inputData, params.filterData}; refOutData = {params.refData}; } static std::string getTestCaseName(const testing::TestParamInfo& obj) { - auto param = obj.param; + const auto& param = obj.param; std::ostringstream result; result << "inputShape=" << param.inputShape << "_"; result << "filterShape=" << param.filterShape << "_"; From 431202e0b253ec18c5b8d664a1badff98fbe2eb0 Mon Sep 17 00:00:00 2001 From: Roman Lyamin Date: Wed, 13 Nov 2024 13:28:26 +0400 Subject: [PATCH 05/28] [GPU] Minor state fixes (#27508) ### Tickets: - *[152882](https://jira.devtools.intel.com/browse/CVS-152882)* --- src/plugins/intel_gpu/src/graph/network.cpp | 3 ++- src/plugins/intel_gpu/src/graph/reshape.cpp | 3 ++- src/plugins/intel_gpu/src/plugin/common_utils.cpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/network.cpp b/src/plugins/intel_gpu/src/graph/network.cpp index 0af0e957df4ea8..24a103379a025c 100644 --- a/src/plugins/intel_gpu/src/graph/network.cpp +++ b/src/plugins/intel_gpu/src/graph/network.cpp @@ -581,7 +581,8 @@ void network::allocate_primitives() { // Update the output memory address of optimized-out layer if it is not valid. for (auto const& node : po) { - if (node->can_be_optimized() && !node->is_dynamic()) { + if (node->can_be_optimized() && !node->is_dynamic() && + (node->get_dependencies().empty() || !node->get_dependency(0).is_type())) { auto opt_inst = _primitives.at(node->id()); // build deps when prim_inst does not update dependencies yet. if (!node->get_dependencies().empty() && opt_inst->dependencies().empty()) { diff --git a/src/plugins/intel_gpu/src/graph/reshape.cpp b/src/plugins/intel_gpu/src/graph/reshape.cpp index 213a0aa175f5d2..e5e33f4ad87b14 100644 --- a/src/plugins/intel_gpu/src/graph/reshape.cpp +++ b/src/plugins/intel_gpu/src/graph/reshape.cpp @@ -11,6 +11,7 @@ #include "openvino/core/validation_util.hpp" #include "primitive_type_base.h" #include "reshape_inst.h" +#include "read_value_inst.h" #include "reshape_shape_inference.hpp" #include "squeeze_shape_inference.hpp" #include "unsqueeze_shape_inference.hpp" @@ -286,7 +287,7 @@ reshape_inst::typed_primitive_inst(network& network, reshape_node const& node) : // if reshape operated in-place, postpone creation of the output until network run, // then create new memory object as the reinterpreted output of the previous primitive - if (input_layout.is_static() && output_layout.is_static()) { + if (input_layout.is_static() && output_layout.is_static() && !node.get_dependency(0).is_type()) { if (!node.can_be_optimized()) { _outputs = allocate_outputs(); _mem_allocated = true; diff --git a/src/plugins/intel_gpu/src/plugin/common_utils.cpp b/src/plugins/intel_gpu/src/plugin/common_utils.cpp index ddd6b5677adc45..8a5e47279d10a0 100644 --- a/src/plugins/intel_gpu/src/plugin/common_utils.cpp +++ b/src/plugins/intel_gpu/src/plugin/common_utils.cpp @@ -88,6 +88,7 @@ void convert_and_copy(const void* src_ptr, ov::element::Type src_et, void* dst_p CASE(ov::element::f16, ov::element::f16, ov::float16, ov::float16); CASE(ov::element::bf16, ov::element::f32, ov::bfloat16, float); CASE(ov::element::bf16, ov::element::f16, ov::bfloat16, ov::float16); + CASE(ov::element::boolean, ov::element::u8, bool, uint8_t); OPENVINO_THROW("[GPU] Unsupported element types combination for copy: ", src_et, " -> ", dst_et); } From acccb227fba18aa4ef4536f8774563f63cd596b1 Mon Sep 17 00:00:00 2001 From: Andrii Staikov Date: Wed, 13 Nov 2024 10:54:35 +0100 Subject: [PATCH 06/28] [TRANSFORMATIONS | GPU] Add a Validate pass after MoveEltwiseUpThroughDataMovScalar for element type resolution (#27464) [TRANSFORMATIONS | GPU] Add a Validate pass after MoveEltwiseUpThroughDataMovScalar After executing the MoveEltwiseUpThroughDataMovScalar transforamtion some node's element types may appear to be in inconsistent/corrupted state. Fix it by inserting a Validate pass after the transformation for resolving the node's element types. This commit is a workaround until the 141764 is fixed which resolves the issue of Validate passes. Ticket: * CVS-151111 Signed-off-by: Andrii Staikov Signed-off-by: Andrii Staikov --- .../intel_gpu/src/plugin/transformations_pipeline.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp index 158dee2ee7ac05..db93696865a971 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp @@ -824,6 +824,11 @@ void TransformationsPipeline::apply(std::shared_ptr func) { ov::op::v3::Broadcast::get_type_info_static(), }; manager.register_pass(allowed_data_movement_ops); + // FIXME (151111): this Validate is added as a workaround for resolving element + // types after MoveEltwiseUpThroughDataMovScalar. It has to be removed + // after 141764 is fixed as there's a clear issue with Validate passes + // not working properly. + manager.register_pass(); manager.register_pass(); manager.register_pass(); From d5dcb0469b305003fa47164361067e5e179b887d Mon Sep 17 00:00:00 2001 From: Sebastian Golebiewski Date: Wed, 13 Nov 2024 12:07:02 +0100 Subject: [PATCH 07/28] [DOCS] Fixing reference in documentation (#27531) Fixing broken links in documentation. Signed-off-by: Sebastian Golebiewski --- .../performance-benchmarks-faq.rst | 8 +-- .../about-openvino/release-notes-openvino.rst | 62 +++++++++---------- .../documentation/legacy-features.rst | 2 +- .../[legacy]-supported-model-formats.rst | 4 +- .../convert-onnx-faster-r-cnn.rst | 2 +- .../convert-onnx-gpt-2.rst | 2 +- .../convert-pytorch-quartz-net.rst | 2 +- .../convert-pytorch-rnn-t.rst | 2 +- .../[legacy]-convert-tensorflow.rst | 2 +- .../legacy-model-optimizer-extensibility.rst | 2 +- .../openvino-security-add-on.rst | 2 +- .../openvino-training-extensions.rst | 4 +- .../low-precision-transformations.rst | 2 +- .../operation-specs/infrastructure/loop-5.rst | 4 +- .../operation-specs/sequence/gru-cell-3.rst | 2 +- .../sequence/gru-sequence-5.rst | 4 +- .../sequence/lstm-sequence-5.rst | 2 +- .../sequence/rnn-sequence-5.rst | 2 +- .../configurations-intel-gpu.rst | 2 +- .../install-openvino-yocto.rst | 2 +- .../llm-inference-native-ov.rst | 4 +- .../llm_inference_guide/ov-tokenizers.rst | 2 +- .../filter-pruning.rst | 2 +- .../inference-devices-and-modes.rst | 8 +-- .../gpu-device.rst | 2 +- .../advanced_throughput_options.rst | 8 +-- .../running-inference/stateful-models.rst | 2 +- .../running-inference/string-tensors.rst | 4 +- .../openvino-workflow/torch-compile.rst | 4 +- 29 files changed, 75 insertions(+), 75 deletions(-) diff --git a/docs/articles_en/about-openvino/performance-benchmarks/performance-benchmarks-faq.rst b/docs/articles_en/about-openvino/performance-benchmarks/performance-benchmarks-faq.rst index c55d3f44451f1c..4bf0b3a0acb19a 100644 --- a/docs/articles_en/about-openvino/performance-benchmarks/performance-benchmarks-faq.rst +++ b/docs/articles_en/about-openvino/performance-benchmarks/performance-benchmarks-faq.rst @@ -58,11 +58,11 @@ Performance Information F.A.Q. - Hugginface - Causal Decoder-only - 2048 - * - `Llama-2-7b-chat `__ + * - `Llama-2-7b-chat `__ - Meta AI - Auto regressive language - 4096 - * - `Llama-3-8b `__ + * - `Llama-3-8b `__ - Meta AI - Auto regressive language - 8192 @@ -74,7 +74,7 @@ Performance Information F.A.Q. - Huggingface - Auto regressive language - 4096 - * - `Stable-Diffusion-V1-5 `__ + * - `Stable-Diffusion-V1-5 `__ - Hugginface - Latent Diffusion Model - 77 @@ -118,7 +118,7 @@ Performance Information F.A.Q. - YOLO V5 Medium - object detection - 640x640 - * - `yolov8n `__ + * - `yolov8n `__ - Yolov8nano - object detection - 608x608 diff --git a/docs/articles_en/about-openvino/release-notes-openvino.rst b/docs/articles_en/about-openvino/release-notes-openvino.rst index 4bd0b5d32c0f0e..6685a4325d57fe 100644 --- a/docs/articles_en/about-openvino/release-notes-openvino.rst +++ b/docs/articles_en/about-openvino/release-notes-openvino.rst @@ -943,7 +943,7 @@ Previous 2024 releases deployed in an arbitrary path without any code changes. * KServe REST API support has been extended to properly handle the string format in JSON body, just like the binary format compatible with NVIDIA Triton™. - * `A demo showcasing a full RAG algorithm `__ + * `A demo showcasing a full RAG algorithm `__ fully delegated to the model server has been added. **Neural Network Compression Framework** @@ -1000,7 +1000,7 @@ Previous 2024 releases * `RMBG background removal `__ * `AnimateAnyone: pose guided image to video generation `__ * `LLaVA-Next visual-language assistant `__ - * `TripoSR: single image 3d reconstruction `__ + * `TripoSR: single image 3d reconstruction `__ * `RAG system with OpenVINO and LangChain `__ *Known Issues* @@ -1309,7 +1309,7 @@ Discontinued in 2024 * `Accuracy Checker `__. * `Post-Training Optimization Tool `__ (POT). Neural Network Compression Framework (NNCF) should be used instead. - * A `Git patch `__ + * A `Git patch `__ for NNCF integration with `huggingface/transformers `__. The recommended approach is to use `huggingface/optimum-intel `__ for applying NNCF optimization on top of models from Hugging Face. @@ -1360,25 +1360,25 @@ Deprecated and to be removed in the future * See alternative: `PaddleOCR with OpenVINO™ `__, * See alternative: `Handwritten Text Recognition Demo `__ - * `Image In-painting with OpenVINO™ `__ + * `Image In-painting with OpenVINO™ `__ * See alternative: `Image Inpainting Python Demo `__ - * `Interactive Machine Translation with OpenVINO `__ + * `Interactive Machine Translation with OpenVINO `__ * See alternative: `Machine Translation Python* Demo `__ - * `Open Model Zoo Tools Tutorial `__ + * `Open Model Zoo Tools Tutorial `__ * No alternatives, demonstrates deprecated tools. - * `Super Resolution with OpenVINO™ `__ + * `Super Resolution with OpenVINO™ `__ * See alternative: `Super Resolution with PaddleGAN and OpenVINO `__ * See alternative: `Image Processing C++ Demo `__ - * `Image Colorization with OpenVINO Tutorial `__ - * `Interactive Question Answering with OpenVINO™ `__ + * `Image Colorization with OpenVINO Tutorial `__ + * `Interactive Question Answering with OpenVINO™ `__ * See alternative: `BERT Question Answering Embedding Python* Demo `__ * See alternative: `BERT Question Answering Python* Demo `__ @@ -1387,37 +1387,37 @@ Deprecated and to be removed in the future * See alternative: `Security Barrier Camera C++ Demo `__ - * `The attention center model with OpenVINO™ `_ - * `Image Generation with DeciDiffusion `_ - * `Image generation with DeepFloyd IF and OpenVINO™ `_ - * `Depth estimation using VI-depth with OpenVINO™ `_ + * `The attention center model with OpenVINO™ `_ + * `Image Generation with DeciDiffusion `_ + * `Image generation with DeepFloyd IF and OpenVINO™ `_ + * `Depth estimation using VI-depth with OpenVINO™ `_ * `Instruction following using Databricks Dolly 2.0 and OpenVINO™ `_ * See alternative: `LLM Instruction-following pipeline with OpenVINO `__ - * `Image generation with FastComposer and OpenVINO™ `__ + * `Image generation with FastComposer and OpenVINO™ `__ * `Video Subtitle Generation with OpenAI Whisper `__ * See alternative: `Automatic speech recognition using Distil-Whisper and OpenVINO `__ - * `Introduction to Performance Tricks in OpenVINO™ `__ - * `Speaker Diarization with OpenVINO™ `__ - * `Subject-driven image generation and editing using BLIP Diffusion and OpenVINO `__ - * `Text Prediction with OpenVINO™ `__ - * `Training to Deployment with TensorFlow and OpenVINO™ `__ - * `Speech to Text with OpenVINO™ `__ - * `Convert and Optimize YOLOv7 with OpenVINO™ `__ - * `Quantize Data2Vec Speech Recognition Model using NNCF PTQ API `__ + * `Introduction to Performance Tricks in OpenVINO™ `__ + * `Speaker Diarization with OpenVINO™ `__ + * `Subject-driven image generation and editing using BLIP Diffusion and OpenVINO `__ + * `Text Prediction with OpenVINO™ `__ + * `Training to Deployment with TensorFlow and OpenVINO™ `__ + * `Speech to Text with OpenVINO™ `__ + * `Convert and Optimize YOLOv7 with OpenVINO™ `__ + * `Quantize Data2Vec Speech Recognition Model using NNCF PTQ API `__ * See alternative: `Quantize Speech Recognition Models with accuracy control using NNCF PTQ API `__ - * `Semantic segmentation with LRASPP MobileNet v3 and OpenVINO `__ - * `Video Recognition using SlowFast and OpenVINO™ `__ + * `Semantic segmentation with LRASPP MobileNet v3 and OpenVINO `__ + * `Video Recognition using SlowFast and OpenVINO™ `__ * See alternative: `Live Action Recognition with OpenVINO™ `__ - * `Semantic Segmentation with OpenVINO™ using Segmenter `__ - * `Programming Language Classification with OpenVINO `__ + * `Semantic Segmentation with OpenVINO™ using Segmenter `__ + * `Programming Language Classification with OpenVINO `__ * `Stable Diffusion Text-to-Image Demo `__ * See alternative: `Stable Diffusion v2.1 using Optimum-Intel OpenVINO and multiple Intel Hardware `__ @@ -1426,10 +1426,10 @@ Deprecated and to be removed in the future * See alternative: `Stable Diffusion v2.1 using Optimum-Intel OpenVINO and multiple Intel Hardware `__ - * `Image generation with Segmind Stable Diffusion 1B (SSD-1B) model and OpenVINO `__ - * `Data Preparation for 2D Medical Imaging `__ - * `Train a Kidney Segmentation Model with MONAI and PyTorch Lightning `__ - * `Live Inference and Benchmark CT-scan Data with OpenVINO™ `__ + * `Image generation with Segmind Stable Diffusion 1B (SSD-1B) model and OpenVINO `__ + * `Data Preparation for 2D Medical Imaging `__ + * `Train a Kidney Segmentation Model with MONAI and PyTorch Lightning `__ + * `Live Inference and Benchmark CT-scan Data with OpenVINO™ `__ * See alternative: `Quantize a Segmentation Model and Show Live Inference `__ @@ -1458,7 +1458,7 @@ are available on request. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Learn more at -`www.intel.com `__ +`www.intel.com `__ or from the OEM or retailer. No computer system can be absolutely secure. diff --git a/docs/articles_en/documentation/legacy-features.rst b/docs/articles_en/documentation/legacy-features.rst index f859a3a4572f88..2457d28cf24c15 100644 --- a/docs/articles_en/documentation/legacy-features.rst +++ b/docs/articles_en/documentation/legacy-features.rst @@ -96,7 +96,7 @@ Discontinued: | *New solution:* API 2.0 launched in OpenVINO 2022.1 | *Old solution:* discontinued with OpenVINO 2024.0 - | `The last version supporting API 1.0 `__ + | `2023.2 is the last version supporting API 1.0 `__ .. dropdown:: Compile tool diff --git a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats.rst b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats.rst index b5d3c08b39f480..fb9f41c755d4fb 100644 --- a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats.rst +++ b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats.rst @@ -120,7 +120,7 @@ Here are code examples of how to use these methods with different model formats: For more details on conversion, refer to the :doc:`guide <[legacy]-supported-model-formats/[legacy]-convert-tensorflow>` - and an example `tutorial `__ + and an example `tutorial `__ on this topic. * The ``read_model()`` and ``compile_model()`` methods: @@ -592,7 +592,7 @@ to OpenVINO IR or ONNX before running inference should be considered the default OpenVINO versions of 2023 are mostly compatible with the old instructions, through a deprecated MO tool, installed with the deprecated OpenVINO Developer Tools package. - `OpenVINO 2023.0 `__ is the last + `OpenVINO 2023.0 `__ is the last release officially supporting the MO conversion process for the legacy formats. diff --git a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-faster-r-cnn.rst b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-faster-r-cnn.rst index 711a060b7467b8..7880b261c80b81 100644 --- a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-faster-r-cnn.rst +++ b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-faster-r-cnn.rst @@ -14,7 +14,7 @@ Converting an ONNX Faster R-CNN Model The instructions below are applicable **only** to the Faster R-CNN model converted to the ONNX file format from the `maskrcnn-benchmark model `__: -1. Download the pretrained model file from `onnx/models `__ (commit-SHA: 8883e49e68de7b43e263d56b9ed156dfa1e03117). +1. Download the pretrained model file from `onnx/models `__ (commit-SHA: 8883e49e68de7b43e263d56b9ed156dfa1e03117). 2. Generate the Intermediate Representation of the model, by changing your current working directory to the model conversion API installation directory, and running model conversion with the following parameters: diff --git a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-gpt-2.rst b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-gpt-2.rst index 84392e92e620d2..4c10c941c7fb47 100644 --- a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-gpt-2.rst +++ b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-onnx-gpt-2.rst @@ -12,7 +12,7 @@ Converting an ONNX GPT-2 Model This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <../../../../../../learn-openvino/interactive-tutorials-python>`. -`Public pre-trained GPT-2 model `__ is a large +`Public pre-trained GPT-2 model `__ is a large transformer-based language model with a simple objective: predict the next word, given all of the previous words within some text. Downloading the Pre-Trained Base GPT-2 Model diff --git a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-quartz-net.rst b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-quartz-net.rst index de3af8ce5175f0..f1ee885dae0b26 100644 --- a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-quartz-net.rst +++ b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-quartz-net.rst @@ -20,7 +20,7 @@ Downloading the Pre-trained QuartzNet Model To download the pre-trained model, refer to the `NeMo Speech Models Catalog `__. Here are the instructions on how to obtain QuartzNet in ONNX format. -1. Install the NeMo toolkit, using the `instructions `__. +1. Install the NeMo toolkit, using the `instructions `__. 2. Run the following code: diff --git a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-rnn-t.rst b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-rnn-t.rst index 4f33e510a40267..ad646568aed598 100644 --- a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-rnn-t.rst +++ b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-pytorch-rnn-t.rst @@ -44,7 +44,7 @@ For UNIX-like systems, you can use ``wget``: The link was taken from ``setup.sh`` in the ``speech_recoginitin/rnnt`` subfolder. You will get exactly the same weights as -if you were following the `guide `__. +if you were following the `guide `__. **Step 4**. Install required Python packages: diff --git a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-tensorflow.rst b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-tensorflow.rst index 955d5418d37270..2bcb6fde9b833b 100644 --- a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-tensorflow.rst +++ b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-tensorflow.rst @@ -59,7 +59,7 @@ To convert such TensorFlow model, run the `mo` script with a path to the MetaGra 3. **SavedModel format**. In this case, a model consists of a special directory with a ``.pb`` file -and several subfolders: ``variables``, ``assets``, and ``assets.extra``. For more information about the SavedModel directory, refer to the `README `__ file in the TensorFlow repository. +and several subfolders: ``variables``, ``assets``, and ``assets.extra``. For more information about the SavedModel directory, refer to the `README `__ file in the TensorFlow repository. To convert such TensorFlow model, run the ``mo`` script with a path to the SavedModel directory: .. code-block:: sh diff --git a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-model-optimizer-extensibility.rst b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-model-optimizer-extensibility.rst index fc78b12640771a..3d2365f45ffe3b 100644 --- a/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-model-optimizer-extensibility.rst +++ b/docs/articles_en/documentation/legacy-features/transition-legacy-conversion-api/legacy-model-optimizer-extensibility.rst @@ -160,7 +160,7 @@ It is important to mention that sometimes it seems like transformation cannot be because the actual values of inputs or shapes are needed. In fact, manipulations of shapes or values can be implemented using operations that are added to the graph. Consider the ``extensions/front/onnx/flattenONNX_to_reshape.py`` transformation, which replaces an ONNX -`Flatten `__ operation with a sub-graph of operations performing +`Flatten `__ operation with a sub-graph of operations performing the following (when ``axis`` is not equal to 0 and 1): 1. Calculate a shape of the ``Flatten`` input tensor, using the :doc:`ShapeOf <../../openvino-ir-format/operation-sets/operation-specs/shape/shape-of-3>` operation. diff --git a/docs/articles_en/documentation/openvino-ecosystem/openvino-security-add-on.rst b/docs/articles_en/documentation/openvino-ecosystem/openvino-security-add-on.rst index 2d5598a5eb8e9d..3959ebefb09a4a 100644 --- a/docs/articles_en/documentation/openvino-ecosystem/openvino-security-add-on.rst +++ b/docs/articles_en/documentation/openvino-ecosystem/openvino-security-add-on.rst @@ -580,7 +580,7 @@ Building OpenVINO™ Security Add-on depends on OpenVINO™ Model Server docker 1. Download the `OpenVINO™ Model Server software `__ -2. Build the `OpenVINO™ Model Server Docker images `__ +2. Build the `OpenVINO™ Model Server Docker images `__ .. code-block:: sh diff --git a/docs/articles_en/documentation/openvino-ecosystem/openvino-training-extensions.rst b/docs/articles_en/documentation/openvino-ecosystem/openvino-training-extensions.rst index a7a81acd9ba3a7..8a5bd91f9c1b7b 100644 --- a/docs/articles_en/documentation/openvino-ecosystem/openvino-training-extensions.rst +++ b/docs/articles_en/documentation/openvino-ecosystem/openvino-training-extensions.rst @@ -32,9 +32,9 @@ If the results are unsatisfactory, add datasets and perform the same steps, star OpenVINO Training Extensions Components ####################################### -* `OpenVINO Training Extensions API `__ +* `OpenVINO Training Extensions API `__ * `OpenVINO Training Extensions CLI `__ -* `OpenVINO Training Extensions Algorithms `__ +* `OpenVINO Training Extensions Algorithms `__ Tutorials ######### diff --git a/docs/articles_en/documentation/openvino-extensibility/openvino-plugin-library/advanced-guides/low-precision-transformations.rst b/docs/articles_en/documentation/openvino-extensibility/openvino-plugin-library/advanced-guides/low-precision-transformations.rst index 6ba9e0a9b60f52..9451fabd6219d8 100644 --- a/docs/articles_en/documentation/openvino-extensibility/openvino-plugin-library/advanced-guides/low-precision-transformations.rst +++ b/docs/articles_en/documentation/openvino-extensibility/openvino-plugin-library/advanced-guides/low-precision-transformations.rst @@ -35,7 +35,7 @@ The goal of Low Precision Transformations (LPT) is to transform a quantized mode As result, operation input tensor precisions will be changed from original to low precision and operations can be inferred by OpenVINO™ plugin in low precision. -For a more detailed description on how to quantize a model, see the `Low precision tools <#low-precision-tools>`__ section below. For more information about model quantization, refer to **Brief History of Lower Precision in Deep Learning** section in `this whitepaper `__. +For a more detailed description on how to quantize a model, see the `Low precision tools <#low-precision-tools>`__ section below. For more information about model quantization, refer to **Brief History of Lower Precision in Deep Learning** section in `this whitepaper `__. Input model requirements ######################## diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/infrastructure/loop-5.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/infrastructure/loop-5.rst index 5cc1b024f158b1..f02c5414ac4369 100644 --- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/infrastructure/loop-5.rst +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/infrastructure/loop-5.rst @@ -11,7 +11,7 @@ Loop **Category**: *Infrastructure* **Short description**: *Loop* operation performs recurrent execution of the network, which is described in the ``body``, iterating through the data. -The operation has similar semantic to the ONNX Loop `operation `__. +The operation has similar semantic to the ONNX Loop `operation `__. **Detailed description** @@ -73,7 +73,7 @@ Loop operation description in the IR also has several special sections: ``body`` 1. The body operation getting an input from the main graph should have an entry in the ``port_map`` section of the Loop operation. These edges connect input ports of the Loop with the body ``Parameter``\ s. 2. Input tensors to the Loop can be sliced along a specified axis, the Loop can iterates over all sliced parts. The corresponding ``input`` entry in the ``port_map`` should have ``axis`` attribute specifying the axis to slice. Therefore, inputs to the Loop operation corresponding to ``input`` entries in the ``port_map`` without ``axis`` attribute are used "as is" (without slicing). 3. The body operation producing tensor to be used in the subsequent iterations (like in RNN models) should have a back edge described in the ``back_edges`` section of the operation. The back edge connects the respective body ``Parameter`` and ``Result`` operations. For such a case the Loop operation node provides input for the first iteration, while corresponding Loop operation output produces the tensor computed during the last iteration. -4. Output tensors produced by a particular body operation across all iterations can be concatenated and returned as a Loop operation output (this is a "scan output" according to the ONNX* Loop operation `specification `__ ). The corresponding ``output`` entry in the ``port_map`` should have ``axis`` attribute specifying the axis to concatenate. Therefore, outputs from operations corresponding to ``output`` entries in the ``port_map`` without ``axis`` attribute are returned "as is" (without concatenation). +4. Output tensors produced by a particular body operation across all iterations can be concatenated and returned as a Loop operation output (this is a "scan output" according to the ONNX* Loop operation `specification `__ ). The corresponding ``output`` entry in the ``port_map`` should have ``axis`` attribute specifying the axis to concatenate. Therefore, outputs from operations corresponding to ``output`` entries in the ``port_map`` without ``axis`` attribute are returned "as is" (without concatenation). 5. There is one body ``Parameter`` operation not connected through the ``port_map``. This is a "current iteration" input. The Loop operation is responsible for providing the appropriate value for each iteration. 6. Connection of nodes inside the Loop body with the main graph should be done through ``Parameter`` and ``Result`` body operations. No other ways to connect graphs are allowed. diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-cell-3.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-cell-3.rst index 28dbec46289f89..f58418ee923a8b 100644 --- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-cell-3.rst +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-cell-3.rst @@ -64,7 +64,7 @@ GRUCell * *linear_before_reset* * **Description**: *linear_before_reset* flag denotes if the layer behaves according to the modification - of *GRUCell* described in the formula in the `ONNX documentation `__. + of *GRUCell* described in the formula in the `ONNX documentation `__. * **Range of values**: true or false * **Type**: ``boolean`` * **Default value**: false diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-sequence-5.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-sequence-5.rst index 37c70087e121ea..f9b9a5ece850ec 100644 --- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-sequence-5.rst +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/gru-sequence-5.rst @@ -19,7 +19,7 @@ represents a sequence of GRU cells. The sequence can be connected differently de ``direction`` attribute that specifies the direction of traversing of input data along sequence dimension or specifies whether it should be a bidirectional sequence. The most of the attributes are in sync with the specification of ONNX GRU operator defined -`GRUCell `__ +`GRUCell `__ **Attributes** @@ -69,7 +69,7 @@ are in sync with the specification of ONNX GRU operator defined * *linear_before_reset* * **Description**: *linear_before_reset* flag denotes if the layer behaves according to the modification - of *GRUCell* described in the formula in the `ONNX documentation `__. + of *GRUCell* described in the formula in the `ONNX documentation `__. * **Range of values**: True or False * **Type**: ``boolean`` * **Default value**: False diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/lstm-sequence-5.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/lstm-sequence-5.rst index c00b4c819cc66a..164033bdd2831c 100644 --- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/lstm-sequence-5.rst +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/lstm-sequence-5.rst @@ -14,7 +14,7 @@ LSTMSequence **Detailed description** -A single cell in the sequence is implemented in the same way as in :doc:`LSTM Cell ` operation. *LSTMSequence* represents a sequence of LSTM cells. The sequence can be connected differently depending on ``direction`` attribute that specifies the direction of traversing of input data along sequence dimension or specifies whether it should be a bidirectional sequence. The most of the attributes are in sync with the specification of ONNX LSTM operator defined `LSTMCell `__ . +A single cell in the sequence is implemented in the same way as in :doc:`LSTM Cell ` operation. *LSTMSequence* represents a sequence of LSTM cells. The sequence can be connected differently depending on ``direction`` attribute that specifies the direction of traversing of input data along sequence dimension or specifies whether it should be a bidirectional sequence. The most of the attributes are in sync with the specification of ONNX LSTM operator defined `LSTMCell `__ . **Attributes** diff --git a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/rnn-sequence-5.rst b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/rnn-sequence-5.rst index fc9829dd999bda..a3dfc062de2dcd 100644 --- a/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/rnn-sequence-5.rst +++ b/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/sequence/rnn-sequence-5.rst @@ -14,7 +14,7 @@ RNNSequence **Detailed description** -A single cell in the sequence is implemented in the same way as in :doc:`RNNCell ` operation. *RNNSequence* represents a sequence of RNN cells. The sequence can be connected differently depending on `direction` attribute that specifies the direction of traversing of input data along sequence dimension or specifies whether it should be a bidirectional sequence. The most of the attributes are in sync with the specification of ONNX RNN operator defined `RNNCell `__. +A single cell in the sequence is implemented in the same way as in :doc:`RNNCell ` operation. *RNNSequence* represents a sequence of RNN cells. The sequence can be connected differently depending on `direction` attribute that specifies the direction of traversing of input data along sequence dimension or specifies whether it should be a bidirectional sequence. The most of the attributes are in sync with the specification of ONNX RNN operator defined `RNNCell `__. **Attributes** diff --git a/docs/articles_en/get-started/configurations/configurations-intel-gpu.rst b/docs/articles_en/get-started/configurations/configurations-intel-gpu.rst index dc43881780b1e6..e10a67fddadb53 100644 --- a/docs/articles_en/get-started/configurations/configurations-intel-gpu.rst +++ b/docs/articles_en/get-started/configurations/configurations-intel-gpu.rst @@ -37,7 +37,7 @@ Below are the instructions on how to install the OpenCL packages on supported Li and install the apt package `ocl-icd-libopencl1` with the OpenCl ICD loader. Alternatively, you can add the apt repository by following the - `installation guide `__. + `installation guide `__. Then install the `ocl-icd-libopencl1`, `intel-opencl-icd`, `intel-level-zero-gpu` and `level-zero` apt packages: diff --git a/docs/articles_en/get-started/install-openvino/install-openvino-yocto.rst b/docs/articles_en/get-started/install-openvino/install-openvino-yocto.rst index 0ff1b95c8eb212..475f623ef86598 100644 --- a/docs/articles_en/get-started/install-openvino/install-openvino-yocto.rst +++ b/docs/articles_en/get-started/install-openvino/install-openvino-yocto.rst @@ -108,6 +108,6 @@ Additional Resources - `Official Yocto Project documentation `__ - `BitBake Tool `__ - `Poky `__ -- `Meta-intel `__ +- `Meta-intel `__ - `Meta-openembedded `__ - `Meta-clang `__ \ No newline at end of file diff --git a/docs/articles_en/learn-openvino/llm_inference_guide/llm-inference-native-ov.rst b/docs/articles_en/learn-openvino/llm_inference_guide/llm-inference-native-ov.rst index 7f220111f64b98..2476a0423e30e1 100644 --- a/docs/articles_en/learn-openvino/llm_inference_guide/llm-inference-native-ov.rst +++ b/docs/articles_en/learn-openvino/llm_inference_guide/llm-inference-native-ov.rst @@ -31,8 +31,8 @@ some examples of popular Generative AI scenarios: To write such pipelines, you can follow the examples provided as part of OpenVINO: -* `OpenVINO Latent Consistency Model C++ image generation pipeline `__ -* `OpenVINO Stable Diffusion (with LoRA) C++ image generation pipeline `__ +* `OpenVINO Latent Consistency Model C++ image generation pipeline `__ +* `OpenVINO Stable Diffusion (with LoRA) C++ image generation pipeline `__ To perform inference, models must be first converted to OpenVINO IR format using Hugging Face Optimum-Intel API. diff --git a/docs/articles_en/learn-openvino/llm_inference_guide/ov-tokenizers.rst b/docs/articles_en/learn-openvino/llm_inference_guide/ov-tokenizers.rst index d6e23b3791d001..2064aa843a93d8 100644 --- a/docs/articles_en/learn-openvino/llm_inference_guide/ov-tokenizers.rst +++ b/docs/articles_en/learn-openvino/llm_inference_guide/ov-tokenizers.rst @@ -336,7 +336,7 @@ Additional Resources * `OpenVINO Tokenizers repo `__ * `OpenVINO Tokenizers Notebook `__ -* `Text generation C++ samples that support most popular models like LLaMA 2 `__ +* `Text generation C++ samples that support most popular models like LLaMA 3 `__ * `OpenVINO GenAI Repo `__ diff --git a/docs/articles_en/openvino-workflow/model-optimization-guide/compressing-models-during-training/filter-pruning.rst b/docs/articles_en/openvino-workflow/model-optimization-guide/compressing-models-during-training/filter-pruning.rst index 5033d24ba3785a..2a551d7aa44eb5 100644 --- a/docs/articles_en/openvino-workflow/model-optimization-guide/compressing-models-during-training/filter-pruning.rst +++ b/docs/articles_en/openvino-workflow/model-optimization-guide/compressing-models-during-training/filter-pruning.rst @@ -76,7 +76,7 @@ of optimization methods (`"compression"` section). :fragment: [nncf_congig] Here is a brief description of the required parameters of the Filter Pruning method. For a full description refer to the -`GitHub `__ page. +`GitHub `__ page. * ``pruning_init`` - initial pruning rate target. For example, value ``0.1`` means that at the begging of training, convolutions that can be pruned will have 10% of their filters set to zero. diff --git a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes.rst b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes.rst index 41d43f7eea37d6..aa8e9cdabfda64 100644 --- a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes.rst +++ b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes.rst @@ -83,7 +83,7 @@ Accordingly, the code that loops over all available devices of the "GPU" type on Additional Resources #################### -* `OpenVINO™ Runtime API Tutorial <./../../notebooks/openvino-api-with-output.html>`__ -* `AUTO Device Tutorial <./../../notebooks/auto-device-with-output.html>`__ -* `GPU Device Tutorial <./../../notebooks/gpu-device-with-output.html>`__ -* `NPU Device Tutorial <./../../notebooks/hello-npu-with-output.html>`__ \ No newline at end of file +* `OpenVINO™ Runtime API Tutorial <../../notebooks/openvino-api-with-output.html>`__ +* `AUTO Device Tutorial <../../notebooks/auto-device-with-output.html>`__ +* `GPU Device Tutorial <../../notebooks/gpu-device-with-output.html>`__ +* `NPU Device Tutorial <../../notebooks/hello-npu-with-output.html>`__ \ No newline at end of file diff --git a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/gpu-device.rst b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/gpu-device.rst index 78cf0632f61b2b..b4e1c7ac15afcc 100644 --- a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/gpu-device.rst +++ b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/gpu-device.rst @@ -19,7 +19,7 @@ For an in-depth description of the GPU plugin, see: - `GPU plugin developer documentation `__ - `OpenVINO Runtime GPU plugin source files `__ -- `Accelerate Deep Learning Inference with Intel® Processor Graphics `__ +- `Start AI Development with Intel `__ The GPU plugin is a part of the Intel® Distribution of OpenVINO™ toolkit. For more information on how to configure a system to use it, see the :doc:`GPU configuration <../../../get-started/configurations/configurations-intel-gpu>`. diff --git a/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimizing-throughput/advanced_throughput_options.rst b/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimizing-throughput/advanced_throughput_options.rst index 7466d00efe5eb7..cad5633e11f85b 100644 --- a/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimizing-throughput/advanced_throughput_options.rst +++ b/docs/articles_en/openvino-workflow/running-inference/optimize-inference/optimizing-throughput/advanced_throughput_options.rst @@ -85,12 +85,12 @@ Number of Streams Considerations * Select the number of streams that is **less or equal** to the number of requests that the application would be able to run simultaneously. * To avoid wasting resources, the number of streams should be enough to meet the *average* parallel slack rather than the peak load. -* Use the `ov::streams::AUTO `__ as a more portable option (that also respects the underlying hardware configuration). +* Use the `ov::streams::AUTO <../../../../api/c_cpp_api/group__ov__runtime__cpp__prop__api.html#_CPPv44AUTO>`__ as a more portable option (that also respects the underlying hardware configuration). * It is very important to keep these streams busy, by running as many inference requests as possible (for example, start the newly-arrived inputs immediately): - * A bare minimum of requests to saturate the device can be queried as the `ov::optimal_number_of_infer_requests `__ of the ``ov:Compiled_Model``. + * A bare minimum of requests to saturate the device can be queried as the `ov::optimal_number_of_infer_requests <../../../../api/c_cpp_api/group__ov__runtime__cpp__prop__api.html#_CPPv432optimal_number_of_infer_requests>`__ of the ``ov:Compiled_Model``. -* *The maximum number of streams* for the device (per model) can be queried as the `ov::range_for_streams `__. +* *The maximum number of streams* for the device (per model) can be queried as the `ov::range_for_streams <../../../../api/c_cpp_api/group__ov__runtime__cpp__prop__api.html#_CPPv417range_for_streams>`__. Batch Size Considerations +++++++++++++++++++++++++ @@ -99,7 +99,7 @@ Batch Size Considerations * Otherwise (or if the number of "available" requests fluctuates), you may need to keep several instances of the network (reshaped to the different batch size) and select the properly sized instance in the runtime accordingly. -* For OpenVINO devices that implement a dedicated heuristic internally, the `ov::optimal_batch_size `__ is a *device* property (that accepts the actual model as a parameter) to query the recommended batch size for the model. +* For OpenVINO devices that implement a dedicated heuristic internally, the `ov::optimal_batch_size <../../../../api/c_cpp_api/group__ov__runtime__cpp__prop__api.html#_CPPv418optimal_batch_size>`__ is a *device* property (that accepts the actual model as a parameter) to query the recommended batch size for the model. A Few Device-specific Details diff --git a/docs/articles_en/openvino-workflow/running-inference/stateful-models.rst b/docs/articles_en/openvino-workflow/running-inference/stateful-models.rst index 86788b20249a3f..d00fd19c4d636d 100644 --- a/docs/articles_en/openvino-workflow/running-inference/stateful-models.rst +++ b/docs/articles_en/openvino-workflow/running-inference/stateful-models.rst @@ -139,5 +139,5 @@ sequences. You can find more examples demonstrating how to work with states in other articles: -* `LLM Chatbot notebook <../../notebooks/stable-zephyr-3b-chatbot-with-output.html>`__ +* `LLaVA-NeXT Multimodal Chatbot notebook <../../notebooks/llava-next-multimodal-chatbot-with-output.html>`__ * :doc:`Serving Stateful Models with OpenVINO Model Server <../../openvino-workflow/model-server/ovms_docs_stateful_models>` diff --git a/docs/articles_en/openvino-workflow/running-inference/string-tensors.rst b/docs/articles_en/openvino-workflow/running-inference/string-tensors.rst index 438c9ea9ec0bd3..3032add547f8a8 100644 --- a/docs/articles_en/openvino-workflow/running-inference/string-tensors.rst +++ b/docs/articles_en/openvino-workflow/running-inference/string-tensors.rst @@ -201,6 +201,6 @@ Additional Resources * Learn about the :doc:`basic steps to integrate inference in your application `. -* Use `OpenVINO tokenizers `__ to produce models that use string tensors to work with textual information as pre- and post-processing for the large language models. +* Use `OpenVINO tokenizers `__ to produce models that use string tensors to work with textual information as pre- and post-processing for the large language models. -* Check out `GenAI Samples `__ to see how string tensors are used in real-life applications. +* Check out `GenAI Samples `__ to see how string tensors are used in real-life applications. diff --git a/docs/articles_en/openvino-workflow/torch-compile.rst b/docs/articles_en/openvino-workflow/torch-compile.rst index 5bdb51a596d5d8..e5bc0ca901a5aa 100644 --- a/docs/articles_en/openvino-workflow/torch-compile.rst +++ b/docs/articles_en/openvino-workflow/torch-compile.rst @@ -288,7 +288,7 @@ PyTorch supports ``torch.compile`` officially on Windows from version 2.3.0 onwa For PyTorch versions below 2.3.0, the ``torch.compile`` feature is not supported on Windows officially. However, it can be accessed by running the following instructions: -1. Install the PyTorch nightly wheel file - `2.1.0.dev20230713 `__ , +1. Install the PyTorch nightly wheel file - `2.1.0.dev20230713 `__ , 2. Update the file at ``/Lib/site-packages/torch/_dynamo/eval_frames.py`` 3. Find the function called ``check_if_dynamo_supported()``: @@ -374,7 +374,7 @@ The ``torch.compile`` feature is part of PyTorch 2.0, and is based on: (PEP 523) to dynamically modify Python bytecode right before it is executed (PyTorch operators that cannot be extracted to FX graph are executed in the native Python environment). It maintains the eager-mode capabilities using - `Guards `__ to ensure the + `Guards `__ to ensure the generated graphs are valid. * **AOTAutograd** - generates the backward graph corresponding to the forward graph captured by TorchDynamo. From a97ff61747661ba362c1b390a12c41809306858e Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 13 Nov 2024 13:51:18 +0100 Subject: [PATCH 08/28] [CI][GHA] Manylinux x86 build (#27430) ### Details: - Enabled manilinux x86 build based on manylinux 2014 image - OpenVINO tarball package - Wheels for 3.9-3.13 Pythons ### Tickets: - *148719* --------- Co-authored-by: Alina Kladieva Co-authored-by: Ilya Lavrenov --- .github/dockerfiles/docker_tag | 2 +- .../ov_build/manylinux2014_x86_64/Dockerfile | 20 ++ .../ubuntu_22_04_x64_docker/Dockerfile | 42 ++++ .github/workflows/manylinux_2014.yml | 191 ++++++++++++++++++ 4 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 .github/dockerfiles/ov_build/manylinux2014_x86_64/Dockerfile create mode 100644 .github/dockerfiles/ov_build/ubuntu_22_04_x64_docker/Dockerfile create mode 100644 .github/workflows/manylinux_2014.yml diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tag index 5a4f7795ea4a44..3783a7e8d5600a 100644 --- a/.github/dockerfiles/docker_tag +++ b/.github/dockerfiles/docker_tag @@ -1 +1 @@ -pr-27384 +pr-27430 diff --git a/.github/dockerfiles/ov_build/manylinux2014_x86_64/Dockerfile b/.github/dockerfiles/ov_build/manylinux2014_x86_64/Dockerfile new file mode 100644 index 00000000000000..59239575be329c --- /dev/null +++ b/.github/dockerfiles/ov_build/manylinux2014_x86_64/Dockerfile @@ -0,0 +1,20 @@ +ARG REGISTRY="quay.io" +FROM openvinogithubactions.azurecr.io/quayio/pypa/manylinux2014_x86_64 + +USER root + +# Install build dependencies +ADD install_build_dependencies.sh /install_build_dependencies.sh +RUN chmod +x /install_build_dependencies.sh && /install_build_dependencies.sh + +# Install sscache +ARG SCCACHE_VERSION="v0.7.5" +ENV SCCACHE_HOME="/opt/sccache" \ + SCCACHE_PATH="/opt/sccache/sccache" + +RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \ + SCCACHE_ARCHIVE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" && \ + curl -SLO https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_ARCHIVE} && \ + tar -xzf ${SCCACHE_ARCHIVE} --strip-components=1 && rm ${SCCACHE_ARCHIVE} + +ENV PATH="$SCCACHE_HOME:$PATH" diff --git a/.github/dockerfiles/ov_build/ubuntu_22_04_x64_docker/Dockerfile b/.github/dockerfiles/ov_build/ubuntu_22_04_x64_docker/Dockerfile new file mode 100644 index 00000000000000..2d5bc1c878069a --- /dev/null +++ b/.github/dockerfiles/ov_build/ubuntu_22_04_x64_docker/Dockerfile @@ -0,0 +1,42 @@ +ARG REGISTRY="docker.io" +FROM ${REGISTRY}/library/ubuntu:22.04 + +USER root + +# APT configuration +RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \ + echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \ + echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \ + echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf + +ENV DEBIAN_FRONTEND="noninteractive" \ + TZ="Europe/London" + +RUN apt-get update && \ + apt-get install software-properties-common && \ + add-apt-repository --yes --no-update ppa:git-core/ppa && \ + add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \ + apt-get update && \ + apt-get install \ + curl \ + git \ + gpg-agent \ + tzdata \ + # parallel gzip + pigz \ + python3 \ + python3-pip \ + && \ + rm -rf /var/lib/apt/lists/* + +# Install docker +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ + gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \ + https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + +RUN apt-get update && \ + apt-get install -y docker-ce docker-ce-cli containerd.io + +ENV DOCKER_BUILDKIT=1 \ No newline at end of file diff --git a/.github/workflows/manylinux_2014.yml b/.github/workflows/manylinux_2014.yml new file mode 100644 index 00000000000000..ed375fb868459f --- /dev/null +++ b/.github/workflows/manylinux_2014.yml @@ -0,0 +1,191 @@ +name: Manylinux 2014 +on: + workflow_dispatch: + pull_request: + merge_group: + push: + branches: + - master + - 'releases/**' + +concurrency: + # github.ref is not unique in post-commit + group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-manylinux-2014 + cancel-in-progress: true + +permissions: read-all + +env: + PIP_CACHE_PATH: /mount/caches/pip/linux + +jobs: + Smart_CI: + runs-on: ubuntu-latest + outputs: + affected_components: "${{ steps.smart_ci.outputs.affected_components }}" + changed_components: "${{ steps.smart_ci.outputs.changed_components }}" + skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}" + steps: + - name: checkout action + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + sparse-checkout: .github/actions/smart-ci + + - name: Get affected components + id: smart_ci + uses: ./.github/actions/smart-ci + with: + repository: ${{ github.repository }} + pr: ${{ github.event.number }} + commit_sha: ${{ github.sha }} + ref_name: ${{ github.ref_name }} + component_pattern: "category: (.*)" + repo_token: ${{ secrets.GITHUB_TOKEN }} + skip_when_only_listed_labels_set: 'docs' + skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg' + + - name: Show affected components + run: | + echo "${{ toJSON(steps.smart_ci.outputs.affected_components) }}" + shell: bash + + Docker: + needs: Smart_CI + if: "!needs.smart_ci.outputs.skip_workflow" + runs-on: aks-linux-4-cores-16gb-docker-build + container: + image: openvinogithubactions.azurecr.io/docker_build:0.2 + volumes: + - /mount:/mount + outputs: + images: "${{ steps.handle_docker.outputs.images }}" + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - uses: ./.github/actions/handle_docker + id: handle_docker + with: + images: | + ov_build/ubuntu_22_04_x64_docker + ov_build/manylinux2014_x86_64 + registry: 'openvinogithubactions.azurecr.io' + dockerfiles_root_dir: '.github/dockerfiles' + changed_components: ${{ needs.smart_ci.outputs.changed_components }} + + Build: + needs: [Docker] + timeout-minutes: 120 + defaults: + run: + shell: bash + runs-on: aks-linux-16-cores-32gb-manylinux + if: ${{ github.repository_owner == 'openvinotoolkit' }} + container: + image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64_docker }} + volumes: + - /mount:/mount + options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING -e DOCKER_CONFIG -v ${{ github.workspace }}:${{ github.workspace }} + env: + CMAKE_BUILD_TYPE: 'Release' + OPENVINO_REPO: ${{ github.workspace }}/src + INSTALL_DIR: ${{ github.workspace }}/install/openvino + INSTALL_WHEELS_DIR: ${{ github.workspace }}/install/wheels + BUILD_DIR: ${{ github.workspace }}/build + DOCKER_CONFIG: "/mount/.docker" + CMAKE_CXX_COMPILER_LAUNCHER: sccache + CMAKE_C_COMPILER_LAUNCHER: sccache + SCCACHE_IGNORE_SERVER_IO_ERROR: 1 + SCCACHE_SERVER_PORT: 35555 + SCCACHE_CACHE_SIZE: 50G + SCCACHE_AZURE_KEY_PREFIX: manylinux_2014 + + steps: + - name: Clone OpenVINO + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: ${{ env.OPENVINO_REPO }} + submodules: 'true' + + - name: System info + uses: ./src/.github/actions/system_info + + - name: Create docker build cache + run: | + docker volume create ov_build_cache + + - name: Build OpenVINO + run: | + docker run --rm \ + -v ${{ env.OPENVINO_REPO }}:/work/src \ + -v ov_build_cache:/work/build \ + -v ${{ env.INSTALL_DIR }}:/work/install \ + -e SCCACHE_AZURE_BLOB_CONTAINER \ + -e SCCACHE_AZURE_CONNECTION_STRING \ + -e SCCACHE_SERVER_PORT \ + -e SCCACHE_IGNORE_SERVER_IO_ERROR \ + -e SCCACHE_CACHE_SIZE \ + -e SCCACHE_AZURE_KEY_PREFIX \ + -e CMAKE_CXX_COMPILER_LAUNCHER \ + -e CMAKE_C_COMPILER_LAUNCHER \ + -w /work/src \ + ${{ fromJSON(needs.docker.outputs.images).ov_build.manylinux2014_x86_64 }} \ + /bin/bash -c " + cmake -DENABLE_CPPLINT=OFF -DENABLE_NCC_STYLE=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_PYTHON=OFF -DENABLE_WHEEL=OFF -S /work/src -B /work/build && + cmake --build /work/build --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} && + cmake --install /work/build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /work/install + " + + - name: Pack Artifacts + run: mkdir -p ${{ env.BUILD_DIR }} && tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/openvino_package.tar.gz + working-directory: ${{ env.INSTALL_DIR }} + + - name: Build Python API(Python 3.9-3.13) + run: | + SUPPORTED_PYTHON_VERSIONS=("39" "310" "311" "312" "313") + for PY_VER in "${SUPPORTED_PYTHON_VERSIONS[@]}"; do + python_path=/opt/python/cp${PY_VER}-cp${PY_VER}/bin + docker run --rm \ + -v ${{ env.OPENVINO_REPO }}:/work/src \ + -v ${{ env.INSTALL_WHEELS_DIR }}:/work/wheels \ + -v ${{ env.PIP_CACHE_PATH }}:/work/pip_cache \ + -v ov_build_cache:/work/build \ + -e SCCACHE_AZURE_BLOB_CONTAINER \ + -e SCCACHE_AZURE_CONNECTION_STRING \ + -e SCCACHE_SERVER_PORT \ + -e SCCACHE_IGNORE_SERVER_IO_ERROR \ + -e SCCACHE_CACHE_SIZE \ + -e SCCACHE_AZURE_KEY_PREFIX \ + -e CMAKE_CXX_COMPILER_LAUNCHER \ + -e CMAKE_C_COMPILER_LAUNCHER \ + -w /work/src \ + ${{ fromJSON(needs.docker.outputs.images).ov_build.manylinux2014_x86_64 }} \ + /bin/bash -c " + export PATH=${python_path}:\$PATH + PIP_VER=$(python3 -c "import pip; print(pip.__version__)") + export "PIP_CACHE_DIR=/work/pip_cache/${PIP_VER}" + python3 -m pip install -r /work/src/src/bindings/python/wheel/requirements-dev.txt && + cmake -DOpenVINODeveloperPackage_DIR=/work/build -DENABLE_PYTHON=ON -DENABLE_WHEEL=ON -S /work/src/src/bindings/python -B /work/build_py${PY_VER} && + cmake --build /work/build_py${PY_VER} --parallel $(nproc) --target ie_wheel --config ${{ env.CMAKE_BUILD_TYPE }} && + cmake --install /work/build_py${PY_VER} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /work/wheels --component python_wheels + " + done + + # + # Upload build artifacts + # + - name: Upload openvino package + if: ${{ always() }} + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: openvino_package + path: ${{ env.BUILD_DIR }}/openvino_package.tar.gz + if-no-files-found: 'error' + + - name: Upload openvino wheels + if: ${{ always() }} + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: openvino_wheels + path: ${{ env.INSTALL_WHEELS_DIR }}/wheels/*.whl + if-no-files-found: 'error' \ No newline at end of file From a0940bbbf7a4bad9e9e337a0c17b30708ce1f064 Mon Sep 17 00:00:00 2001 From: Anastasia Kuporosova Date: Wed, 13 Nov 2024 14:22:06 +0100 Subject: [PATCH 09/28] [PyOV] Restrict changing data in const (#27431) ### Details: - Const op meant to be non-changeable ### Tickets: - CVS-124319 --- .../python/src/pyopenvino/core/common.cpp | 8 +- .../python/tests/test_graph/test_constant.py | 120 +----------------- 2 files changed, 12 insertions(+), 116 deletions(-) diff --git a/src/bindings/python/src/pyopenvino/core/common.cpp b/src/bindings/python/src/pyopenvino/core/common.cpp index a202c3a3801001..10ae0ed0ea6042 100644 --- a/src/bindings/python/src/pyopenvino/core/common.cpp +++ b/src/bindings/python/src/pyopenvino/core/common.cpp @@ -358,10 +358,14 @@ py::array array_from_constant_copy(ov::op::v0::Constant&& c, py::dtype& dst_dtyp py::array array_from_constant_view(ov::op::v0::Constant&& c) { const auto& ov_type = c.get_element_type(); const auto dtype = Common::type_helpers::get_dtype(ov_type); + py::array data; if (ov_type.bitwidth() < Common::values::min_bitwidth) { - return py::array(dtype, c.get_byte_size(), c.get_data_ptr(), py::cast(c)); + data = py::array(dtype, c.get_byte_size(), c.get_data_ptr(), py::cast(c)); + } else { + data = py::array(dtype, c.get_shape(), constant_helpers::_get_strides(c), c.get_data_ptr(), py::cast(c)); } - return py::array(dtype, c.get_shape(), constant_helpers::_get_strides(c), c.get_data_ptr(), py::cast(c)); + data.attr("flags").attr("writeable") = false; + return data; } }; // namespace array_helpers diff --git a/src/bindings/python/tests/test_graph/test_constant.py b/src/bindings/python/tests/test_graph/test_constant.py index 131654855b380a..7b349ad7cd94b1 100644 --- a/src/bindings/python/tests/test_graph/test_constant.py +++ b/src/bindings/python/tests/test_graph/test_constant.py @@ -205,53 +205,12 @@ def test_init_with_scalar(init_value, src_dtype, dst_dtype, shared_flag, data_ge assert np.allclose(const_data, expected_result) -@pytest.mark.parametrize( - ("src_dtype"), - [ - (np.float16), - (np.uint16), - ], -) -@pytest.mark.parametrize( - ("shared_flag"), - [ - (True), - (False), - ], -) -@pytest.mark.parametrize( - ("data_getter"), - [ - (DataGetter.COPY), - (DataGetter.VIEW), - ], -) -def test_init_bf16_populate(src_dtype, shared_flag, data_getter): - data = np.random.rand(1, 2, 16, 8) + 0.5 - data = data.astype(src_dtype) - - # To create bf16 constant, allocate memory and populate it: - init_data = np.zeros(shape=data.shape, dtype=src_dtype) - ov_const = ops.constant(init_data, dtype=Type.bf16, shared_memory=shared_flag) - ov_const.data[:] = data - - # Check shape and element type of Constant class - assert isinstance(ov_const, Constant) - assert np.all(list(ov_const.shape) == [1, 2, 16, 8]) - assert ov_const.get_element_type() == Type.bf16 - - _dst_dtype = Type.bf16.to_dtype() - - assert ov_const.get_element_type().to_dtype() == _dst_dtype - # Compare values to Constant - if data_getter == DataGetter.COPY: - const_data = ov_const.get_data() - elif data_getter == DataGetter.VIEW: - const_data = ov_const.data - else: - raise AttributeError("Unknown DataGetter passed!") - assert const_data.dtype == _dst_dtype - assert np.allclose(const_data, data) +def test_cant_change_data_in_const(): + arr_0 = np.ones([1, 3, 32, 32]) + ov_const = ops.constant(arr_0) + arr_1 = np.ones([1, 3, 32, 32]) + 1 + with pytest.raises(ValueError, match="assignment destination is read-only"): + ov_const.data[:] = arr_1 @pytest.mark.parametrize( @@ -286,58 +245,6 @@ def test_init_bf16_direct(ov_type, numpy_dtype, shared_flag): assert np.allclose(data, result, rtol=0.01) -@pytest.mark.parametrize( - "shape", - [ - ([1, 3, 28, 28]), - ([1, 3, 27, 27]), - ], -) -@pytest.mark.parametrize( - ("low", "high", "ov_type", "src_dtype"), - [ - (0, 2, Type.u1, np.uint8), - (0, 16, Type.u4, np.uint8), - (-8, 7, Type.i4, np.int8), - (0, 16, Type.nf4, np.uint8), - ], -) -@pytest.mark.parametrize( - ("shared_flag"), - [ - (True), - (False), - ], -) -@pytest.mark.parametrize( - ("data_getter"), - [ - (DataGetter.COPY), - (DataGetter.VIEW), - ], -) -def test_constant_helper_packing(shape, low, high, ov_type, src_dtype, shared_flag, data_getter): - data = np.random.uniform(low, high, shape).astype(src_dtype) - - # Allocate memory first: - ov_const = ops.constant(np.zeros(shape=data.shape, dtype=src_dtype), - dtype=ov_type, - shared_memory=shared_flag) - # Fill data with packed values - packed_data = pack_data(data, ov_const.get_element_type()) - ov_const.data[:] = packed_data - - # Always unpack the data! - if data_getter == DataGetter.COPY: - unpacked = unpack_data(ov_const.get_data(), ov_const.get_element_type(), ov_const.shape) - elif data_getter == DataGetter.VIEW: - unpacked = unpack_data(ov_const.data, ov_const.get_element_type(), ov_const.shape) - else: - raise AttributeError("Unknown DataGetter passed!") - - assert np.array_equal(unpacked, data) - - @pytest.mark.parametrize( ("ov_type", "src_dtype"), [ @@ -380,21 +287,6 @@ def test_constant_direct_packing(ov_type, src_dtype, shared_flag, data_getter): assert not np.shares_memory(unpacked, data) -@pytest.mark.parametrize( - ("shared_flag"), - [ - (True), - (False), - ], -) -def test_write_to_buffer(shared_flag): - arr_0 = np.ones([1, 3, 32, 32]) - ov_const = ops.constant(arr_0, shared_memory=shared_flag) - arr_1 = np.ones([1, 3, 32, 32]) + 1 - ov_const.data[:] = arr_1 - assert np.array_equal(ov_const.data, arr_1) - - @pytest.mark.parametrize( ("shared_flag"), [ From eb38e67be6e6992445e7f4f1ea8014422d015512 Mon Sep 17 00:00:00 2001 From: Andrzej Kopytko Date: Wed, 13 Nov 2024 15:02:22 +0100 Subject: [PATCH 10/28] [DOCS] Preselection and sorting (#27538) ### Details: - *item1* - *...* ### Tickets: - *ticket-id* --- docs/sphinx_setup/_static/html/modal.html | 3 - docs/sphinx_setup/_static/html/modalLLM.html | 3 - docs/sphinx_setup/_static/js/graphs.js | 76 +++++--------------- 3 files changed, 17 insertions(+), 65 deletions(-) diff --git a/docs/sphinx_setup/_static/html/modal.html b/docs/sphinx_setup/_static/html/modal.html index ac425599b821ce..38eb673824f97e 100644 --- a/docs/sphinx_setup/_static/html/modal.html +++ b/docs/sphinx_setup/_static/html/modal.html @@ -11,9 +11,6 @@

Configure Graphs

-
- Clear All -
diff --git a/docs/sphinx_setup/_static/html/modalLLM.html b/docs/sphinx_setup/_static/html/modalLLM.html index e3395a16931188..37b569d0bd4078 100644 --- a/docs/sphinx_setup/_static/html/modalLLM.html +++ b/docs/sphinx_setup/_static/html/modalLLM.html @@ -11,9 +11,6 @@

Configure Graphs

-
- Clear All -
diff --git a/docs/sphinx_setup/_static/js/graphs.js b/docs/sphinx_setup/_static/js/graphs.js index 168c1c348e7a08..7171aed374dd99 100644 --- a/docs/sphinx_setup/_static/js/graphs.js +++ b/docs/sphinx_setup/_static/js/graphs.js @@ -9,7 +9,6 @@ class Filter { .forEach(item => optionMap.set(item.Platform, item)); return Array.from(optionMap.values()); } - // param: GraphData[], ieType static ByIeTypes(graphDataArr, ieTypes) { const optionMap = new Map(); @@ -18,7 +17,6 @@ class Filter { .forEach(item => optionMap.set(item.Platform, item)); return Array.from(optionMap.values()); } - // param: GraphData[], ieType, networkModels static ByTypesAndModels(graphDataArr, ieTypes, models) { return Array.from( @@ -26,9 +24,8 @@ class Filter { .filter(({ PlatformType, Model }) => ieTypes.includes(PlatformType) && models.includes(Model)) .reduce((map, item) => map.set(item.Platform, item), new Map()) .values() - ).sort((a, b) => a.Platform.localeCompare(b.Platform)); + ); } - // param: GraphData[], clientPlatforms static ByIeKpis(graphDataArr, clientPlatforms) { return Array.from( @@ -40,7 +37,6 @@ class Filter { }, new Set()) ); } - // param: GraphData[] static getParameters(graphDataArr) { var parameters = [] @@ -51,7 +47,6 @@ class Filter { }) return parameters; } - // param: GraphData[] static getIeTypes(graphDataArr) { var kpis = [] @@ -62,21 +57,12 @@ class Filter { }) return kpis; } - // param: GraphData[], clientPlatforms[] static ByClientPlatforms(graphDataArr, platformsArr) { return graphDataArr.filter((data) => { return platformsArr.includes(data.Platform) }); } - - // param: GraphData[], coreTypes[] - static FilterByCoreTypes(graphDataArr, coreTypes) { - if (coreTypes) { - return graphDataArr.filter((data) => coreTypes.includes(data.PlatformType)); - } - return graphDataArr; - } } class Modal { @@ -114,15 +100,13 @@ class Graph { .sort((a, b) => a.localeCompare(b)); } static getIeTypes(graphDataArr) { - return Array.from(new Set(graphDataArr.map((obj) => obj.PlatformType))); - } - static getCoreTypes(graphDataArr) { - return Array.from(new Set(graphDataArr.map((obj) => obj.ieType))); + return Array.from(new Set(graphDataArr.map((obj) => obj.PlatformType))).sort((a, b) => a.localeCompare(b)); } // param: GraphData[] static getPlatformNames(graphDataArr) { - return graphDataArr.map((data) => data.Platform); + return graphDataArr.map((data) => data.Platform) + .sort((a, b) => a.localeCompare(b)); } // param: GraphData[], engine: string, precisions: list @@ -297,13 +281,13 @@ $(document).ready(function () { const models = networkModels.map((networkModel) => createCheckMark(networkModel, 'networkmodel')); modal.find('.models-column').append(models); - const selectAllModelsButton = createCheckMark('', 'networkmodel'); + const selectAllModelsButton = createCheckMark('', 'networkmodel', false , false); modal.find('.models-selectall').append(selectAllModelsButton); - const selectAllPlatformsButton = createCheckMark('', 'platform'); + const selectAllPlatformsButton = createCheckMark('', 'platform', false , false); modal.find('.platforms-selectall').append(selectAllPlatformsButton); - const precisions = Modal.getPrecisionsLabels(graph).map((precision) => createCheckMark(precision, 'precision', false)); + const precisions = Modal.getPrecisionsLabels(graph).map((precision) => createCheckMark(precision, 'precision', false , false)); modal.find('.precisions-column').append(precisions); selectAllCheckboxes(precisions); @@ -318,21 +302,17 @@ $(document).ready(function () { modal.find('#modal-display-graphs').hide(); modal.find('.ietype-column input').first().prop('checked', true); - const kpiLabels = Filter.getParameters(graph).map((parameter) => createCheckMark(parameter, 'kpi', false)); + const kpiLabels = Filter.getParameters(graph).map((parameter) => createCheckMark(parameter, 'kpi', false , true)); modal.find('.kpi-column').append(kpiLabels); $('body').prepend(modal); - preselectDefaultSettings(graph, modal, appConfig); - - //is not generic solution :( if (appConfig.DefaultSelections.platformTypes?.data?.includes('Select All')) { selectAllCheckboxes(iefilter); - }; + preselectDefaultSettings(graph, modal, appConfig); renderClientPlatforms(graph, modal); - $('.clear-all-btn').on('click', clearAll); $('#build-graphs-btn').on('click', () => { $('#modal-configure-graphs').hide(); clickBuildGraphs(graph, appConfig, getSelectedNetworkModels(), getSelectedIeTypes(), getSelectedClientPlatforms(), getSelectedKpis(), Modal.getPrecisions(appConfig, getSelectedPrecisions()), isLLM); @@ -409,19 +389,9 @@ $(document).ready(function () { precisions.prop('disabled', false); } - function clearAll() { - $('.modal-content-grid-container input:checkbox').each((index, object) => $(object).prop('checked', false)); - validatePrecisionSelection(); - validateSelections(); - } - function preselectDefaultSettings(graph, modal, appConfig) { - - const defaultSelections = appConfig.DefaultSelections; - selectDefaultPlatformType(defaultSelections.platformTypes, graph, modal); - applyPlatformFilters(defaultSelections.platformFilters, modal, graph); - clearAllSettings(defaultSelections); - + selectDefaultPlatformType(appConfig.DefaultSelections.platformTypes, graph, modal); + clearAllSettings(appConfig.DefaultSelections); validateSelections(); validatePrecisionSelection(); } @@ -431,17 +401,8 @@ $(document).ready(function () { $(`input[data-ietype="${type}"]`).prop('checked', true); renderClientPlatforms(graph, modal); } - function applyPlatformFilters(platformFilters, modal, graph) { - if (!platformFilters) return; - const filters = modal.find('.selectable-box-container').children('.selectable-box'); - filters.removeClass('selected'); - platformFilters.data.forEach(selection => { - filters.filter(`[data-${platformFilters.name}="${selection}"]`).addClass('selected'); - }); - renderClientPlatforms(graph, modal); - } + function clearAllSettings(defaultSelections) { - clearAll(); Object.keys(defaultSelections).forEach(setting => { const { name, data } = defaultSelections[setting]; data.forEach(selection => { @@ -463,7 +424,7 @@ $(document).ready(function () { var platformNames = Graph.getPlatformNames(fPlatforms); $('.platforms-column .checkmark-container').remove(); - const clientPlatforms = platformNames.map((platform) => createCheckMark(platform, 'platform', true)); + const clientPlatforms = platformNames.map((platform) => createCheckMark(platform, 'platform', true, false)); var enabledPlatforms = filterPlatforms(graph, getSelectedIeTypes(), getSelectedNetworkModels()); enableCheckBoxes(clientPlatforms, enabledPlatforms); @@ -471,6 +432,7 @@ $(document).ready(function () { enableParmeters(graph, getSelectedClientPlatforms()); modal.find('.platforms-column input').on('click', validateSelections); + validateSelections(); } function enableParmeters(graph, clientPlatforms) { @@ -486,11 +448,12 @@ $(document).ready(function () { }) } - function createCheckMark(itemLabel, modelLabel, disabled) { + function createCheckMark(itemLabel, modelLabel, disabled, checked = false) { const item = $('