Skip to content

Commit

Permalink
Merge branch 'master' into an/fp16_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
allnes authored Oct 16, 2023
2 parents 0392ffe + 475ddb9 commit ef21fa5
Show file tree
Hide file tree
Showing 51 changed files with 571 additions and 464 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ jobs:
# For running Paddle frontend unit tests
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/paddle/tests/requirements.txt
# see https://github.com/PaddlePaddle/Paddle/issues/55597#issuecomment-1718131420
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
apt-get install ./libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
#
# Build
Expand Down
4 changes: 3 additions & 1 deletion cmake/developer_package/add_target_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ function(ov_add_test_target)
else()
add_test(NAME ${ARG_NAME} COMMAND ${ARG_NAME})
endif()
set_property(TEST ${ARG_NAME} PROPERTY LABELS ${ARG_LABELS})
if(ARG_LABELS)
set_property(TEST ${ARG_NAME} PROPERTY LABELS ${ARG_LABELS})
endif()

install(TARGETS ${ARG_NAME}
RUNTIME DESTINATION tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ include(CMakeFindDependencyMacro)
# Variables to export in plugin's projects

set(ov_options "@OV_OPTIONS@")
list(APPEND ov_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER
CMAKE_CXX_LINKER_LAUNCHER CMAKE_C_LINKER_LAUNCHER
CMAKE_INSTALL_PREFIX CPACK_GENERATOR)
list(APPEND ov_options CPACK_GENERATOR)

if(APPLE)
list(APPEND ov_options CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET)
Expand Down
1 change: 1 addition & 0 deletions docs/install_guides/pypi-openvino-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!--- The note below is intended for master branch only for pre-release purpose. Remove it for official releases. --->
> **NOTE**: This version is pre-release software and has not undergone full release validation or qualification. No support is offered on pre-release software and APIs/behavior are subject to change. It should NOT be incorporated into any production software/solution and instead should be used only for early testing and integration while awaiting a final release version of this software.
> **NOTE**: OpenVINO™ Development Tools package has been deprecated and will be discontinued with 2024.0 release. To learn more, refer to the [OpenVINO Legacy Features and Components page](https://docs.openvino.ai/2023.1/openvino_legacy_features.html).
Intel® Distribution of OpenVINO™ toolkit is an open-source toolkit for optimizing and deploying AI inference. It can be used to develop applications and solutions based on deep learning tasks, such as: emulation of human vision, automatic speech recognition, natural language processing, recommendation systems, etc. It provides high-performance and rich deployment options, from edge to cloud.

Expand Down
21 changes: 11 additions & 10 deletions src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ if(NOT DEFINED OpenVINO_SOURCE_DIR)
if(NOT EXISTS "${OpenVINO_BINARY_DIR}/cmake_install.cmake")
set(OpenVINODeveloperPackage_RELOCATABLE ON)
endif()

set(OpenVINO_SOURCE_DIR "${OpenVINOPython_SOURCE_DIR}/../../../")
endif()

if(NOT DEFINED OpenVINODeveloperPackage_RELOCATABLE)
Expand Down Expand Up @@ -154,8 +156,8 @@ endfunction()

set(INIT_FILES_RUNTIME "${OpenVINOPython_SOURCE_DIR}/src/openvino/__init__.py"
"${OpenVINOPython_SOURCE_DIR}/src/compatibility/openvino/__init__.py"
"${OpenVINOPython_SOURCE_DIR}/../../../tools/ovc/openvino/__init__.py"
"${OpenVINOPython_SOURCE_DIR}/../../../tools/benchmark_tool/openvino/__init__.py")
"${OpenVINO_SOURCE_DIR}/tools/ovc/openvino/__init__.py"
"${OpenVINO_SOURCE_DIR}/tools/benchmark_tool/openvino/__init__.py")

ov_check_init_files_alignment("${INIT_FILES_RUNTIME}")

Expand Down Expand Up @@ -319,15 +321,15 @@ macro(ov_define_setup_py_dependencies)
"${CMAKE_CURRENT_SOURCE_DIR}/wheel/setup.py"
"${OpenVINOPython_SOURCE_DIR}/requirements.txt"
"${OpenVINOPython_SOURCE_DIR}/wheel/readme.txt"
"${OpenVINOPython_SOURCE_DIR}/../../../LICENSE"
"${OpenVINOPython_SOURCE_DIR}/../../../licensing/onednn_third-party-programs.txt"
"${OpenVINOPython_SOURCE_DIR}/../../../licensing/runtime-third-party-programs.txt"
"${OpenVINOPython_SOURCE_DIR}/../../../licensing/tbb_third-party-programs.txt"
"${OpenVINOPython_SOURCE_DIR}/../../../docs/install_guides/pypi-openvino-rt.md")
"${OpenVINO_SOURCE_DIR}/LICENSE"
"${OpenVINO_SOURCE_DIR}/licensing/onednn_third-party-programs.txt"
"${OpenVINO_SOURCE_DIR}/licensing/runtime-third-party-programs.txt"
"${OpenVINO_SOURCE_DIR}/licensing/tbb_third-party-programs.txt"
"${OpenVINO_SOURCE_DIR}/docs/install_guides/pypi-openvino-rt.md")

