Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[core] Fix ov::Tensor::data access perfomance (#30673)

Pawel Raaszb81cf0e17248
diff --git a/src/core/dev_api/openvino/core/type/element_type_info.hpp b/src/core/dev_api/openvino/core/type/element_type_info.hpp
new file mode 100644
index 00000000000..5a81db0d416
--- /dev/null
+++ b/src/core/dev_api/openvino/core/type/element_type_info.hpp
@@ -0,0 +1,46 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#pragma once
+
+#include <cstdint>
+#include <string>
+
+#include "openvino/core/type/element_type.hpp"
+
+namespace ov::element {
+
+struct TypeInfo {
+ size_t m_bitwidth;
+ bool m_is_real;
+ bool m_is_signed;
+ bool m_is_quantized;
+ const char* m_cname;
+ const char* m_type_name;
+ const char* const* m_aliases;
+ size_t m_alias_count;
+
+ bool has_name(const std::string& type) const {
+ if (type == m_type_name) {
+ return true;
+ } else {
+ const auto last = m_aliases + m_alias_count;
+ return std::find(m_aliases, last, type) != last;
+ }
+ }
+
+ constexpr bool is_valid() const {
+ return m_cname != nullptr && m_type_name != nullptr;
+ }
+};
+
+/**
+ * @brief Get TypeInfo of given element type.
+ *
+ * @param type Openvino element type to get its description.
+ * @return Reference to TypeInfo.
+ */
+OPENVINO_API const TypeInfo& get_type_info(Type_t type);
+
+} // namespace ov::element
diff --git a/src/core/dev_api/openvino/runtime/itensor.hpp b/src/core/dev_api/openvino/runtime/itensor.hpp
index 49c0b37d2b6..6fb05d20fb9 100644
--- a/src/core/dev_api/openvino/runtime/itensor.hpp
+++ b/src/core/dev_api/openvino/runtime/itensor.hpp
@@ -50,16 +50,25 @@ public:
*/
virtual const ov::Strides& get_strides() const = 0;
+ /**
+ * @brief Provides an access to the underlying host memory
+ * @return A host pointer to tensor memory
+ * @{
+ */
+ virtual void* data() = 0;
+ virtual const void* data() const = 0;
+ /// @}
+
/**
* @brief Provides an access to the underlying host memory
* @param type Optional type parameter.
- * @note If type parameter is specified, the method throws an exception
+ * @note The method throws an exception
* if specified type's fundamental type does not match with tensor element type's fundamental type
* @return A host pointer to tensor memory
* @{
*/
- virtual void* data(const element::Type& type = {});
- virtual const void* data(const element::Type& type = {}) const = 0;
+ virtual void* data(const element::Type& type) = 0;
+ virtual const void* data(const element::Type& type) const = 0;
/// @}
/**
diff --git a/src/core/include/openvino/runtime/tensor.hpp b/src/core/include/openvino/runtime/tensor.hpp
index 3521b5784f9..218f65e64aa 100644
--- a/src/core/include/openvino/runtime/tensor.hpp
+++ b/src/core/include/openvino/runtime/tensor.hpp
@@ -219,17 +219,30 @@ public:
/**
* @brief Provides an access to the underlying host memory
- * @param type Optional type parameter.
- * @note If type parameter is specified, the method throws an exception
- * if specified type's fundamental type does not match with tensor element type's fundamental type
* @return A host pointer to tensor memory
* @{
*/
+
+#ifndef IN_OV_COMPONENT
+ OPENVINO_DEPRECATED("This function will return const void* in 2026.0. Check if used correctly")
+#endif
+ void* data() const;
+ void* data();
+/// @}
+
+/**
+ * @brief Provides an access to the underlying host memory
+ * @param type Optional type parameter.
+ * @note The method throws an exception
+ * if specified type's fundamental type does not match with tensor element type's fundamental type
+ * @return A host pointer to tensor memory
+ * @{
+ */
#ifndef IN_OV_COMPONENT
OPENVINO_DEPRECATED("This function will return const void* in 2026.0. Check if used correctly")
#endif
- void* data(const element::Type& type = {}) const;
- void* data(const element::Type& type = {});
+ void* data(const element::Type& type) const;
+ void* data(const element::Type& type);
/// @}
/**
diff --git a/src/core/src/runtime/itensor.cpp b/src/core/src/runtime/itensor.cpp
index a2049faf470..5019e0d8451 100644
--- a/src/core/src/runtime/itensor.cpp
+++ b/src/core/src/runtime/itensor.cpp
@@ -188,9 +188,4 @@ void ITensor::copy_to(const std::shared_ptr<ov::ITensor>& dst) const {
dst_idx = update_index(cur_pos, dst_strides);
}
}
-
-void* ITensor::data(const element::Type& type) {
- return const_cast<void*>(static_cast<const ITensor*>(this)->data(type));
-}
-
} // namespace ov
diff --git a/src/core/src/runtime/tensor.cpp b/src/core/src/runtime/tensor.cpp
index ac57e412417..1c1cffec7dc 100644
--- a/src/core/src/runtime/tensor.cpp
+++ b/src/core/src/runtime/tensor.cpp
@@ -105,6 +105,14 @@ size_t Tensor::get_byte_size() const {
OV_TENSOR_STATEMENT(return _impl->get_byte_size(););
}
+void* Tensor::data() {
+ OV_TENSOR_STATEMENT(return _impl->data());
+}
+
+void* Tensor::data() const {
+ OV_TENSOR_STATEMENT(return const_cast<void*>(std::as_const(*_impl).data()););
+}
+
void* Tensor::data(const element::Type& element_type) {
OV_TENSOR_STATEMENT(return _impl->data(element_type));
}
diff --git a/src/core/src/type/element_type.cpp b/src/core/src/type/element_type.cpp
index bddb767d4cc..eedf93017ab 100644
--- a/src/core/src/type/element_type.cpp
+++ b/src/core/src/type/element_type.cpp
@@ -10,6 +10,7 @@
#include <string_view>
#include <unordered_map>
+#include "openvino/core/type/element_type_info.hpp"
#include "openvino/core/type/element_type_traits.hpp"
#include "openvino/util/common_util.hpp"
@@ -22,30 +23,6 @@ constexpr size_t idx(Type_t e) noexcept {
// Update it when new type is added
constexpr size_t enum_types_size = idx(f8e8m0) + 1;
-struct TypeInfo {
- size_t m_bitwidth;
- bool m_is_real;
- bool m_is_signed;
- bool m_is_quantized;
- const char* m_cname;
- const char* m_type_name;
- const char* const* aliases;
- size_t alias_count;
-
- bool has_name(const std::string& type) const {
- if (type == m_type_name) {
- return true;
- } else {
- const auto last = aliases + alias_count;
- return std::find(aliases, last, type) != last;
- }
- }
-
- constexpr bool is_valid() const {
- return m_cname != nullptr && m_type_name != nullptr;
- }
-};
-
template <class Array>
constexpr TypeInfo type_info(size_t bitwidth,
bool is_real,
@@ -133,12 +110,6 @@ size_t type_idx_for(const std::string& type_name) {
return type_idx;
}
-const TypeInfo& get_type_info(Type_t type) {
- const auto type_idx = idx(type);
- OPENVINO_ASSERT(is_valid_type_idx(type_idx), "Type_t not supported: ", type_idx);
- return types_info[type_idx];
-}
-
Type type_from_string(const std::string& type) {
const auto type_idx = type_idx_for(type);
OPENVINO_ASSERT(is_valid_type_idx(type_idx), "Unsupported element type: ", type);
@@ -155,6 +126,12 @@ static constexpr auto known_types = [] {
}();
} // namespace
+const TypeInfo& get_type_info(Type_t type) {
+ const auto type_idx = idx(type);
+ OPENVINO_ASSERT(is_valid_type_idx(type_idx), "Type_t not supported: ", type_idx);
+ return types_info[type_idx];
+}
+
std::vector<const Type*> Type::get_known_types() {
std::vector<const Type*> result(known_types.size());
for (size_t i = 0; i < known_types.size(); ++i) {
@@ -275,7 +252,7 @@ bool Type::merge(Type& dst, const Type& t1, const Type& t2) {
}
bool Type::is_static() const {
- return get_type_info(m_type).m_bitwidth != 0;
+ return m_type != Type_t::dynamic;
}
bool Type::is_real() const {
diff --git a/src/inference/dev_api/openvino/runtime/iremote_tensor.hpp b/src/inference/dev_api/openvino/runtime/iremote_tensor.hpp
index f1c8112bd07..18b46e916a9 100644
--- a/src/inference/dev_api/openvino/runtime/iremote_tensor.hpp
+++ b/src/inference/dev_api/openvino/runtime/iremote_tensor.hpp
@@ -17,7 +17,18 @@ namespace ov {
class OPENVINO_RUNTIME_API IRemoteTensor : public ITensor {
public:
- const void* data(const element::Type& type = {}) const override final {
+ void* data() override final {
+ OPENVINO_NOT_IMPLEMENTED;
+ }
+
+ void* data(const element::Type&) override final {
+ OPENVINO_NOT_IMPLEMENTED;
+ }
+ const void* data() const override final {
+ OPENVINO_NOT_IMPLEMENTED;
+ }
+
+ const void* data(const element::Type&) const override final {
OPENVINO_NOT_IMPLEMENTED;
}
diff --git a/src/inference/src/dev/make_tensor.cpp b/src/inference/src/dev/make_tensor.cpp
index 5d5cb00fc76..313d551d7d8 100644
--- a/src/inference/src/dev/make_tensor.cpp
+++ b/src/inference/src/dev/make_tensor.cpp
@@ -8,6 +8,7 @@
#include <mutex>
#include "openvino/core/type/element_iterator.hpp"
+#include "openvino/core/type/element_type_info.hpp"
#include "openvino/runtime/iremote_tensor.hpp"
#include "openvino/runtime/properties.hpp"
#include "openvino/runtime/tensor.hpp"
@@ -57,13 +58,29 @@ public:
OPENVINO_ASSERT(m_element_type.is_static());
}
+ void* data() override {
+ return m_ptr;
+ }
+
+ void* data(const element::Type& element_type) override {
+ OPENVINO_ASSERT(is_pointer_representable(element_type),
+ "Tensor data with element type ",
+ get_element_type(),
+ ", is not representable as pointer to ",
+ element_type);
+ return m_ptr;
+ }
+
+ const void* data() const override {
+ return m_ptr;
+ }
+
const void* data(const element::Type& element_type) const override {
- if (!is_pointer_representable(element_type)) {
- OPENVINO_THROW("Tensor data with element type ",
- get_element_type(),
- ", is not representable as pointer to ",
- element_type);
- }
+ OPENVINO_ASSERT(is_pointer_representable(element_type),
+ "Tensor data with element type ",
+ get_element_type(),
+ ", is not representable as pointer to ",
+ element_type);
return m_ptr;
}
@@ -92,11 +109,17 @@ public:
protected:
bool is_pointer_representable(const element::Type& element_type) const {
- return element_type.is_dynamic() ||
- ((get_element_type() != element::string && element_type != element::string &&
- element_type.bitwidth() == get_element_type().bitwidth() &&
- element_type.is_real() == get_element_type().is_real()) ||
- (element_type == element::string && element::string == get_element_type()));
+ if (element_type.is_dynamic()) {
+ return true;
+ } else {
+ // gets type info to reduce validation to access speed, due to performance issues
+ const auto& other_type_info = element::get_type_info(element_type);
+ const auto& this_type_info = element::get_type_info(get_element_type());
+ return (get_element_type() != element::string && element_type != element::string &&
+ other_type_info.m_bitwidth == this_type_info.m_bitwidth &&
+ other_type_info.m_is_real == this_type_info.m_is_real) ||
+ (element_type == element::string && element::string == get_element_type());
+ }
}
void update_strides() const {
@@ -134,9 +157,13 @@ public:
using ViewTensor::data;
- [[noreturn]] void* data(const element::Type& element_type) override {
+ [[noreturn]] void* data() override {
OPENVINO_THROW("Can not access non-const pointer use e.g. 'static_cast<const ov::Tensor&>.data()'");
}
+
+ [[noreturn]] void* data(const element::Type& element_type) override {
+ OPENVINO_THROW("Can not access non-const pointer use e.g. 'static_cast<const ov::Tensor&>.data(element_type)'");
+ }
};
/**
@@ -416,9 +443,20 @@ public:
BaseRoiTensor::set_shape(new_shape);
}
+ void* data() override {
+ return static_cast<uint8_t*>(m_owner->data()) + m_offset;
+ }
+
+ void* data(const element::Type& element_type) override {
+ return static_cast<uint8_t*>(m_owner->data()) + m_offset;
+ }
+
+ const void* data() const override {
+ return static_cast<uint8_t*>(m_owner->data()) + m_offset;
+ }
+
const void* data(const element::Type& element_type) const override {
- auto owner_data = m_owner->data(element_type);
- return static_cast<uint8_t*>(owner_data) + m_offset;
+ return static_cast<uint8_t*>(m_owner->data()) + m_offset;
}
};
diff --git a/src/plugins/intel_cpu/src/cpu_tensor.cpp b/src/plugins/intel_cpu/src/cpu_tensor.cpp
index 4ed1bb0342a..a4ed73c86f1 100644
--- a/src/plugins/intel_cpu/src/cpu_tensor.cpp
+++ b/src/plugins/intel_cpu/src/cpu_tensor.cpp
@@ -16,11 +16,17 @@
#include "openvino/core/except.hpp"
#include "openvino/core/shape.hpp"
#include "openvino/core/strides.hpp"
+#include "openvino/core/type/element_type.hpp"
#include "openvino/runtime/itensor.hpp"
#include "utils/debug_capabilities.h"
#include "utils/general_utils.h"
namespace ov::intel_cpu {
+namespace {
+constexpr bool is_pointer_representable(const ov::element::Type& tensor_type, const ov::element::Type& type) {
+ return type == ov::element::dynamic || tensor_type == type;
+}
+} // namespace
Tensor::Tensor(MemoryPtr memptr) : m_memptr{std::move(memptr)} {
OPENVINO_ASSERT(m_memptr != nullptr);
@@ -93,14 +99,29 @@ void Tensor::update_strides() const {
});
}
+void* Tensor::data() {
+ return m_memptr->getData();
+}
+
+void* Tensor::data(const element::Type& element_type) {
+ OPENVINO_ASSERT(is_pointer_representable(get_element_type(), element_type),
+ "Tensor data with element type ",
+ get_element_type(),
+ ", is not representable as pointer to ",
+ element_type);
+ return m_memptr->getData();
+}
+
+const void* Tensor::data() const {
+ return m_memptr->getData();
+}
+
const void* Tensor::data(const element::Type& element_type) const {
- if (element_type.is_static()) {
- OPENVINO_ASSERT(element_type == get_element_type(),
- "Tensor data with element type ",
- get_element_type(),
- ", is not representable as pointer to ",
- element_type);
- }
+ OPENVINO_ASSERT(is_pointer_representable(get_element_type(), element_type),
+ "Tensor data with element type ",
+ get_element_type(),
+ ", is not representable as pointer to ",
+ element_type);
return m_memptr->getData();
}
diff --git a/src/plugins/intel_cpu/src/cpu_tensor.h b/src/plugins/intel_cpu/src/cpu_tensor.h
index 63d2a90ecb3..8b7ce1a38ca 100644
--- a/src/plugins/intel_cpu/src/cpu_tensor.h
+++ b/src/plugins/intel_cpu/src/cpu_tensor.h
@@ -34,6 +34,9 @@ public:
const ov::Strides& get_strides() const override;
+ void* data() override;
+ void* data(const element::Type& type) override;
+ const void* data() const override;
const void* data(const element::Type& type) const override;
MemoryPtr get_memory() {
diff --git a/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_tensor.hpp b/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_tensor.hpp
index 430224ee867..66b16345984 100644
--- a/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_tensor.hpp
+++ b/src/plugins/intel_gpu/include/intel_gpu/plugin/remote_tensor.hpp
@@ -58,6 +58,7 @@ public:
bool is_shared() const noexcept;
cldnn::memory::ptr get_memory() const;
cldnn::memory::ptr get_original_memory() const;
+ void *get_original_memory_buf_ptr() const;
void set_memory(cldnn::memory::ptr memory, size_t actual_size);
diff --git a/src/plugins/intel_gpu/include/intel_gpu/plugin/usm_host_tensor.hpp b/src/plugins/intel_gpu/include/intel_gpu/plugin/usm_host_tensor.hpp
index caaa029bd15..6d86a8f4a0a 100644
--- a/src/plugins/intel_gpu/include/intel_gpu/plugin/usm_host_tensor.hpp
+++ b/src/plugins/intel_gpu/include/intel_gpu/plugin/usm_host_tensor.hpp
@@ -20,7 +20,11 @@ public:
~USMHostTensor() override = default;
+ void* data() override;
+ void* data(const element::Type& element_type) override;
+ const void* data() const override;
const void* data(const element::Type& element_type) const override;
+
const element::Type& get_element_type() const override;
const Shape& get_shape() const override;
diff --git a/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp b/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp
index 8e6a7eea823..c2524c8ab3d 100644
--- a/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp
+++ b/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp
@@ -409,6 +409,10 @@ cldnn::memory::ptr RemoteTensorImpl::get_original_memory() const {
return m_memory_object;
}
+void* RemoteTensorImpl::get_original_memory_buf_ptr() const {
+ return m_memory_object->buffer_ptr();
+}
+
void RemoteTensorImpl::set_memory(cldnn::memory::ptr memory, size_t actual_size) {
auto engine = m_memory_object->get_engine();
m_layout = memory->get_layout();
diff --git a/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp b/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp
index 5247206dc5b..42cccece385 100644
--- a/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp
+++ b/src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp
@@ -362,7 +362,7 @@ void SyncInferRequest::wait() {
if (is_remote_tensor_impl || is_generic_remote) {
GPU_DEBUG_TRACE_DETAIL << internal_name << " handle output tensor (remote) with index: " << port_idx << ": "
- << remote_tensor_impl_ptr->get_original_memory()->buffer_ptr() << std::endl;
+ << remote_tensor_impl_ptr->get_original_memory_buf_ptr() << std::endl;
} else {
GPU_DEBUG_TRACE_DETAIL << internal_name << " handle output tensor (host) with index: " << port_idx << ": "
<< output_tensor->data() << std::endl;
@@ -426,7 +426,7 @@ void SyncInferRequest::wait() {
bool same_mem = same_host_mem(output_memory, dst_ptr);
if (!same_mem && output_memory->size()) {
GPU_DEBUG_TRACE_DETAIL << internal_name << " with index " << port_idx << " copy from: " << output_memory->buffer_ptr() << " to "
- << (!is_remote_tensor_impl ? output_tensor->data() : remote_tensor_impl_ptr->get_original_memory()->buffer_ptr()) << std::endl;
+ << (!is_remote_tensor_impl ? output_tensor->data() : remote_tensor_impl_ptr->get_original_memory_buf_ptr()) << std::endl;
if (auto ev = copy_output_data(output_memory, *output_tensor)) {
copy_events.push_back(ev);
}
diff --git a/src/plugins/intel_gpu/src/plugin/usm_host_tensor.cpp b/src/plugins/intel_gpu/src/plugin/usm_host_tensor.cpp
index e3edfb818c1..a439e10dd04 100644
--- a/src/plugins/intel_gpu/src/plugin/usm_host_tensor.cpp
+++ b/src/plugins/intel_gpu/src/plugin/usm_host_tensor.cpp
@@ -15,8 +15,20 @@ USMHostTensor::USMHostTensor(std::shared_ptr<RemoteContextImpl> context, const e
USMHostTensor::USMHostTensor(std::shared_ptr<RemoteTensorImpl> tensor)
: m_impl(tensor) {}
-const void* USMHostTensor::data(const element::Type& element_type) const {
- return m_impl->get_original_memory()->buffer_ptr();
+void* USMHostTensor::data() {
+ return m_impl->get_original_memory_buf_ptr();
+}
+
+void* USMHostTensor::data(const element::Type&) {
+ return m_impl->get_original_memory_buf_ptr();
+}
+
+const void* USMHostTensor::data() const {
+ return m_impl->get_original_memory_buf_ptr();
+}
+
+const void* USMHostTensor::data(const element::Type&) const {
+ return m_impl->get_original_memory_buf_ptr();
}
const element::Type& USMHostTensor::get_element_type() const {
diff --git a/src/plugins/intel_npu/src/backend/include/zero_tensor.hpp b/src/plugins/intel_npu/src/backend/include/zero_tensor.hpp
index 332aea6fdda..df874d844c0 100644
--- a/src/plugins/intel_npu/src/backend/include/zero_tensor.hpp
+++ b/src/plugins/intel_npu/src/backend/include/zero_tensor.hpp
@@ -29,7 +29,11 @@ public:
const ov::Shape& shape,
const ov::Allocator& allocator);
- const void* data(const ov::element::Type& type = {}) const override;
+ void* data() override;
+ void* data(const ov::element::Type& type) override;
+
+ const void* data() const override;
+ const void* data(const ov::element::Type& type) const override;
const ov::element::Type& get_element_type() const override;
diff --git a/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp b/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
index 163e4082cb6..82ac365334e 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
@@ -11,6 +11,18 @@
namespace intel_npu {
+namespace {
+bool is_pointer_representable(const ov::element::Type& tensor_type, const ov::element::Type& type) {
+ if (type == ov::element::dynamic) {
+ return true;
+ } else {
+ return (type.bitwidth() == tensor_type.bitwidth() && type.is_real() == tensor_type.is_real() &&
+ type != ov::element::string && tensor_type != ov::element::string) ||
+ (type == ov::element::string && tensor_type == ov::element::string);
+ }
+}
+} // namespace
+
ZeroTensor::ZeroTensor(const std::shared_ptr<ZeroInitStructsHolder>& init_structs,
const Config& config,
const ov::element::Type element_type,
@@ -33,20 +45,33 @@ ZeroTensor::ZeroTensor(const std::shared_ptr<ZeroInitStructsHolder>& init_struct
_ptr = data;
}
-const void* ZeroTensor::data(const ov::element::Type& element_type) const {
- if (element_type != ov::element::dynamic &&
- (element_type.bitwidth() != get_element_type().bitwidth() ||
- element_type.is_real() != get_element_type().is_real() ||
- (element_type == ov::element::string && get_element_type() != ov::element::string) ||
- (element_type != ov::element::string && get_element_type() == ov::element::string))) {
- OPENVINO_THROW("Tensor data with element type ",
- get_element_type(),
- ", is not representable as pointer to ",
- element_type);
- }
+// Note: Override data() members to not used OpenVINO library code to improve performance
+void* ZeroTensor::data() {
return _ptr;
}
+void* ZeroTensor::data(const ov::element::Type& type) {
+ OPENVINO_ASSERT(is_pointer_representable(get_element_type(), type),
+ "Tensor data with element type ",
+ get_element_type(),
+ ", is not representable as pointer to ",
+ type);
+ return data();
+}
+
+const void* ZeroTensor::data() const {
+ return _ptr;
+}
+
+const void* ZeroTensor::data(const ov::element::Type& type) const {
+ OPENVINO_ASSERT(is_pointer_representable(get_element_type(), type),
+ "Tensor data with element type ",
+ get_element_type(),
+ ", is not representable as pointer to ",
+ type);
+ return data();
+}
+
const ov::element::Type& ZeroTensor::get_element_type() const {
return _element_type;
}
diff --git a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_host_tensor.hpp b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_host_tensor.hpp
index 27b5b1df376..01199426b6f 100644
--- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_host_tensor.hpp
+++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_host_tensor.hpp
@@ -20,6 +20,9 @@ public:
~ZeroHostTensor() override = default;
+ void* data() override;
+ void* data(const ov::element::Type& element_type) override;
+ const void* data() const override;
const void* data(const ov::element::Type& element_type) const override;
const ov::element::Type& get_element_type() const override;
diff --git a/src/plugins/intel_npu/src/utils/src/zero/zero_host_tensor.cpp b/src/plugins/intel_npu/src/utils/src/zero/zero_host_tensor.cpp
index de1b5a2b980..c82331ede64 100644
--- a/src/plugins/intel_npu/src/utils/src/zero/zero_host_tensor.cpp
+++ b/src/plugins/intel_npu/src/utils/src/zero/zero_host_tensor.cpp
@@ -20,6 +20,19 @@ ZeroHostTensor::ZeroHostTensor(const std::shared_ptr<ov::IRemoteContext>& contex
tensor_type,
ov::intel_npu::MemType::L0_INTERNAL_BUF)) {}
+// Note: Override data() members to not used OpenVINO library code to improve performance
+void* ZeroHostTensor::data() {
+ return _impl->get_original_memory();
+}
+
+void* ZeroHostTensor::data(const ov::element::Type&) {
+ return _impl->get_original_memory();
+}
+
+const void* ZeroHostTensor::data() const {
+ return _impl->get_original_memory();
+}
+
const void* ZeroHostTensor::data(const ov::element::Type&) const {
return _impl->get_original_memory();
}