Skip to content

Commit

Permalink
[CPU] ONNX Unique tests failing on CPU (#18100)
Browse files Browse the repository at this point in the history
* [CPU] ONNX Unique tests failing on CPU

* Fixes as per comments.
  • Loading branch information
nshchego authored Jul 5, 2023
1 parent fb676a9 commit 886fd0d
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 162 deletions.
2 changes: 0 additions & 2 deletions src/bindings/python/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ def xfail_test(reason="Mark the test as expected to fail", strict=True):
"MaxUnpool")
skip_issue_38084 = pytest.mark.skip(reason="Aborted (core dumped) Assertion "
"`(layer->get_output_partial_shape(i).is_static())' failed.")
xfail_issue_33595 = xfail_test(reason="RuntimeError: OV does not support the following ONNX operations: "
"Unique")
xfail_issue_33596 = xfail_test(reason="RuntimeError: OV does not support different sequence operations: "
"ConcatFromSequence, SequenceConstruct, SequenceAt, SplitToSequence, "
"SequenceEmpty, SequenceInsert, SequenceErase, SequenceLength ")
Expand Down
6 changes: 0 additions & 6 deletions src/bindings/python/tests/test_onnx/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
skip_rng_tests,
xfail_issue_33488,
xfail_issue_33581,
xfail_issue_33595,
xfail_issue_33596,
xfail_issue_33606,
xfail_issue_33651,
Expand Down Expand Up @@ -195,11 +194,6 @@ def expect_fail(test_case_path, xfail): # type: (str) -> None
"OnnxBackendNodeModelTest.test_castlike_STRING_to_FLOAT_cpu",
"OnnxBackendNodeModelTest.test_castlike_STRING_to_FLOAT_expanded_cpu",
),
(
xfail_issue_33595,
"OnnxBackendNodeModelTest.test_unique_sorted_with_negative_axis_cpu",
"OnnxBackendNodeModelTest.test_unique_sorted_with_axis_3d_cpu",
),
(
xfail_issue_33651,
"OnnxBackendNodeModelTest.test_tfidfvectorizer_tf_batch_onlybigrams_skip5_cpu",
Expand Down
17 changes: 17 additions & 0 deletions src/plugins/intel_cpu/src/nodes/common/cpu_memcpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <cstring>
#include "ie_api.h"
#include <ie_parallel.hpp>
#include <onednn/dnnl.h>

namespace ov {
namespace intel_cpu {
Expand Down Expand Up @@ -51,5 +53,20 @@ inline int cpu_memcpy_s(void* dst, size_t dst_size, const void* src, size_t coun
return 0;
}

inline void cpu_parallel_memcpy(void* dst, const void* src, size_t count) {
const size_t l2_cache_size = dnnl::utils::get_cache_size(2, true);
if (count >= l2_cache_size) {
auto src_int8 = static_cast<const uint8_t *>(src);
auto dst_int8 = static_cast<uint8_t *>(dst);
parallel_nt(0, [&](const size_t ithr, const size_t nthr) {
size_t start = 0, end = 0;
splitter(count, nthr, ithr, start, end);
cpu_memcpy(dst_int8 + start, src_int8 + start, end - start);
});
} else {
cpu_memcpy(dst, src, count);
}
}

} // namespace intel_cpu
} // namespace ov
Loading

0 comments on commit 886fd0d

Please sign in to comment.