From 25c602597388a91e94ab02dd34a8e1a98ce2a067 Mon Sep 17 00:00:00 2001 From: Wanglei Shen Date: Thu, 26 Dec 2024 14:10:05 +0800 Subject: [PATCH 1/4] fix coverity scan issue CID 1529754 (#28195) ### Details: - *item1* CID 1529754: (#1 of 1): COPY_INSTEAD_OF_MOVE (COPY_INSTEAD_OF_MOVE) 1. copy_constructor_call: node_info_table is passed-by-value as parameter to parse_freq_info_linux when it could be moved instead. Use std::move(node_info_table) instead of node_info_table. 221 node_info_table, 222 _processors, 223 _numa_nodes, 224 _sockets, 225 _cores, 226 _proc_type_table, 227 _cpu_mapping_table); ### Tickets: - *ticket-id* --- src/inference/src/os/lin/lin_system_conf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inference/src/os/lin/lin_system_conf.cpp b/src/inference/src/os/lin/lin_system_conf.cpp index bb9a107c5b424d..29c8bfddbd1ca4 100644 --- a/src/inference/src/os/lin/lin_system_conf.cpp +++ b/src/inference/src/os/lin/lin_system_conf.cpp @@ -237,7 +237,7 @@ CPU::CPU() { if (!get_info_linux(cache_info_mode)) { parse_cache_info_linux(system_info_table, - node_info_table, + std::move(node_info_table), _processors, _numa_nodes, _sockets, @@ -251,7 +251,7 @@ CPU::CPU() { (_proc_type_table[0][ALL_PROC] != _proc_type_table[0][EFFICIENT_CORE_PROC]))) { if (!get_info_linux(freq_info_mode)) { parse_freq_info_linux(system_info_table, - node_info_table, + std::move(node_info_table), _processors, _numa_nodes, _sockets, From e8ae56ee1d96b618a50a0d97b696f82ed9dbf601 Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Thu, 26 Dec 2024 10:33:06 +0400 Subject: [PATCH 2/4] [JAX FE] Remove jax reqs from common requirements file (#28206) **Details:** We no longer need jax reqs in common requirements files after separation into requirements_jax **Ticket:** TBD Signed-off-by: Kazantsev, Roman --- tests/constraints.txt | 3 --- tests/layer_tests/requirements.txt | 2 -- 2 files changed, 5 deletions(-) diff --git a/tests/constraints.txt b/tests/constraints.txt index 4f46cd0cc8b2e9..c339ac3c65d56f 100644 --- a/tests/constraints.txt +++ b/tests/constraints.txt @@ -21,11 +21,8 @@ pytest>=5.0,<8.4 pytest-dependency==0.5.1 pytest-html==4.1.1 pytest-timeout==2.3.1 -jax<=0.4.36 -jaxlib<=0.4.36 kornia==0.7.0 networkx<=3.3 -flax<=0.10.2 --extra-index-url https://download.pytorch.org/whl/cpu torch~=2.5.1; platform_system != "Darwin" or platform_machine != "x86_64" diff --git a/tests/layer_tests/requirements.txt b/tests/layer_tests/requirements.txt index 04889ebce10a39..2ba12cc5e2bece 100644 --- a/tests/layer_tests/requirements.txt +++ b/tests/layer_tests/requirements.txt @@ -16,5 +16,3 @@ pytest defusedxml tensorflow tensorflow-addons; python_version <= '3.10' -jax; sys_platform == "linux" and platform_machine == "x86_64" # https://jax.readthedocs.io/en/latest/installation.html#pip-installation-cpu - wheels are for "x86_64" only -jaxlib; sys_platform == "linux" and platform_machine == "x86_64" # https://jax.readthedocs.io/en/latest/installation.html#pip-installation-cpu - wheels are for "x86_64" only From df75d0ca133e5885ae64f4a9afaec8a300468d82 Mon Sep 17 00:00:00 2001 From: Ivan Tikhonov Date: Thu, 26 Dec 2024 10:58:39 +0330 Subject: [PATCH 3/4] Fix PositionIdsReplacer for Qwen (#28203) ### Details: The "current len" pattern might be created in 2 different ways in the Qwen model. After one of the comments in the review (https://github.com/openvinotoolkit/openvino/pull/28067/files) was resolved, we made the pattern stricter, it stopped covering one of the cases. ### Tickets: - *CVS-157308* --- .../position_ids_replacer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/transformations/src/transformations/sdpa_to_paged_attention/position_ids_replacer.cpp b/src/common/transformations/src/transformations/sdpa_to_paged_attention/position_ids_replacer.cpp index 1cc9be37606950..397746c75bb84d 100644 --- a/src/common/transformations/src/transformations/sdpa_to_paged_attention/position_ids_replacer.cpp +++ b/src/common/transformations/src/transformations/sdpa_to_paged_attention/position_ids_replacer.cpp @@ -61,16 +61,19 @@ ov::pass::PositionIDsReplacerQwen::PositionIDsReplacerQwen(const Output& p auto p_opt_convert = optional(p_max_context_len); auto p_opt_reshape = optional({p_opt_convert, any_input()}); - // current seg len - auto p_input_ids = wrap_type(); - auto p_unsqueeze = wrap_type({p_input_ids, _const()}); - auto p_shape_of = wrap_type({p_unsqueeze}); + // current seq len: + // it might be present in 2 different ways: + // input_ids -> unsqueeze -> reshape -> convert -> shape_of -> gather + // QKV -> variadic_split(Q or K) -> rope Q/K -> shape_of -> gather + // Probably we can use the symbols to re-use one of these ways. + // Currently, "any_input" is used to detect the both places. + auto p_shape_of = wrap_type({any_input()}); auto p_current_len = wrap_type({p_shape_of, _const(), _const()}); - auto p_rotary_emb_sincos = wrap_type(); auto p_neg_const = wrap_type(); auto p_neg_mul = wrap_type({p_current_len, p_neg_const}); // the rotary_emb_cos/rotary_emb_sin are sliced by the total length [1,..4096,1,128] + auto p_rotary_emb_sincos = wrap_type(); auto p_slice_1 = wrap_type({p_rotary_emb_sincos, _const(), p_opt_reshape, _const(), _const()}); auto p_slice_2 = wrap_type({p_slice_1, p_neg_mul, _const(), _const(), _const()}); From 1ec91fc6b64def702aa42c3271ba6f97bb6ef22e Mon Sep 17 00:00:00 2001 From: Pavel Durandin Date: Thu, 26 Dec 2024 12:54:03 +0400 Subject: [PATCH 4/4] [GPU] Fix oob in reorder for BMG (#28200) ### Details: - Fix for border_gpu.zyx_bsv16fsv16 case - case when x size less than tile size was not handled --- .../reorder_data_bfyx_to_blocked_format.cl | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_data_bfyx_to_blocked_format.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_data_bfyx_to_blocked_format.cl index 45d0ccc5c0933e..2f403b798dea39 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_data_bfyx_to_blocked_format.cl +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_data_bfyx_to_blocked_format.cl @@ -26,6 +26,18 @@ } \ } +#define FUNC_LOAD_LEFTOVERS(inner, outer) unroll_for (uint lh = 0; lh < outer; ++lh) { \ + const uint input_idx = INPUT0_GET_TILED_INDEX(INPUT0_TILED_ORDER); \ + INPUTVTYPE read_data; \ + unroll_for (uint lw = 0; lw < inner; ++lw) { \ + read_data[lw] = input[input_idx + lw]; \ + } \ + unroll_for (uint lw = 0; lw < inner; ++lw) { \ + const uint dst = local_buf_offset + lw; \ + transpose_buf[dst][lh] = read_data[lw]; \ + } \ + } + #define FUNC_VSTORE(loop) unroll_for (uint lw = 0; lw < loop; ++lw) { \ const uint output_idx = output_idx_tile + (lw * x_pitch); \ VSTORE(TO_OUTPUTVTYPE(transpose_buf[local_buf_offset + lw]), 0, output + output_idx); \ @@ -109,7 +121,15 @@ KERNEL (reorder_data_bfyx_to_blocked_format)( if (F_NO_REMAINDER_CONDITION) { // read and transpose +#ifdef X_REMAINDER_CONDITION + if (X_NO_REMAINDER_CONDITION) { + FUNC_VLOAD(TILE_SIZE, TILE_SIZE) + } else { + FUNC_LOAD_LEFTOVERS(X_REMAINDER_SIZE, TILE_SIZE) + } +#else FUNC_VLOAD(TILE_SIZE, TILE_SIZE) +#endif // write to ddr #ifdef X_REMAINDER_CONDITION @@ -125,7 +145,15 @@ KERNEL (reorder_data_bfyx_to_blocked_format)( #ifdef F_REMAINDER_CONDITION else if (F_REMAINDER_CONDITION) { // read and transpose + #ifdef X_REMAINDER_CONDITION + if (X_NO_REMAINDER_CONDITION) { + FUNC_VLOAD(TILE_SIZE, F_REMAINDER_SIZE) + } else { + FUNC_LOAD_LEFTOVERS(X_REMAINDER_SIZE, F_REMAINDER_SIZE) + } + #else FUNC_VLOAD(TILE_SIZE, F_REMAINDER_SIZE) + #endif // write to ddr #ifdef X_REMAINDER_CONDITION