Skip to content

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

Add release/lazy load on linux using mmap (#35388)

Pawel Raasz4be1f03490fb
diff --git a/src/common/transformations/src/transformations/convert_precision.cpp b/src/common/transformations/src/transformations/convert_precision.cpp
index 70409632d5c..caae21e7b52 100644
--- a/src/common/transformations/src/transformations/convert_precision.cpp
+++ b/src/common/transformations/src/transformations/convert_precision.cpp
@@ -11,6 +11,7 @@
#include "openvino/core/graph_util.hpp"
#include "openvino/core/rt_info/weightless_caching_attributes.hpp"
#include "openvino/core/type/element_iterator.hpp"
+#include "openvino/core/weight_sharing_util.hpp"
#include "openvino/op/ops.hpp"
#include "openvino/pass/constant_folding.hpp"
#include "openvino/pass/manager.hpp"
@@ -1370,6 +1371,7 @@ bool fuse_type_to_constant(const std::shared_ptr<ov::Node>& node,
new_const->set_friendly_name(constant->get_friendly_name());
ov::copy_runtime_info(constant, new_const);
ov::copy_weightless_cache_attr(constant, new_const);
+ ov::wsh::Extension::hint_evict(*constant);
return true;
}
return false;
diff --git a/src/common/util/include/openvino/util/mmap_object.hpp b/src/common/util/include/openvino/util/mmap_object.hpp
index d874b2a5e80..8f91114d9fc 100644
--- a/src/common/util/include/openvino/util/mmap_object.hpp
+++ b/src/common/util/include/openvino/util/mmap_object.hpp
@@ -11,6 +11,7 @@
#include <filesystem>
#include <fstream>
+#include <limits>
#include <memory>
#include <string>
@@ -27,6 +28,10 @@ using FileHandle = void*;
// Linux/Unix uses int for file descriptors
using FileHandle = int;
#endif
+/**
+ * @brief Generic constant to indicate automatic size calculation is required.
+ */
+inline constexpr auto auto_size = std::numeric_limits<size_t>::max();
/**
* @brief This class represents a mapped memory.
@@ -39,13 +44,9 @@ public:
virtual size_t size() const noexcept = 0;
virtual uint64_t get_id() const noexcept = 0;
virtual ~MappedMemory() = default;
+ virtual void hint_evict(size_t offset = 0, size_t size = auto_size) noexcept = 0;
};
-/**
- * @brief Generic constant to indicate automatic size calculation is required.
- */
-inline constexpr auto auto_size = std::numeric_limits<size_t>::max();
-
/**
* @brief Returns mapped memory for a file from provided path.
* Instead of reading files, we can map the memory via mmap for Linux
diff --git a/src/common/util/src/os/lin/lin_mmap_object.cpp b/src/common/util/src/os/lin/lin_mmap_object.cpp
index 9319fcffbf4..dc612c920b6 100644
--- a/src/common/util/src/os/lin/lin_mmap_object.cpp
+++ b/src/common/util/src/os/lin/lin_mmap_object.cpp
@@ -8,9 +8,11 @@
#include <sys/stat.h>
#include <unistd.h>
+#include <algorithm>
#include <cstring>
#include <iostream>
#include <sstream>
+#include <tuple>
#include "openvino/util/common_util.hpp"
#include "openvino/util/file_util.hpp"
@@ -22,6 +24,59 @@ int64_t get_system_page_size() {
static auto page_size = static_cast<int64_t>(sysconf(_SC_PAGE_SIZE));
return page_size;
}
+
+/** @brief Represents a memory region aligned to system page boundaries. */
+struct PageAlignedRegion {
+ uintptr_t m_address = 0; //!< Page-aligned base address (rounded down to page boundary)
+ size_t m_length = 0; //!< Total length of the aligned region including the gap
+ size_t m_gap = 0; //!< Gap from the aligned address to the original unaligned address
+};
+
+/**
+ * @brief Aligns a memory region to system page boundaries.
+ *
+ * @param base The base address of the memory region.
+ * @param raw_len The length of the memory region.
+ * @param page_size The system page size.
+ * @return The aligned memory region.
+ */
+constexpr PageAlignedRegion align_to_page(uintptr_t base, size_t raw_len, size_t page_size) {
+ const auto aligned = (base / page_size) * page_size;
+ const auto gap = base - aligned;
+ return {aligned, raw_len + gap, gap};
+}
+
+/**
+ * @brief Creates a memory region for mmap operations.
+ *
+ * @param offset The offset within the mmap region.
+ * @param size The size of the region.
+ * @return PageAlignedRegion The aligned memory region.
+ */
+inline PageAlignedRegion make_mmap_region(size_t offset, size_t size) {
+ const auto page_size = static_cast<size_t>(util::get_system_page_size());
+ return align_to_page(static_cast<uintptr_t>(offset), size, page_size);
+}
+
+/**
+ * @brief Creates a memory region for madvise operations.
+ *
+ * @param data The base address of the mapped memory region.
+ * @param mapping_size The size of the mapped memory region.
+ * @param offset The offset within the mapped memory region.
+ * @param size The size of the region.
+ * @return PageAlignedRegion The aligned memory region.
+ */
+inline PageAlignedRegion make_madvise_region(const void* data, size_t mapping_size, size_t offset, size_t size) {
+ const auto page_size = static_cast<size_t>(util::get_system_page_size());
+ if (data == nullptr || mapping_size == 0 || offset >= mapping_size || size < page_size) {
+ return {};
+ } else {
+ const auto available = mapping_size - offset;
+ const auto raw_len = (size == auto_size) ? available : std::min(size, available);
+ return align_to_page(reinterpret_cast<uintptr_t>(data) + offset, raw_len, page_size);
+ }
+}
} // namespace util
class HandleHolder {
@@ -98,15 +153,14 @@ public:
}
if (m_size > 0) {
- const auto page_size = util::get_system_page_size();
- const auto aligned_offset = (offset / page_size) * page_size;
- m_mapped_view_size = offset + m_size - aligned_offset;
- m_mapped_view = mmap(nullptr, m_mapped_view_size, PROT_READ, MAP_SHARED, fd, aligned_offset);
+ const auto& [aligned_offset, length, gap] = util::make_mmap_region(offset, m_size);
+ m_mapped_view_size = length;
+ m_mapped_view = mmap(nullptr, length, PROT_READ, MAP_SHARED, fd, aligned_offset);
if (m_mapped_view == MAP_FAILED) {
throw std::runtime_error("Can not create file mapping for " + std::to_string(fd) +
", err=" + std::strerror(errno));
}
- m_data = static_cast<char*>(m_mapped_view) + (offset - aligned_offset);
+ m_data = static_cast<char*>(m_mapped_view) + gap;
}
m_id =
util::u64_hash_combine(static_cast<uint64_t>(sb.st_ino), {static_cast<uint64_t>(sb.st_dev), offset, size});
@@ -129,6 +183,14 @@ public:
size_t size() const noexcept override {
return m_size;
}
+
+ void hint_evict(size_t offset, size_t size) noexcept override {
+ if (m_mapped_view != MAP_FAILED) {
+ if (const auto region = util::make_madvise_region(m_data, m_size, offset, size); region.m_length > 0) {
+ std::ignore = madvise(reinterpret_cast<void*>(region.m_address), region.m_length, MADV_DONTNEED);
+ }
+ }
+ }
};
std::shared_ptr<MappedMemory> load_mmap_object(const std::filesystem::path& path, size_t offset, size_t size) {
diff --git a/src/common/util/src/os/win/win_mmap_object.cpp b/src/common/util/src/os/win/win_mmap_object.cpp
index 4fc05d05972..5ea85a7fac2 100644
--- a/src/common/util/src/os/win/win_mmap_object.cpp
+++ b/src/common/util/src/os/win/win_mmap_object.cpp
@@ -97,6 +97,8 @@ public:
return m_id;
}
+ void hint_evict(size_t offset, size_t size) noexcept override {}
+
private:
void set_id(const HANDLE h, const size_t offset, const size_t size) {
if (FILE_ID_INFO info; GetFileInformationByHandleEx(h, FileIdInfo, &info, sizeof(info))) {
diff --git a/src/core/dev_api/openvino/core/weight_sharing_util.hpp b/src/core/dev_api/openvino/core/weight_sharing_util.hpp
index 5bb873c9ffa..caf5a51a7c0 100644
--- a/src/core/dev_api/openvino/core/weight_sharing_util.hpp
+++ b/src/core/dev_api/openvino/core/weight_sharing_util.hpp
@@ -123,6 +123,14 @@ struct OPENVINO_API Extension {
* @return Return map of weight metadata.
*/
static WeightRegistry get_weight_registry(const Model& model);
+
+ /** @brief Hint to evict the constant's buffer from physical memory.
+ *
+ * @note Will try to evict data from constant buffer if possible.
+ *
+ * @param constant Constant node to evict buffer for.
+ */
+ static void hint_evict(ov::op::v0::Constant& constant) noexcept;
};
/** @brief Get the source buffer for a given source id.
diff --git a/src/core/dev_api/openvino/runtime/aligned_buffer.hpp b/src/core/dev_api/openvino/runtime/aligned_buffer.hpp
index e2f77771f8d..7db74b66374 100644
--- a/src/core/dev_api/openvino/runtime/aligned_buffer.hpp
+++ b/src/core/dev_api/openvino/runtime/aligned_buffer.hpp
@@ -4,6 +4,7 @@
#pragma once
+#include <cstdint>
#include <memory>
#include "openvino/core/attribute_adapter.hpp"
@@ -12,6 +13,7 @@
namespace ov {
class AlignedBuffer;
+
class OPENVINO_API IBufferDescriptor {
public:
virtual size_t get_id() const = 0;
@@ -68,7 +70,12 @@ public:
AlignedBuffer(const AlignedBuffer&) = delete;
AlignedBuffer& operator=(const AlignedBuffer&) = delete;
+ virtual void hint_evict() noexcept;
+
protected:
+ virtual void hint_evict(size_t offset, size_t size) noexcept;
+ static void invoke_evict(AlignedBuffer& buffer, size_t offset, size_t size) noexcept;
+
char* m_allocated_buffer;
char* m_aligned_buffer;
size_t m_byte_size;
diff --git a/src/core/dev_api/openvino/runtime/shared_buffer.hpp b/src/core/dev_api/openvino/runtime/shared_buffer.hpp
index 98b959ad2ca..8791d309154 100644
--- a/src/core/dev_api/openvino/runtime/shared_buffer.hpp
+++ b/src/core/dev_api/openvino/runtime/shared_buffer.hpp
@@ -30,14 +30,37 @@ public:
m_byte_size = 0;
}
+ virtual void hint_evict() noexcept override {
+ if constexpr (std::is_same_v<std::shared_ptr<ov::MappedMemory>, T>) {
+ if (m_shared_object) {
+ m_shared_object->hint_evict(get_offset(), m_byte_size);
+ }
+ } else if constexpr (std::is_same_v<std::shared_ptr<ov::AlignedBuffer>, T>) {
+ if (m_shared_object) {
+ invoke_evict(*m_shared_object, get_offset(), m_byte_size);
+ }
+ } else {
+ }
+ }
+
protected:
+ virtual void hint_evict(size_t offset, size_t size) noexcept override {
+ if constexpr (std::is_same_v<std::shared_ptr<ov::MappedMemory>, T>) {
+ if (m_shared_object) {
+ m_shared_object->hint_evict(offset, size);
+ }
+ } else {
+ }
+ }
+
// protected to not create SharedBufferBase directly
SharedBufferBase(char* data,
size_t size,
const T& shared_object,
const std::shared_ptr<IBufferDescriptor>& descriptor)
- : _shared_object(shared_object),
- m_source_buffer(descriptor ? descriptor->get_source_buffer() : nullptr) {
+ : m_shared_object{shared_object},
+ m_source_buffer{descriptor ? descriptor->get_source_buffer() : nullptr},
+ m_descriptor{} {
m_allocated_buffer = nullptr;
m_aligned_buffer = data;
m_byte_size = size;
@@ -53,8 +76,9 @@ protected:
}
SharedBufferBase(char* data, size_t size, const T& shared_object)
- : _shared_object(shared_object),
- m_source_buffer(nullptr) {
+ : m_shared_object{shared_object},
+ m_source_buffer{},
+ m_descriptor{} {
m_allocated_buffer = nullptr;
m_aligned_buffer = data;
m_byte_size = size;
@@ -69,10 +93,10 @@ protected:
}
// Owns the underlying data and keeps it alive for the lifetime of this buffer
- T _shared_object;
+ T m_shared_object;
// Points to the root AlignedBuffer used for offset calculation and
// accessible externally via get_descriptor()->get_source_buffer();
- // may or may not reference the same data as _shared_object
+ // may or may not reference the same data as m_shared_object
std::shared_ptr<ov::AlignedBuffer> m_source_buffer;
std::shared_ptr<IBufferDescriptor> m_descriptor;
};
@@ -86,25 +110,22 @@ class SharedBuffer : public SharedBufferBase<T> {
template <typename U>
static constexpr bool is_aligned_buffer_ptr_v = is_aligned_buffer_ptr<U>::value;
+ static std::shared_ptr<IBufferDescriptor> get_or_make_descriptor(const T& shared_object) {
+ if constexpr (std::is_same_v<T, std::shared_ptr<ov::MappedMemory>>) {
+ return detail::create_mmap_descriptor(shared_object);
+ } else if constexpr (is_aligned_buffer_ptr_v<T>) {
+ return shared_object ? shared_object->get_descriptor() : nullptr;
+ } else {
+ return nullptr;
+ }
+ }
+
public:
SharedBuffer(char* data, size_t size, const T& shared_object, const std::shared_ptr<IBufferDescriptor>& descriptor)
: SharedBufferBase<T>(data, size, shared_object, descriptor) {}
- // For non-AlignedBuffer, non-MappedMemory types: no auto-descriptor
- template <
- typename U = T,
- std::enable_if_t<!is_aligned_buffer_ptr_v<U> && !std::is_same_v<U, std::shared_ptr<ov::MappedMemory>>, int> = 0>
- SharedBuffer(char* data, size_t size, const T& shared_object) : SharedBufferBase<T>(data, size, shared_object) {}
-
- // For AlignedBuffer-derived shared_ptr types: auto-inherit descriptor
- template <typename U = T, std::enable_if_t<is_aligned_buffer_ptr_v<U>, int> = 0>
- SharedBuffer(char* data, size_t size, const T& shared_object)
- : SharedBufferBase<T>(data, size, shared_object, shared_object ? shared_object->get_descriptor() : nullptr) {}
-
- // For MappedMemory: auto-create mmap descriptor
- template <typename U = T, std::enable_if_t<std::is_same_v<U, std::shared_ptr<ov::MappedMemory>>, int> = 0>
SharedBuffer(char* data, size_t size, const T& shared_object)
- : SharedBufferBase<T>(data, size, shared_object, detail::create_mmap_descriptor(shared_object)) {}
+ : SharedBuffer(data, size, shared_object, get_or_make_descriptor(shared_object)) {}
};
/// \brief SharedStreamBuffer class to store pointer to pre-allocated buffer and provide streambuf interface.
diff --git a/src/core/src/op/constant.cpp b/src/core/src/op/constant.cpp
index 6aa8aee640d..74912f399e3 100644
--- a/src/core/src/op/constant.cpp
+++ b/src/core/src/op/constant.cpp
@@ -18,6 +18,7 @@
#include "openvino/core/type/element_iterator.hpp"
#include "openvino/core/type/float16.hpp"
#include "openvino/core/type/nf4.hpp"
+#include "openvino/core/weight_sharing_util.hpp"
#include "openvino/reference/convert.hpp"
#include "openvino/reference/utils/type_util.hpp"
#include "openvino/runtime/shared_buffer.hpp"
diff --git a/src/core/src/pass/constant_folding.cpp b/src/core/src/pass/constant_folding.cpp
index 6057b6902e4..37d8ffd986f 100644
--- a/src/core/src/pass/constant_folding.cpp
+++ b/src/core/src/pass/constant_folding.cpp
@@ -8,6 +8,7 @@
#include "openvino/core/constant_fold_utils.hpp"
#include "openvino/core/rt_info.hpp"
#include "openvino/core/rt_info/weightless_caching_attributes.hpp"
+#include "openvino/core/weight_sharing_util.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/convert.hpp"
#include "openvino/op/util/op_types.hpp"
@@ -161,6 +162,14 @@ bool ov::pass::ConstantFolding::run_on_model(const std::shared_ptr<ov::Model>& m
// Propagate runtime info attributes to replacement
copy_runtime_info(original_node, replacement_ptr);
ov::copy_weightless_cache_attr(original_node, replacement_ptr);
+ // Evict data if original node is constant or convert with constant input
+ if (auto constant = ov::as_type_ptr<ov::op::v0::Constant>(original_node)) {
+ ov::wsh::Extension::hint_evict(*constant);
+ } else if (auto convert = ov::as_type_ptr<ov::op::v0::Convert>(original_node)) {
+ if (auto const_input = ov::as_type<ov::op::v0::Constant>(convert->get_input_node_ptr(0))) {
+ ov::wsh::Extension::hint_evict(*const_input);
+ }
+ }
rewritten = true;
}
diff --git a/src/core/src/runtime/aligned_buffer.cpp b/src/core/src/runtime/aligned_buffer.cpp
index 1cbbfc41815..b84665bf528 100644
--- a/src/core/src/runtime/aligned_buffer.cpp
+++ b/src/core/src/runtime/aligned_buffer.cpp
@@ -60,4 +60,12 @@ AttributeAdapter<std::shared_ptr<AlignedBuffer>>::~AttributeAdapter() = default;
std::shared_ptr<IBufferDescriptor> AlignedBuffer::get_descriptor() const {
return nullptr;
}
+
+void AlignedBuffer::hint_evict() noexcept {}
+
+void AlignedBuffer::hint_evict(size_t offset, size_t size) noexcept {}
+
+void AlignedBuffer::invoke_evict(AlignedBuffer& buffer, size_t offset, size_t size) noexcept {
+ buffer.hint_evict(offset, size);
+}
} // namespace ov
diff --git a/src/core/src/runtime/shared_buffer.cpp b/src/core/src/runtime/shared_buffer.cpp
index 2a2fb9df8ac..f2574ed778c 100644
--- a/src/core/src/runtime/shared_buffer.cpp
+++ b/src/core/src/runtime/shared_buffer.cpp
@@ -7,6 +7,7 @@
#include <memory>
namespace ov {
+
class SharedBufferDescriptor : public IBufferDescriptor {
public:
SharedBufferDescriptor(size_t id, size_t offset, const std::shared_ptr<ov::AlignedBuffer>& source_buffer)
diff --git a/src/core/src/weight_sharing_util.cpp b/src/core/src/weight_sharing_util.cpp
index 1f231fbf30f..cf35aa54065 100644
--- a/src/core/src/weight_sharing_util.cpp
+++ b/src/core/src/weight_sharing_util.cpp
@@ -99,6 +99,14 @@ std::shared_ptr<ov::AlignedBuffer> Extension::get_constant_source_buffer(const o
return desc ? desc->get_source_buffer() : nullptr;
}
+void Extension::hint_evict(ov::op::v0::Constant& constant) noexcept {
+ if (constant.m_data) {
+ if (constant.m_data->get_descriptor()) {
+ constant.m_data->hint_evict();
+ }
+ }
+}
+
std::shared_ptr<ov::AlignedBuffer> get_source_buffer(const Context& shared_context, const DataID source_id) {
const auto& weights = shared_context.m_cache_sources;
if (auto weight_it = weights.find(source_id); weight_it != weights.end()) {
diff --git a/src/core/tests/shared_buffer.cpp b/src/core/tests/shared_buffer.cpp
index 0686263fd25..3bfa6620891 100644
--- a/src/core/tests/shared_buffer.cpp
+++ b/src/core/tests/shared_buffer.cpp
@@ -4,14 +4,18 @@
#include "openvino/runtime/shared_buffer.hpp"
+#include <gmock/gmock.h>
+
#include <filesystem>
#include <fstream>
#include <sstream>
+#include <vector>
#include "common_test_utils/common_utils.hpp"
-#include "gtest/gtest.h"
+#include "openvino/op/constant.hpp"
#include "openvino/util/mmap_object.hpp"
+namespace ov::test {
using ov::SharedStreamBuffer;
TEST(shared_stream_buffer, basic_read) {
@@ -514,3 +518,86 @@ TEST_F(SharedBufferTest, specialization_overload_resolution) {
}
}
}
+
+class MockMappedMemory : public ov::MappedMemory {
+public:
+ explicit MockMappedMemory(size_t size) : m_data(size, '\0'), m_id(1) {}
+
+ char* data() noexcept override {
+ return m_data.data();
+ }
+ size_t size() const noexcept override {
+ return m_data.size();
+ }
+ uint64_t get_id() const noexcept override {
+ return m_id;
+ }
+
+ void hint_evict(size_t offset, size_t size) noexcept override {
+ hint_evict_mock(offset, size);
+ }
+
+ MOCK_METHOD(void, hint_evict_mock, (size_t offset, size_t size));
+
+private:
+ std::vector<char> m_data;
+ uint64_t m_id;
+};
+
+TEST_F(SharedBufferTest, mmap_shared_buffer_calls_hint_evict_with_own_region) {
+ constexpr size_t mmap_size = 1024;
+ constexpr size_t buf_offset = 128;
+ constexpr size_t buf_size = 256;
+
+ auto mock = std::make_shared<MockMappedMemory>(mmap_size);
+ auto buffer = std::make_shared<ov::SharedBuffer<std::shared_ptr<ov::MappedMemory>>>(mock->data() + buf_offset,
+ buf_size,
+ mock);
+
+ EXPECT_CALL(*mock, hint_evict_mock(buf_offset, buf_size)).Times(1);
+ buffer->hint_evict();
+}
+
+TEST_F(SharedBufferTest, mmap_shared_buffer_full_mapping) {
+ constexpr size_t mmap_size = 512;
+
+ auto mock = std::make_shared<MockMappedMemory>(mmap_size);
+ auto buffer = std::make_shared<ov::SharedBuffer<std::shared_ptr<ov::MappedMemory>>>(mock->data(), mmap_size, mock);
+
+ EXPECT_CALL(*mock, hint_evict_mock(0u, mmap_size)).Times(1);
+ buffer->hint_evict();
+}
+
+TEST_F(SharedBufferTest, aligned_shared_buffer_propagates_to_mmap) {
+ constexpr size_t mmap_size = 2048;
+ constexpr size_t parent_offset = 64;
+ constexpr size_t child_offset = 32; // relative to parent data ptr
+ constexpr size_t child_size = 128;
+
+ auto mock = std::make_shared<MockMappedMemory>(mmap_size);
+
+ auto parent = std::make_shared<ov::SharedBuffer<std::shared_ptr<ov::MappedMemory>>>(mock->data() + parent_offset,
+ mmap_size - parent_offset,
+ mock);
+
+ auto child = std::make_shared<ov::SharedBuffer<std::shared_ptr<ov::AlignedBuffer>>>(
+ parent->get_ptr<char>() + child_offset,
+ child_size,
+ std::static_pointer_cast<ov::AlignedBuffer>(parent));
+
+ // child lives at parent_offset + child_offset inside the mmap
+ EXPECT_CALL(*mock, hint_evict_mock(parent_offset + child_offset, child_size)).Times(1);
+ child->hint_evict();
+}
+
+TEST_F(SharedBufferTest, no_call_when_mmap_object_is_null) {
+ constexpr size_t buf_size = 64;
+ std::vector<char> storage(buf_size);
+
+ auto buffer = std::make_shared<ov::SharedBuffer<std::shared_ptr<ov::MappedMemory>>>(
+ storage.data(),
+ buf_size,
+ std::shared_ptr<ov::MappedMemory>{} /*null*/);
+ EXPECT_NO_THROW(buffer->hint_evict());
+}
+} // namespace ov::test
diff --git a/src/plugins/intel_gpu/src/plugin/ops/constant.cpp b/src/plugins/intel_gpu/src/plugin/ops/constant.cpp
index 68605ad8f8c..626dee0b486 100644
--- a/src/plugins/intel_gpu/src/plugin/ops/constant.cpp
+++ b/src/plugins/intel_gpu/src/plugin/ops/constant.cpp
@@ -6,6 +6,7 @@
#include "intel_gpu/plugin/common_utils.hpp"
#include "intel_gpu/op/convolution.hpp"
+#include "openvino/core/weight_sharing_util.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/convolution.hpp"
#include "openvino/op/convert.hpp"
@@ -145,6 +146,7 @@ static void create_data(ProgramBuilder& p, const ov::Shape& const_shape, const s
} else {
std::memcpy(&buf[0], &data[0], bufSize);
}
+ ov::wsh::Extension::hint_evict(*op);
p.add_primitive(*op, cldnn::data(initialconstPrimID, mem));
p.blobMemCache[cache_key] = initialconstPrimID;
constPrimID = initialconstPrimID;