OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[clean-up] Apply clang_format_fix_all on project (#28946)
Pawel Raaszb864e7f34aa7
diff --git a/src/bindings/python/src/pyopenvino/utils/utils.cpp b/src/bindings/python/src/pyopenvino/utils/utils.cppindex 818293bbed5..34e1e885e2d 100644--- a/src/bindings/python/src/pyopenvino/utils/utils.cpp+++ b/src/bindings/python/src/pyopenvino/utils/utils.cpp@@ -192,8 +192,7 @@ py::object from_ov_any(const ov::Any& any) {std::string property_name = it;auto mutability = it.get_mutability();std::string mutability_str;- switch (mutability)- {+ switch (mutability) {case ov::PropertyMutability::RW:mutability_str = "RW";break;diff --git a/src/common/transformations/include/transformations/low_precision/mark_dequantization_subgraph.hpp b/src/common/transformations/include/transformations/low_precision/mark_dequantization_subgraph.hppindex 3d28689f8ae..9fcacdcbb5b 100644--- a/src/common/transformations/include/transformations/low_precision/mark_dequantization_subgraph.hpp+++ b/src/common/transformations/include/transformations/low_precision/mark_dequantization_subgraph.hpp@@ -72,8 +72,8 @@ class TRANSFORMATIONS_API KeepConstPrecision : public ov::pass::MatcherPass {public:OPENVINO_MATCHER_PASS_RTTI("KeepConstPrecision");explicit KeepConstPrecision(const element::TypeVector& precisions,- bool fold_subtract_const = false,- bool fold_multiply_const = true);+ bool fold_subtract_const = false,+ bool fold_multiply_const = true);};} // namespace passdiff --git a/src/common/transformations/src/transformations/low_precision/mark_dequantization_subgraph.cpp b/src/common/transformations/src/transformations/low_precision/mark_dequantization_subgraph.cppindex ee2842115f9..b483d392d0b 100644--- a/src/common/transformations/src/transformations/low_precision/mark_dequantization_subgraph.cpp+++ b/src/common/transformations/src/transformations/low_precision/mark_dequantization_subgraph.cpp@@ -56,13 +56,13 @@ we cannot perform swapping as this would break another part of the graph.ZP Const│▼- Input Convert Input- │ │ │ │- ▼ ▼ ▼ ▼+ Input Convert Input+ │ │ │ │+ ▼ ▼ ▼ ▼Scale Convert Reshape Reshape Convert Scale| │ (64,1,1,1) (1,64,1,1) │ │| │ │ │ │ |- ▼ ▼ ▼ ▼ ▼ ▼+ ▼ ▼ ▼ ▼ ▼ ▼Reshape Subtract Subtract Reshape| | | |▼ ▼ ▼ ▼@@ -73,13 +73,13 @@ Though, we can perform swapping if the shapes are same for all branches: e.g.ZP Const│▼- Input Convert Input- │ │ │ │- ▼ ▼ ▼ ▼+ Input Convert Input+ │ │ │ │+ ▼ ▼ ▼ ▼Convert Reshape Reshape ConvertScale │ (64,1,1,1) (64,1,1,1) │ Scale| │ │ │ │ |- ▼ ▼ ▼ ▼ ▼ ▼+ ▼ ▼ ▼ ▼ ▼ ▼Reshape Subtract Subtract Reshape| | | |▼ ▼ ▼ ▼@@ -104,8 +104,8 @@ Scale Convert Convert InputSubtract Reshape| |▼ ▼- Multiply-+ Multiply+Step 2: the right part of the graph would be matched transforming the graph above into the final form:ZP Const@@ -150,17 +150,18 @@ bool can_swap(const PatternValueMap& pt_map,auto first_shape = target_inputs.begin()->get_node()->output(0).get_shape();// Step 1 (see steps description in the comments above)- if (std::all_of(std::next(target_inputs.begin()), target_inputs.end(),+ if (std::all_of(std::next(target_inputs.begin()),+ target_inputs.end(),[&](const ov::Input<ov::Node>& input) {return input.get_node()->get_output_partial_shape(0).is_static() &&input.get_node()->get_shape() == first_shape;})) {- return true;+ return true;} else if (first_node->get_output_partial_shape(0).is_static() &&second_node->get_output_partial_shape(0).is_static() &&first_node->get_output_shape(0) == second_node->get_output_shape(0)) {- // Step 2- return true;+ // Step 2+ return true;}}}diff --git a/src/common/transformations/tests/op_conversions/sdpa_to_paged_attention_test.cpp b/src/common/transformations/tests/op_conversions/sdpa_to_paged_attention_test.cppindex f3d3d699caf..78bf0a8d447 100644--- a/src/common/transformations/tests/op_conversions/sdpa_to_paged_attention_test.cpp+++ b/src/common/transformations/tests/op_conversions/sdpa_to_paged_attention_test.cpp@@ -922,20 +922,14 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {makeConst(element::f32,ov::Shape({1, 1, 8}),{1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f});- auto Constant_16155 = makeConst(element::f32,- ov::Shape({1, 1, 1}),- {1.000000f});- auto Constant_16153 = makeConst(element::f32,- ov::Shape({1, 1, 1}),- {2.000000f});+ auto Constant_16155 = makeConst(element::f32, ov::Shape({1, 1, 1}), {1.000000f});+ auto Constant_16153 = makeConst(element::f32, ov::Shape({1, 1, 1}), {2.000000f});auto __module_model_model_layers_0_input_layernorm_aten_pow_Power =makeOP<opset1::Power>({inputs_embeds, Constant_16153}, {{"auto_broadcast", "numpy"}});auto __module_model_model_layers_0_input_layernorm_aten_mean_ReduceMean =makeOP<opset1::ReduceMean>({__module_model_model_layers_0_input_layernorm_aten_pow_Power, {-1}},{{"keep_dims", true}});- auto Constant_16154 = makeConst(element::f32,- ov::Shape({1, 1, 1}),- {0.000001f});+ auto Constant_16154 = makeConst(element::f32, ov::Shape({1, 1, 1}), {0.000001f});auto __module_model_model_layers_0_input_layernorm_aten_add_Add =makeOP<opset1::Add>({__module_model_model_layers_0_input_layernorm_aten_mean_ReduceMean, Constant_16154},{{"auto_broadcast", "numpy"}});@@ -950,9 +944,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {auto __module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1 =makeOP<opset1::Multiply>({Constant_16156, __module_model_model_layers_0_input_layernorm_aten_mul_Multiply},{{"auto_broadcast", "numpy"}});- auto self_model_model_layers_0_self_attn_q_proj_weight = makeConst(element::f32,- ov::Shape({8, 8}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_q_proj_weight = makeConst(element::f32, ov::Shape({8, 8}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_q_proj_aten_linear_MatMul =makeOP<opset1::MatMul>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1,self_model_model_layers_0_self_attn_q_proj_weight},@@ -962,9 +954,8 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{{"special_zero", true}});auto __module_model_model_layers_0_self_attn_aten_transpose_Transpose =makeOP<opset1::Transpose>({__module_model_model_layers_0_self_attn_aten_view_Reshape, {0, 2, 1, 3}});- auto self_model_model_layers_0_self_attn_rotary_emb_cos_cached = makeConst(element::f32,- ov::Shape({32768, 2}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_rotary_emb_cos_cached =+ makeConst(element::f32, ov::Shape({32768, 2}), MOCK_VALUE);auto ShapeOf_16753 =makeOP<opset3::ShapeOf>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1},{{"output_type", "i64"}});@@ -1002,9 +993,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{{"auto_broadcast", "numpy"}});auto __module_model_model_layers_0_self_attn_aten_slice_Slice = makeOP<opset8::Slice>({__module_model_model_layers_0_self_attn_aten_transpose_Transpose, {1}, {LLONG_MAX}, {1}, {3}});- auto Constant_16157 = makeConst(element::f32,- ov::Shape({1, 1, 1, 1}),- {-1.000000f});+ auto Constant_16157 = makeConst(element::f32, ov::Shape({1, 1, 1, 1}), {-1.000000f});auto __module_model_model_layers_0_self_attn_aten_neg_Multiply =makeOP<opset1::Multiply>({__module_model_model_layers_0_self_attn_aten_slice_Slice, Constant_16157},{{"auto_broadcast", "numpy"}});@@ -1014,9 +1003,8 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {makeOP<opset1::Concat>({__module_model_model_layers_0_self_attn_aten_neg_Multiply,__module_model_model_layers_0_self_attn_aten_slice_Slice_1},{{"axis", -1}});- auto self_model_model_layers_0_self_attn_rotary_emb_sin_cached = makeConst(element::f32,- ov::Shape({32768, 2}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_rotary_emb_sin_cached =+ makeConst(element::f32, ov::Shape({32768, 2}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_rotary_emb_aten_slice_Slice_1 =makeOP<opset8::Slice>({self_model_model_layers_0_self_attn_rotary_emb_sin_cached,{0},@@ -1038,9 +1026,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {makeOP<opset1::Add>({__module_model_model_layers_0_self_attn_aten_mul_Multiply,__module_model_model_layers_0_self_attn_aten_mul_Multiply_1},{{"auto_broadcast", "numpy"}});- auto self_model_model_layers_0_self_attn_k_proj_weight = makeConst(element::f32,- ov::Shape({4, 8}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_k_proj_weight = makeConst(element::f32, ov::Shape({4, 8}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_k_proj_aten_linear_MatMul =makeOP<opset1::MatMul>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1,self_model_model_layers_0_self_attn_k_proj_weight},@@ -1056,9 +1042,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{{"auto_broadcast", "numpy"}});auto __module_model_model_layers_0_self_attn_aten_slice_Slice_2 = makeOP<opset8::Slice>({__module_model_model_layers_0_self_attn_aten_transpose_Transpose_1, {1}, {LLONG_MAX}, {1}, {3}});- auto Constant_16158 = makeConst(element::f32,- ov::Shape({1, 1, 1, 1}),- {-1.000000f});+ auto Constant_16158 = makeConst(element::f32, ov::Shape({1, 1, 1, 1}), {-1.000000f});auto __module_model_model_layers_0_self_attn_aten_neg_Multiply_1 =makeOP<opset1::Multiply>({__module_model_model_layers_0_self_attn_aten_slice_Slice_2, Constant_16158},{{"auto_broadcast", "numpy"}});@@ -1096,9 +1080,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{Broadcast_19607},{{"variable_id", "var3"}, {"variable_type", "f32"}, {"variable_shape", PartialShape{DYN, 2, DYN, 2}}});auto Gather_18649 = makeOP<opset8::Gather>({ReadValue_19122, beam_idx, 0}, {{"batch_dims", 0}});- auto self_model_model_layers_0_self_attn_v_proj_weight = makeConst(element::f32,- ov::Shape({4, 8}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_v_proj_weight = makeConst(element::f32, ov::Shape({4, 8}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_v_proj_aten_linear_MatMul =makeOP<opset1::MatMul>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1,self_model_model_layers_0_self_attn_v_proj_weight},@@ -1120,9 +1102,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {auto __module_model_model_layers_0_self_attn_aten_reshape_Reshape_1 =makeOP<opset1::Reshape>({__module_model_model_layers_0_self_attn_aten_expand_Broadcast_1, {0, 4, -1, 2}},{{"special_zero", true}});- auto Constant_16160 = makeConst(element::f32,- ov::Shape({1, 1, 1, 1}),- {1.000000f});+ auto Constant_16160 = makeConst(element::f32, ov::Shape({1, 1, 1, 1}), {1.000000f});auto __module_model_model_aten_unsqueeze_Unsqueeze = makeOP<opset1::Unsqueeze>({attention_mask, 1});auto __module_model_model_aten_unsqueeze_Unsqueeze_1 =makeOP<opset1::Unsqueeze>({__module_model_model_aten_unsqueeze_Unsqueeze, 2});@@ -1135,9 +1115,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{{"mode", "bidirectional"}});auto __module_model_model_aten_to_Convert_1 =makeOP<opset1::Convert>({__module_model_model_aten_expand_Broadcast}, {{"destination_type", "f32"}});- auto Constant_16159 = makeConst(element::f32,- ov::Shape({1, 1, 1, 1}),- {1.000000f});+ auto Constant_16159 = makeConst(element::f32, ov::Shape({1, 1, 1, 1}), {1.000000f});auto __module_model_model_aten_rsub_Multiply =makeOP<opset1::Multiply>({__module_model_model_aten_to_Convert_1, Constant_16159},{{"auto_broadcast", "numpy"}});@@ -1232,24 +1210,19 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {inputs_embeds,position_ids});- auto Constant_16156 = makeConst(element::f32,- ov::Shape({1, 1, 8}),- {1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f});- auto Constant_16155 = makeConst(element::f32,- ov::Shape({1, 1, 1}),- {1.000000f});- auto Constant_16153 = makeConst(element::f32,- ov::Shape({1, 1, 1}),- {2.000000f});+ auto Constant_16156 =+ makeConst(element::f32,+ ov::Shape({1, 1, 8}),+ {1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f});+ auto Constant_16155 = makeConst(element::f32, ov::Shape({1, 1, 1}), {1.000000f});+ auto Constant_16153 = makeConst(element::f32, ov::Shape({1, 1, 1}), {2.000000f});auto unsqueezed_inputs_embeds = makeOP<opset1::Unsqueeze>({inputs_embeds, 1});auto __module_model_model_layers_0_input_layernorm_aten_pow_Power =makeOP<opset1::Power>({unsqueezed_inputs_embeds, Constant_16153}, {{"auto_broadcast", "numpy"}});auto __module_model_model_layers_0_input_layernorm_aten_mean_ReduceMean =makeOP<opset1::ReduceMean>({__module_model_model_layers_0_input_layernorm_aten_pow_Power, {-1}},{{"keep_dims", true}});- auto Constant_16154 = makeConst(element::f32,- ov::Shape({1, 1, 1}),- {0.000001f});+ auto Constant_16154 = makeConst(element::f32, ov::Shape({1, 1, 1}), {0.000001f});auto __module_model_model_layers_0_input_layernorm_aten_add_Add =makeOP<opset1::Add>({__module_model_model_layers_0_input_layernorm_aten_mean_ReduceMean, Constant_16154},{{"auto_broadcast", "numpy"}});@@ -1258,15 +1231,13 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {auto __module_model_model_layers_0_input_layernorm_aten_rsqrt_Divide =makeOP<opset1::Divide>({Constant_16155, __module_model_model_layers_0_input_layernorm_aten_rsqrt_Sqrt},{{"auto_broadcast", "numpy"}, {"m_pythondiv", true}});- auto __module_model_model_layers_0_input_layernorm_aten_mul_Multiply =- makeOP<opset1::Multiply>({unsqueezed_inputs_embeds, __module_model_model_layers_0_input_layernorm_aten_rsqrt_Divide},- {{"auto_broadcast", "numpy"}});+ auto __module_model_model_layers_0_input_layernorm_aten_mul_Multiply = makeOP<opset1::Multiply>(+ {unsqueezed_inputs_embeds, __module_model_model_layers_0_input_layernorm_aten_rsqrt_Divide},+ {{"auto_broadcast", "numpy"}});auto __module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1 =makeOP<opset1::Multiply>({Constant_16156, __module_model_model_layers_0_input_layernorm_aten_mul_Multiply},{{"auto_broadcast", "numpy"}});- auto self_model_model_layers_0_self_attn_q_proj_weight = makeConst(element::f32,- ov::Shape({8, 8}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_q_proj_weight = makeConst(element::f32, ov::Shape({8, 8}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_q_proj_aten_linear_MatMul =makeOP<opset1::MatMul>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1,self_model_model_layers_0_self_attn_q_proj_weight},@@ -1276,9 +1247,8 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{{"special_zero", true}});auto __module_model_model_layers_0_self_attn_aten_transpose_Transpose =makeOP<opset1::Transpose>({__module_model_model_layers_0_self_attn_aten_view_Reshape, {0, 2, 1, 3}});- auto self_model_model_layers_0_self_attn_rotary_emb_cos_cached = makeConst(element::f32,- ov::Shape({32768, 2}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_rotary_emb_cos_cached =+ makeConst(element::f32, ov::Shape({32768, 2}), MOCK_VALUE);auto ShapeOf_16753 =makeOP<opset3::ShapeOf>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1},{{"output_type", "i64"}});@@ -1316,9 +1286,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{{"auto_broadcast", "numpy"}});auto __module_model_model_layers_0_self_attn_aten_slice_Slice = makeOP<opset8::Slice>({__module_model_model_layers_0_self_attn_aten_transpose_Transpose, {1}, {LLONG_MAX}, {1}, {3}});- auto Constant_16157 = makeConst(element::f32,- ov::Shape({1, 1, 1, 1}),- {-1.000000f});+ auto Constant_16157 = makeConst(element::f32, ov::Shape({1, 1, 1, 1}), {-1.000000f});auto __module_model_model_layers_0_self_attn_aten_neg_Multiply =makeOP<opset1::Multiply>({__module_model_model_layers_0_self_attn_aten_slice_Slice, Constant_16157},{{"auto_broadcast", "numpy"}});@@ -1328,9 +1296,8 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {makeOP<opset1::Concat>({__module_model_model_layers_0_self_attn_aten_neg_Multiply,__module_model_model_layers_0_self_attn_aten_slice_Slice_1},{{"axis", -1}});- auto self_model_model_layers_0_self_attn_rotary_emb_sin_cached = makeConst(element::f32,- ov::Shape({32768, 2}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_rotary_emb_sin_cached =+ makeConst(element::f32, ov::Shape({32768, 2}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_rotary_emb_aten_slice_Slice_1 =makeOP<opset8::Slice>({self_model_model_layers_0_self_attn_rotary_emb_sin_cached,{0},@@ -1355,9 +1322,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {auto Transpose_51951 =makeOP<opset1::Transpose>({__module_model_model_layers_0_self_attn_aten_add_Add, {0, 2, 1, 3}});auto Reshape_51953 = makeOP<opset1::Reshape>({Transpose_51951, {0, -1}}, {{"special_zero", true}});- auto self_model_model_layers_0_self_attn_k_proj_weight = makeConst(element::f32,- ov::Shape({4, 8}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_k_proj_weight = makeConst(element::f32, ov::Shape({4, 8}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_k_proj_aten_linear_MatMul =makeOP<opset1::MatMul>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1,self_model_model_layers_0_self_attn_k_proj_weight},@@ -1373,9 +1338,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {{{"auto_broadcast", "numpy"}});auto __module_model_model_layers_0_self_attn_aten_slice_Slice_2 = makeOP<opset8::Slice>({__module_model_model_layers_0_self_attn_aten_transpose_Transpose_1, {1}, {LLONG_MAX}, {1}, {3}});- auto Constant_16158 = makeConst(element::f32,- ov::Shape({1, 1, 1, 1}),- {-1.000000f});+ auto Constant_16158 = makeConst(element::f32, ov::Shape({1, 1, 1, 1}), {-1.000000f});auto __module_model_model_layers_0_self_attn_aten_neg_Multiply_1 =makeOP<opset1::Multiply>({__module_model_model_layers_0_self_attn_aten_slice_Slice_2, Constant_16158},{{"auto_broadcast", "numpy"}});@@ -1396,9 +1359,7 @@ TEST_P(SDPAToPATest, SDPAToPA_nanoLLaVA_General) {auto Transpose_51954 =makeOP<opset1::Transpose>({__module_model_model_layers_0_self_attn_aten_add_Add_1, {0, 2, 1, 3}});auto Reshape_51957 = makeOP<opset1::Reshape>({Transpose_51954, {0, -1}}, {{"special_zero", true}});- auto self_model_model_layers_0_self_attn_v_proj_weight = makeConst(element::f32,- ov::Shape({4, 8}),- MOCK_VALUE);+ auto self_model_model_layers_0_self_attn_v_proj_weight = makeConst(element::f32, ov::Shape({4, 8}), MOCK_VALUE);auto __module_model_model_layers_0_self_attn_v_proj_aten_linear_MatMul =makeOP<opset1::MatMul>({__module_model_model_layers_0_input_layernorm_aten_mul_Multiply_1,self_model_model_layers_0_self_attn_v_proj_weight},diff --git a/src/core/include/openvino/core/extension.hpp b/src/core/include/openvino/core/extension.hppindex ace5711b234..6fb59f2a3d1 100644--- a/src/core/include/openvino/core/extension.hpp+++ b/src/core/include/openvino/core/extension.hpp@@ -9,8 +9,8 @@#include <vector>#include "openvino/core/core_visibility.hpp"-#include "openvino/core/type.hpp"#include "openvino/core/rtti.hpp"+#include "openvino/core/type.hpp"#define OPENVINO_EXTENSION_C_API OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS#define OPENVINO_EXTENSION_API OPENVINO_CORE_EXPORTSdiff --git a/src/core/include/openvino/core/type.hpp b/src/core/include/openvino/core/type.hppindex 08dce031eed..d4cae6111fe 100644--- a/src/core/include/openvino/core/type.hpp+++ b/src/core/include/openvino/core/type.hpp@@ -79,7 +79,7 @@ std::ostream& operator<<(std::ostream& s, const DiscreteTypeInfo& info);namespace frontend {class ConversionExtensionBase;-} // frontend+} // namespace frontendtemplate <typename T>constexpr bool use_ov_dynamic_cast() {diff --git a/src/core/src/pattern/matcher.cpp b/src/core/src/pattern/matcher.cppindex c6962366d0a..747b5b456ae 100644--- a/src/core/src/pattern/matcher.cpp+++ b/src/core/src/pattern/matcher.cpp@@ -139,7 +139,8 @@ bool Matcher::match_permutation(const OutputVector& pattern_args, const OutputVei," (",args.at(i).get_node()->get_friendly_name(),- ") mismatch for pattern: ", pattern_args.at(i));+ ") mismatch for pattern: ",+ pattern_args.at(i));return false;}}diff --git a/src/frontends/onnx/frontend/src/core/graph.cpp b/src/frontends/onnx/frontend/src/core/graph.cppindex d827d225677..0f4c5f4d31b 100644--- a/src/frontends/onnx/frontend/src/core/graph.cpp+++ b/src/frontends/onnx/frontend/src/core/graph.cpp@@ -51,8 +51,7 @@ OperatorsBridge register_extensions(OperatorsBridge& bridge,[common_conv_ext](const ov::frontend::onnx::Node& node) -> ov::OutputVector {return common_conv_ext->get_converter()(ov::frontend::onnx::NodeContext(node));});- } else if (const auto onnx_conv_ext =- ov::as_type_ptr<ov::frontend::onnx::ConversionExtension>(extension)) {+ } else if (const auto onnx_conv_ext = ov::as_type_ptr<ov::frontend::onnx::ConversionExtension>(extension)) {bridge.overwrite_operator(onnx_conv_ext->get_op_type(),onnx_conv_ext->get_domain(),[onnx_conv_ext](const ov::frontend::onnx::Node& node) -> ov::OutputVector {diff --git a/src/frontends/tensorflow/src/frontend.cpp b/src/frontends/tensorflow/src/frontend.cppindex acf01621a35..3afaaadc6b5 100644--- a/src/frontends/tensorflow/src/frontend.cpp+++ b/src/frontends/tensorflow/src/frontend.cpp@@ -609,7 +609,8 @@ void FrontEnd::add_extension(const std::shared_ptr<ov::Extension>& extension) {}// Ignore other types of extensions in particular CreatorFunctionNamed which cannot be used with tensorflow// frontend- } else if (const auto& tensorflow_conv_ext = ov::as_type_ptr<ov::frontend::tensorflow::ConversionExtension>(extension)) {+ } else if (const auto& tensorflow_conv_ext =+ ov::as_type_ptr<ov::frontend::tensorflow::ConversionExtension>(extension)) {m_conversion_extensions.push_back(tensorflow_conv_ext);m_op_translators[tensorflow_conv_ext->get_op_type()] = tensorflow_conv_ext->get_converter();} else if (auto op_base_ext = std::dynamic_pointer_cast<ov::BaseOpExtension>(extension)) {diff --git a/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cpp b/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cppindex b4152d6a09c..935d000b373 100644--- a/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cpp+++ b/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cpp@@ -892,8 +892,7 @@ struct ConvertFrom4BitPrecision<std::tuple<src_t, dst_t>> {}};-#define INTEL_CPU_CVT_TO_4BIT_LIST \- INTEL_CPU_CVT(f32, nf4), INTEL_CPU_CVT(f16, nf4), INTEL_CPU_CVT(bf16, nf4)+#define INTEL_CPU_CVT_TO_4BIT_LIST INTEL_CPU_CVT(f32, nf4), INTEL_CPU_CVT(f16, nf4), INTEL_CPU_CVT(bf16, nf4)struct ConvertTo4BitContext {ov::element::Type_t outType;@@ -911,7 +910,7 @@ struct ConvertTo4BitPrecision<std::tuple<src_t, dst_t>> {void operator()(ConvertTo4BitContext& ctx) {auto insert_half_byte = [](uint8_t dst, uint8_t val, bool high_half) -> uint8_t {uint8_t shift = high_half ? 4 : 0;- return dst | (uint8_t) (val << shift);+ return dst | (uint8_t)(val << shift);};auto src = static_cast<const src_t*>(ctx.srcPtr);@@ -921,13 +920,14 @@ struct ConvertTo4BitPrecision<std::tuple<src_t, dst_t>> {auto has_tail = ctx.size % work_amount != 0;if (ctx.outType == ov::element::nf4) {parallel_for(work_amount, [&](size_t ib) {- size_t idx = ib*2;- const auto val = insert_half_byte(0, ConvertNF4::quantize(static_cast<float>(src[idx])), false);- dst[ib] = insert_half_byte(val, ConvertNF4::quantize(static_cast<float>(src[idx+1])), true);+ size_t idx = ib * 2;+ const auto val = insert_half_byte(0, ConvertNF4::quantize(static_cast<float>(src[idx])), false);+ dst[ib] = insert_half_byte(val, ConvertNF4::quantize(static_cast<float>(src[idx + 1])), true);});if (has_tail) {- dst[work_amount] = insert_half_byte(0, ConvertNF4::quantize(static_cast<float>(src[2*work_amount])), false);+ dst[work_amount] =+ insert_half_byte(0, ConvertNF4::quantize(static_cast<float>(src[2 * work_amount])), false);}} else {OPENVINO_THROW("cpu_convert doesn't support output data type: ", ctx.outType, ". Not implemented.");diff --git a/src/plugins/intel_cpu/src/nodes/gather.cpp b/src/plugins/intel_cpu/src/nodes/gather.cppindex c18f8f03c34..cef33881bac 100644--- a/src/plugins/intel_cpu/src/nodes/gather.cpp+++ b/src/plugins/intel_cpu/src/nodes/gather.cpp@@ -970,8 +970,7 @@ void Gather::resolveInPlaceEdges(Edge::LOOK look) {auto& config = selected_pd->getConfig();size_t inplaceInpIndx = selected_pd->getConfig().outConfs[outputPort].inPlace();const auto baseDim = inputShapes.front().getDims()[axis];- CPU_NODE_ASSERT(baseDim != Shape::UNDEFINED_DIM,- "can not use inPlace memory with splitting on dynamic dimention");+ CPU_NODE_ASSERT(baseDim != Shape::UNDEFINED_DIM, "can not use inPlace memory with splitting on dynamic dimention");auto baseMemBlock = getParentEdgeAt(inplaceInpIndx)->getMemory().getMemoryBlock();const auto index = constIndices.front();const ptrdiff_t offset = index < 0 ? baseDim + index : index;diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/executor_pa.cpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/executor_pa.cppindex 6817f7a00e8..aa3fcfa1bdc 100644--- a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/executor_pa.cpp+++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/executor_pa.cpp@@ -2369,7 +2369,7 @@ struct AttentionExecutor : public PagedAttentionExecutor {auto zero_tokens = _helper._block_size - block_offset;auto S = k_cache.m_dims[3];auto SV = v_cache.m_dims[3];- auto Hk = k_cache.m_dims[1]; // shape: [block, H, 32, S]+ auto Hk = k_cache.m_dims[1]; // shape: [block, H, 32, S]parallel_for2d(Hk, zero_tokens, [&](size_t h, size_t l) {std::memset(k_cache.ptr_v(block_number, h, block_offset + l, 0), 0, S * k_cache.m_element_size);std::memset(v_cache.ptr_v(block_number, h, block_offset + l, 0), 0, SV * v_cache.m_element_size);diff --git a/src/plugins/intel_cpu/src/nodes/memory.cpp b/src/plugins/intel_cpu/src/nodes/memory.cppindex 1f408be7d38..bc7efc97bcc 100644--- a/src/plugins/intel_cpu/src/nodes/memory.cpp+++ b/src/plugins/intel_cpu/src/nodes/memory.cpp@@ -786,8 +786,7 @@ void MemoryInput::runDynamic(dnnl::stream strm) {// depending on the memory sharing solution, we can return here if the memory is substituted from the// external graph or override the src pointer with the memory pointer pointing to the subgraph output// memory- CPU_NODE_ASSERT(subGraph->outputsNumber() == 1,- "has unexpected number of outputs");+ CPU_NODE_ASSERT(subGraph->outputsNumber() == 1, "has unexpected number of outputs");src = subGraph->getOutputNodeByIndex(0)->getSrcMemoryAtPort(0);// since the shape inference(InternalDynShapeInfer, do nothing) is performed, a memory of the extra childdiff --git a/src/plugins/intel_cpu/src/nodes/pooling.cpp b/src/plugins/intel_cpu/src/nodes/pooling.cppindex ae93655c340..e6685536b33 100644--- a/src/plugins/intel_cpu/src/nodes/pooling.cpp+++ b/src/plugins/intel_cpu/src/nodes/pooling.cpp@@ -157,10 +157,10 @@ bool Pooling::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, streturn false;}#if defined(OV_CPU_WITH_ACL)- if (ov::as_type_ptr<const ov::op::v8::MaxPool>(op) ||- ov::as_type_ptr<const ov::op::v14::MaxPool>(op)) {- if (ov::as_type_ptr<const ov::op::util::MaxPoolBase>(op)->get_kernel() != ov::Shape(2,2)) {- errorMessage = "Pooling indices returning source tensor coordinates is only supported for pool size 2x2";+ if (ov::as_type_ptr<const ov::op::v8::MaxPool>(op) || ov::as_type_ptr<const ov::op::v14::MaxPool>(op)) {+ if (ov::as_type_ptr<const ov::op::util::MaxPoolBase>(op)->get_kernel() != ov::Shape(2, 2)) {+ errorMessage =+ "Pooling indices returning source tensor coordinates is only supported for pool size 2x2";return false;}}diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cppindex 7675bc59662..67667d4794a 100644--- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp+++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp@@ -1120,16 +1120,16 @@ void Transformations::MainSnippets(void) {ov::is_type<ov::op::v0::Convert>(n) || ov::is_type<ov::op::v1::Divide>(n) ||ov::is_type<ov::op::v0::Elu>(n) || ov::is_type<ov::op::v0::Exp>(n) ||ov::is_type<ov::op::v1::Equal>(n) || ov::is_type<ov::op::v0::FakeQuantize>(n) ||- ov::is_type<ov::op::v0::Floor>(n) || ov::is_type<ov::op::v1::FloorMod>(n) ||- ov::is_type<ov::op::v0::Gelu>(n) || ov::is_type<ov::op::v7::Gelu>(n) ||- ov::is_type<ov::op::v1::Greater>(n) || ov::is_type<ov::op::v1::GreaterEqual>(n) ||- ov::is_type<ov::op::v4::HSwish>(n) || ov::is_type<ov::op::v1::LessEqual>(n) ||- ov::is_type<ov::op::v1::Maximum>(n) || ov::is_type<ov::op::v1::Minimum>(n) ||- ov::is_type<ov::op::v4::Mish>(n) || ov::is_type<ov::op::v1::Mod>(n) ||- ov::is_type<ov::op::v1::Multiply>(n) || ov::is_type<ov::op::v0::PRelu>(n) ||- ov::is_type<ov::op::v0::Relu>(n) || ov::is_type<ov::op::v5::Round>(n) ||- ov::is_type<ov::op::v0::Sigmoid>(n) || ov::is_type<ov::op::v0::Sqrt>(n) ||- ov::is_type<ov::op::v1::Subtract>(n) || ov::is_type<ov::op::v4::Swish>(n) ||+ ov::is_type<ov::op::v0::Floor>(n) || ov::is_type<ov::op::v1::FloorMod>(n) ||+ ov::is_type<ov::op::v0::Gelu>(n) || ov::is_type<ov::op::v7::Gelu>(n) ||+ ov::is_type<ov::op::v1::Greater>(n) || ov::is_type<ov::op::v1::GreaterEqual>(n) ||+ ov::is_type<ov::op::v4::HSwish>(n) || ov::is_type<ov::op::v1::LessEqual>(n) ||+ ov::is_type<ov::op::v1::Maximum>(n) || ov::is_type<ov::op::v1::Minimum>(n) ||+ ov::is_type<ov::op::v4::Mish>(n) || ov::is_type<ov::op::v1::Mod>(n) ||+ ov::is_type<ov::op::v1::Multiply>(n) || ov::is_type<ov::op::v0::PRelu>(n) ||+ ov::is_type<ov::op::v0::Relu>(n) || ov::is_type<ov::op::v5::Round>(n) ||+ ov::is_type<ov::op::v0::Sigmoid>(n) || ov::is_type<ov::op::v0::Sqrt>(n) ||+ ov::is_type<ov::op::v1::Subtract>(n) || ov::is_type<ov::op::v4::Swish>(n) ||ov::is_type<ov::op::v0::Tanh>(n));#else// CPU Plugin support Swish in Subgraph via conversion to SwichCPU which assumes second input to be constant,diff --git a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cppindex 8c5873e9ce2..23938b7974d 100644--- a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp+++ b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp@@ -864,7 +864,7 @@ std::string ov::npuw::CompiledModel::funcall_mem_device(const std::size_t idx) cvoid ov::npuw::CompiledModel::remove_long_output_names(const std::shared_ptr<ov::Model>& model) {NPUW_ASSERT(model.get() != nullptr);for (auto node : model->get_ordered_ops()) {- for (auto &&output : node->outputs()) {+ for (auto&& output : node->outputs()) {const auto& tensor_names = output.get_tensor().get_names();if (tensor_names.size() > 32) {LOG_VERB(model->get_friendly_name() << " output " << output << " exceeds the name limit, removing...");diff --git a/src/plugins/intel_npu/src/plugin/npuw/just_sync_infer_request.cpp b/src/plugins/intel_npu/src/plugin/npuw/just_sync_infer_request.cppindex 6f524b0cf75..ed2ecce8e7f 100644--- a/src/plugins/intel_npu/src/plugin/npuw/just_sync_infer_request.cpp+++ b/src/plugins/intel_npu/src/plugin/npuw/just_sync_infer_request.cpp@@ -733,9 +733,8 @@ void ov::npuw::JustInferRequest::unsafe_infer(std::size_t real_idx) {// Collect spatial inputs for this offsetfor (auto&& param : spatial.params) {const auto& iport = comp_model_desc.compiled_model->inputs()[param.idx];- const auto& iview = ov::npuw::util::view(m_spatial_io[real_idx].inputs.at(param.idx),- param.dim, offset,- spatial.nway);+ const auto& iview =+ ov::npuw::util::view(m_spatial_io[real_idx].inputs.at(param.idx), param.dim, offset, spatial.nway);r->set_tensor(iport, iview);} // for(params)diff --git a/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cpp b/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cppindex c028c4d7eb2..49c1d572122 100644--- a/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cpp+++ b/src/plugins/intel_npu/src/plugin/npuw/llm_compiled_model.cpp@@ -30,10 +30,10 @@ public:protected:// generic part of matchers, to transpose v-tensors, and concat, and update matmul argsvoid transpose_matmul_b(Context::Ref ctx,- std::shared_ptr<ov::Node> node_param,- std::shared_ptr<ov::Node> node_concat,- std::shared_ptr<ov::Node> node_transpose,- std::shared_ptr<ov::Node> node_matmul) {+ std::shared_ptr<ov::Node> node_param,+ std::shared_ptr<ov::Node> node_concat,+ std::shared_ptr<ov::Node> node_transpose,+ std::shared_ptr<ov::Node> node_matmul) {auto matched_param = std::static_pointer_cast<ov::op::v0::Parameter>(node_param);auto matched_concat = std::static_pointer_cast<ov::op::v0::Concat>(node_concat);auto matched_transpose = std::static_pointer_cast<ov::op::v1::Transpose>(node_transpose);@@ -92,7 +92,11 @@ private:auto matched_node_transpose = node_to_output.at(transpose).get_node_shared_ptr();auto matched_node_matmul = node_to_output.at(matmul).get_node_shared_ptr();- transpose_matmul_b(ctx, matched_node_param, matched_node_concat, matched_node_transpose, matched_node_matmul);+ transpose_matmul_b(ctx,+ matched_node_param,+ matched_node_concat,+ matched_node_transpose,+ matched_node_matmul);LOG_DEBUG("vtensors transposed: LLama2 pattern");return true;};@@ -126,10 +130,10 @@ private:auto callback = [=](ov::pass::pattern::Matcher& m) {auto& node_to_output = m.get_pattern_value_map();- auto matched_node_param = node_to_output.at(param).get_node_shared_ptr();- auto matched_node_concat = node_to_output.at(concat).get_node_shared_ptr();+ auto matched_node_param = node_to_output.at(param).get_node_shared_ptr();+ auto matched_node_concat = node_to_output.at(concat).get_node_shared_ptr();auto matched_node_transpose = node_to_output.at(transpose).get_node_shared_ptr();- auto matched_node_matmul = node_to_output.at(matmul).get_node_shared_ptr();+ auto matched_node_matmul = node_to_output.at(matmul).get_node_shared_ptr();auto matched_node_unsqueeze = node_to_output.at(unsqueeze).get_node_shared_ptr();auto matched_node_unsqueeze_axes = node_to_output.at(unsqueeze_axes).get_node_shared_ptr();auto matched_node_broadcast = node_to_output.at(broadcast).get_node_shared_ptr();@@ -140,17 +144,19 @@ private:auto matched_transpose = std::static_pointer_cast<ov::op::v1::Transpose>(matched_node_transpose);auto matched_matmul = std::static_pointer_cast<ov::op::v0::MatMul>(matched_node_matmul);- auto matched_unsqueeze = std::static_pointer_cast<ov::op::v0::Unsqueeze>(matched_node_unsqueeze);- auto matched_broadcast = std::static_pointer_cast<ov::op::v3::Broadcast>(matched_node_broadcast);- auto matched_reshape = std::static_pointer_cast<ov::op::v1::Reshape>(matched_node_reshape);+ auto matched_unsqueeze = std::static_pointer_cast<ov::op::v0::Unsqueeze>(matched_node_unsqueeze);+ auto matched_broadcast = std::static_pointer_cast<ov::op::v3::Broadcast>(matched_node_broadcast);+ auto matched_reshape = std::static_pointer_cast<ov::op::v1::Reshape>(matched_node_reshape);auto shape_broadcast = matched_broadcast->get_output_shape(0);OPENVINO_ASSERT(shape_broadcast.size() == 5u);std::swap(shape_broadcast[3], shape_broadcast[4]);- LOG_DEBUG("shape_broadcast for: "<< matched_broadcast->get_friendly_name() <<", shape=" << shape_broadcast);+ LOG_DEBUG("shape_broadcast for: " << matched_broadcast->get_friendly_name()+ << ", shape=" << shape_broadcast);- const auto broadcast_axes_node = std::make_shared<ov::op::v0::Constant>(ov::element::i32, ov::Shape{5}, shape_broadcast);+ const auto broadcast_axes_node =+ std::make_shared<ov::op::v0::Constant>(ov::element::i32, ov::Shape{5}, shape_broadcast);broadcast_axes_node->set_friendly_name(matched_broadcast->get_friendly_name() + "/new_broadcast_shape");matched_broadcast->input(1).replace_source_output(broadcast_axes_node);@@ -158,9 +164,10 @@ private:OPENVINO_ASSERT(shape_reshape.size() == 4u);std::swap(shape_reshape[2], shape_reshape[3]);- LOG_DEBUG("shape_reshape for: "<< matched_reshape->get_friendly_name() <<", shape=" << shape_reshape);+ LOG_DEBUG("shape_reshape for: " << matched_reshape->get_friendly_name() << ", shape=" << shape_reshape);- const auto reshape_axes_node = std::make_shared<ov::op::v0::Constant>(ov::element::i32, ov::Shape{4}, shape_reshape);+ const auto reshape_axes_node =+ std::make_shared<ov::op::v0::Constant>(ov::element::i32, ov::Shape{4}, shape_reshape);reshape_axes_node->set_friendly_name(matched_reshape->get_friendly_name() + "/new_reshape_shape");matched_reshape->input(1).replace_source_output(reshape_axes_node);diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cppindex 4abda6b3fa0..80b10efd57a 100644--- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cpp+++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/partitioning.cpp@@ -1188,10 +1188,12 @@ void Partitioner::saveTinyConstants(const std::string& func_name) {auto total =std::accumulate(shape.begin(), shape.end(), std::size_t{1}, std::multiplies<std::size_t>());if ((shape.size() == 0 || (shape.size() == 1 && shape[0] <= 10)) || (total <= 10)) {- LOG_DEBUG("[KEEP] " << node->get_friendly_name() << "/" << shape << ": It is safe to keep this bank in function");+ LOG_DEBUG("[KEEP] " << node->get_friendly_name() << "/" << shape+ << ": It is safe to keep this bank in function");func_group.consts_to_keep.insert(std::static_pointer_cast<CT>(node));} else {- LOG_DEBUG("[CUT ] " << node->get_friendly_name() << "/" << shape << ": This const op will be cut-off from the function");+ LOG_DEBUG("[CUT ] " << node->get_friendly_name() << "/" << shape+ << ": This const op will be cut-off from the function");}}}@@ -1326,7 +1328,8 @@ void Partitioner::saveRepeatedConstants(const std::string& func_name) {func_group.consts_to_keep.insert(const_node);}} else {- LOG_DEBUG("[CUT ] This group of Const ops will be cut-off from the function: " << proto_node->get_friendly_name());+ LOG_DEBUG("[CUT ] This group of Const ops will be cut-off from the function: "+ << proto_node->get_friendly_name());}};for (auto&& bank : rep_block.consts) {diff --git a/src/plugins/intel_npu/src/plugin/npuw/util.cpp b/src/plugins/intel_npu/src/plugin/npuw/util.cppindex f773ed8f8bb..322525421a5 100644--- a/src/plugins/intel_npu/src/plugin/npuw/util.cpp+++ b/src/plugins/intel_npu/src/plugin/npuw/util.cpp@@ -371,7 +371,9 @@ ov::SoPtr<ov::ITensor> ov::npuw::util::view(const ov::SoPtr<ov::ITensor>& src,// Check if a tensor view can be faked as "continuous"// FIXME: This trick should be removed after strided tensor// checks are relaxed- if (std::all_of(shape.begin(), shape.begin() + dim, [](std::size_t d) { return d == 1u; })) {+ if (std::all_of(shape.begin(), shape.begin() + dim, [](std::size_t d) {+ return d == 1u;+ })) {// If all dimensions up to the sub-ranged dimension are 1s,// This tensor can be faked as continuousconst auto type = src->get_element_type();