if(wheel_pre_release)
list(APPEND ov_setup_py_deps
"${OpenVINOPython_SOURCE_DIR}/../../../docs/install_guides/pre-release-note.md")
"${OpenVINO_SOURCE_DIR}/docs/install_guides/pre-release-note.md")
endif()
endmacro()

Expand Down Expand Up @@ -404,9 +406,8 @@ if(ENABLE_TESTS)
endif()

if(OpenVINODeveloperPackage_FOUND)
# TODO: understand whether it's required
# provides a callback function to describe each component in repo
include("${OpenVINOPython_SOURCE_DIR}/../../../cmake/packaging/packaging.cmake")
include("${OpenVINO_SOURCE_DIR}/cmake/packaging/packaging.cmake")

ov_cpack(${OV_CPACK_COMPONENTS_ALL})
endif()
5 changes: 1 addition & 4 deletions src/core/include/openvino/op/logical_and.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ class OPENVINO_API LogicalAnd : public util::BinaryElementwiseLogical {
const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY));

std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override;
bool visit_attributes(AttributeVisitor& visitor) override;
OPENVINO_SUPPRESS_DEPRECATED_START
bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override;
OPENVINO_SUPPRESS_DEPRECATED_END
bool evaluate(TensorVector& outputs, const TensorVector& inputs) const override;
bool has_evaluate() const override;
};
} // namespace v1
Expand Down
4 changes: 1 addition & 3 deletions src/core/include/openvino/op/logical_or.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class OPENVINO_API LogicalOr : public util::BinaryElementwiseLogical {

std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override;

OPENVINO_SUPPRESS_DEPRECATED_START
bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override;
OPENVINO_SUPPRESS_DEPRECATED_END
bool evaluate(TensorVector& outputs, const TensorVector& inputs) const override;
bool has_evaluate() const override;
};
} // namespace v1
Expand Down
5 changes: 2 additions & 3 deletions src/core/include/openvino/op/split.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ class OPENVINO_API Split : public Op {
void set_num_splits(const size_t num_splits) {
m_num_splits = num_splits;
}
OPENVINO_SUPPRESS_DEPRECATED_START
bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override;
OPENVINO_SUPPRESS_DEPRECATED_END

bool evaluate(TensorVector& outputs, const TensorVector& inputs) const override;
bool evaluate_lower(TensorVector& outputs) const override;
bool evaluate_upper(TensorVector& outputs) const override;
bool has_evaluate() const override;
Expand Down
26 changes: 16 additions & 10 deletions src/core/reference/include/openvino/reference/and.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,37 @@

#pragma once

#include <cstddef>
#include <algorithm>
#include <functional>

#include "openvino/core/shape.hpp"
#include "openvino/op/util/attr_types.hpp"
#include "openvino/reference/autobroadcast_binop.hpp"

namespace ov {
namespace reference {
template <typename T>
template <class T>
void logical_and(const T* arg0, const T* arg1, T* out, size_t count) {
for (size_t i = 0; i < count; i++) {
out[i] = static_cast<T>(arg0[i] && arg1[i]);
}
std::transform(arg0, std::next(arg0, count), arg1, out, std::logical_and<T>());
}

template <typename T>
/**
* @brief Reference implementation of binary elementwise LogicalAnd operator.
*
* @param arg0 Pointer to input 0 data.
* @param arg1 Pointer to input 1 data.
* @param out Pointer to output data.
* @param arg_shape0 Input 0 shape.
* @param arg_shape1 Input 1 shape.
* @param broadcast_spec Broadcast specification mode.
*/
template <class T>
void logical_and(const T* arg0,
const T* arg1,
T* out,
const Shape& arg0_shape,
const Shape& arg1_shape,
const op::AutoBroadcastSpec& broadcast_spec) {
autobroadcast_binop(arg0, arg1, out, arg0_shape, arg1_shape, broadcast_spec, [](T x, T y) -> T {
return static_cast<T>(x && y);
});
autobroadcast_binop(arg0, arg1, out, arg0_shape, arg1_shape, broadcast_spec, std::logical_and<T>());
}
} // namespace reference
} // namespace ov
29 changes: 18 additions & 11 deletions src/core/reference/include/openvino/reference/or.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,38 @@

#pragma once

#include <cstddef>
#include <algorithm>
#include <functional>

#include "openvino/core/shape.hpp"
#include "openvino/op/util/attr_types.hpp"
#include "openvino/reference/autobroadcast_binop.hpp"

namespace ov {
namespace reference {
template <typename T>
void logical_or(const T* arg0, const T* arg1, T* out, size_t count) {
for (size_t i = 0; i < count; i++) {
out[i] = static_cast<T>(arg0[i] || arg1[i]);
}

template <class T>
void logical_or(const T* arg0, const T* arg1, T* out, const size_t count) {
std::transform(arg0, std::next(arg0, count), arg1, out, std::logical_or<T>());
}

template <typename T>
/**
* @brief Reference implementation of binary elementwise LogicalOr operator.
*
* @param arg0 Pointer to input 0 data.
* @param arg1 Pointer to input 1 data.
* @param out Pointer to output data.
* @param arg_shape0 Input 0 shape.
* @param arg_shape1 Input 1 shape.
* @param broadcast_spec Broadcast specification mode.
*/
template <class T>
void logical_or(const T* arg0,
const T* arg1,
T* out,
const Shape& arg0_shape,
const Shape& arg1_shape,
const op::AutoBroadcastSpec& broadcast_spec) {
autobroadcast_binop(arg0, arg1, out, arg0_shape, arg1_shape, broadcast_spec, [](T x, T y) -> T {
return static_cast<T>(x || y);
});
autobroadcast_binop(arg0, arg1, out, arg0_shape, arg1_shape, broadcast_spec, std::logical_or<T>());
}
} // namespace reference
} // namespace ov
17 changes: 14 additions & 3 deletions src/core/reference/include/openvino/reference/split.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,28 @@

#pragma once

#include <cmath>
#include <cstddef>

#include "openvino/reference/slice.hpp"
#include "openvino/core/shape.hpp"

namespace ov {
namespace reference {

/**
* @brief Reference implementation of Split operator.
*
* @param data Pointer to input data.
* @param data_shape Input data shape.
* @param elem_size Size of single element type.
* @param axis Axis used for split input data.
* @param num_splits Number of splits
* @param out_data Pointer to output data pointers (must have size of num_splits)
*/
void split(const char* data,
const Shape& data_shape,
size_t elem_size,
int64_t axis,
size_t num_splits,
char** out_data);
}
} // namespace reference
} // namespace ov
42 changes: 25 additions & 17 deletions src/core/reference/src/op/split.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,43 @@

#include <stdio.h>

#include <cmath>
#include <iterator>

using namespace ov;
#include "openvino/core/coordinate.hpp"
#include "openvino/reference/slice.hpp"

void reference::split(const char* data,
const Shape& data_shape,
size_t elem_size,
int64_t axis,
size_t num_splits,
char** out_data) {
namespace ov {
namespace reference {

void split(const char* data,
const Shape& data_shape,
const size_t elem_size,
const int64_t axis,
const size_t num_splits,
char** out_data) {
const size_t part_length = data_shape.at(axis) / num_splits;

Shape output_shape = data_shape;
output_shape.at(axis) = part_length;
auto output_shape = data_shape;
output_shape[axis] = part_length;

std::vector<size_t> lower_bounds(data_shape.size(), 0);
std::vector<size_t> upper_bounds = data_shape;
upper_bounds.at(axis) = part_length;
Coordinate lower_bounds(data_shape.size(), 0);
Coordinate upper_bounds = output_shape;
auto& lb_at_axis = lower_bounds[axis];
auto& ub_at_axis = upper_bounds[axis];

for (size_t i = 0; i < num_splits; ++i) {
const auto out_last = std::next(out_data, num_splits);
for (auto out_first = out_data; out_first != out_last; ++out_first) {
reference::slice(data,
out_data[i],
*out_first,
data_shape,
lower_bounds,
upper_bounds,
Strides(lower_bounds.size(), 1),
output_shape,
elem_size);
lower_bounds.at(axis) += part_length;
upper_bounds.at(axis) += part_length;
lb_at_axis += part_length;
ub_at_axis += part_length;
}
}
} // namespace reference
} // namespace ov
Loading

0 comments on commit ef21fa5

Please sign in to comment.