Skip to content

Commit

Permalink
Merge branch 'master' into nashez/napi_tensor_continuous
Browse files Browse the repository at this point in the history
  • Loading branch information
vishniakov-nikolai authored Dec 27, 2024
2 parents b11e0e9 + c14134a commit 79e09a5
Show file tree
Hide file tree
Showing 47 changed files with 122 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ ov::pass::PositionIDsReplacerQwen::PositionIDsReplacerQwen(const Output<Node>& p
auto p_opt_convert = optional<v0::Convert>(p_max_context_len);
auto p_opt_reshape = optional<v1::Reshape>({p_opt_convert, any_input()});

// current seg len
auto p_input_ids = wrap_type<v0::Parameter>();
auto p_unsqueeze = wrap_type<v0::Unsqueeze>({p_input_ids, _const()});
auto p_shape_of = wrap_type<v3::ShapeOf>({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<v3::ShapeOf>({any_input()});
auto p_current_len = wrap_type<v8::Gather>({p_shape_of, _const(), _const()});

auto p_rotary_emb_sincos = wrap_type<v0::Constant>();
auto p_neg_const = wrap_type<v0::Constant>();
auto p_neg_mul = wrap_type<v1::Multiply>({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<v0::Constant>();
auto p_slice_1 = wrap_type<v8::Slice>({p_rotary_emb_sincos, _const(), p_opt_reshape, _const(), _const()});
auto p_slice_2 = wrap_type<v8::Slice>({p_slice_1, p_neg_mul, _const(), _const(), _const()});

Expand Down
4 changes: 2 additions & 2 deletions src/inference/src/os/lin/lin_system_conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions tests/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_and.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_argmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_ceil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_cumsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_dequantize_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_elu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_embedding_bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

import torch
import torch.nn as nn
from common.layer_test_class import CommonLayerTest, check_ir_version
Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_floor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_hard_sigmoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_leaky_relu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_logsoftmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_lrn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_neg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_non_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_not.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_or.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_prelu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_reduce_lp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_relu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model

Expand Down
2 changes: 2 additions & 0 deletions tests/layer_tests/onnx_tests/test_roi_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import numpy as np
import pytest
pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136")

from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model
from unit_tests.utils.graph import build_graph
Expand Down
Loading

0 comments on commit 79e09a5

Please sign in to comment.