Skip to content

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

[GPU] enable load model cache when having ze backend (#38339)

Michal Miotk0c595ae93f02
diff --git a/docs/articles_en/assets/snippets/gpu/remote_objects_creation.cpp b/docs/articles_en/assets/snippets/gpu/remote_objects_creation.cpp
index d13be2069f1..c57a8e85656 100644
--- a/docs/articles_en/assets/snippets/gpu/remote_objects_creation.cpp
+++ b/docs/articles_en/assets/snippets/gpu/remote_objects_creation.cpp
@@ -49,8 +49,9 @@ int main() {
{
//! [wrap_cpu_pointer]
- // Allocation part - must be done with alignment(for OCL backend) - align the address to cache line size
- // and the allocation size must be a multiple of cache line size.
+ // Allocation part - must be done with alignment. For OCL backend, align the address to cache line size
+ // and the allocation size must be a multiple of cache line size. For L0 backend, align the address to page size
+ // and the allocation size must be a multiple of page size.
// In case of size of tensor lower than cache line size, allocate at least one cache line size
// and use ov::intel_gpu::VirtualAddressMemory(cpu_pointer, allocated_size)
size_t size = input_size * in_element_type.size();
diff --git a/src/plugins/intel_gpu/include/intel_gpu/runtime/device_info.hpp b/src/plugins/intel_gpu/include/intel_gpu/runtime/device_info.hpp
index b5eafdd69e9..0a290221c1c 100644
--- a/src/plugins/intel_gpu/include/intel_gpu/runtime/device_info.hpp
+++ b/src/plugins/intel_gpu/include/intel_gpu/runtime/device_info.hpp
@@ -125,6 +125,7 @@ struct device_info {
bool supports_cp_offload; ///< [L0] Does the command queue support copy offload
bool supports_counter_based_events; ///< [L0] Does the target runtime support counter based events
bool supports_leo; ///< [L0] Does the device support Level Zero - OpenCL interoperability (LEO)
+ bool supports_external_memmap_sysmem; ///< [L0] Does the driver support mapping an existing host pointer directly via zeMemAllocHost
std::vector<size_t> supported_simd_sizes; ///< List of SIMD sizes supported by current device and compiler
diff --git a/src/plugins/intel_gpu/src/graph/program.cpp b/src/plugins/intel_gpu/src/graph/program.cpp
index 93cf9ed0861..cdeeefba896 100644
--- a/src/plugins/intel_gpu/src/graph/program.cpp
+++ b/src/plugins/intel_gpu/src/graph/program.cpp
@@ -2016,7 +2016,7 @@ void program::load(cldnn::BinaryInputBuffer& ib,
host_buffer_base_ptr =
ib.get_engine().create_hostbuffer(ib.get_tensor(),
ib.get_stream_size(),
- allocation_type::cl_mem,
+ allocation_type::usm_host,
layout({{static_cast<tensor::value_type>(ib.get_stream_size()), 1, 1, 1}, data_types::u8, format::bfyx}));
}
@@ -2213,4 +2213,3 @@ void program::load(cldnn::BinaryInputBuffer& ib,
}
}
}
-
diff --git a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp
index 93946997d8c..91fca84d519 100644
--- a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp
+++ b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp
@@ -7,6 +7,9 @@
#include "openvino/runtime/internal_properties.hpp"
#include "openvino/runtime/plugin_config.hpp"
#include "openvino/core/version.hpp"
+#include "openvino/core/memory_util.hpp"
+#include "openvino/util/memory.hpp"
+#include "openvino/util/mmap_object.hpp"
#include "intel_gpu/graph/serialization/binary_buffer.hpp"
#include "intel_gpu/runtime/engine_configuration.hpp"
@@ -17,6 +20,7 @@
#include <sstream>
#include <sys/types.h>
+#include <vector>
namespace ov::intel_gpu {
@@ -282,6 +286,14 @@ void CompiledModel::export_model(std::ostream& model) const {
}
get_graph(0)->export_model(ob);
+ if (!ob.is_encrypted() && m_config.get_enable_zero_copy_cache_load()) {
+ const auto pad =
+ ov::util::align_padding_size(static_cast<size_t>(ov::util::get_system_page_size()), ob.get_offset());
+ if (pad > 0) {
+ std::vector<uint8_t> zeros(pad, 0);
+ ob << cldnn::make_data(zeros.data(), zeros.size());
+ }
+ }
ob.flush();
}
diff --git a/src/plugins/intel_gpu/src/plugin/plugin.cpp b/src/plugins/intel_gpu/src/plugin/plugin.cpp
index 72320c19e8e..e0c7f0ddcfb 100644
--- a/src/plugins/intel_gpu/src/plugin/plugin.cpp
+++ b/src/plugins/intel_gpu/src/plugin/plugin.cpp
@@ -44,6 +44,7 @@
#include "openvino/runtime/weightless_properties_utils.hpp"
#include "openvino/util/env_util.hpp"
#include "openvino/util/file_util.hpp"
+#include "openvino/util/mmap_object.hpp"
#include "transformations/common_optimizations/dimension_tracking.hpp"
#include "transformations/init_node_info.hpp"
#include "transformations/rt_info/fused_names_attribute.hpp"
@@ -762,7 +763,8 @@ ov::Any Plugin::get_metric(const std::string& name, const ov::AnyMap& options) c
return decltype(ov::device::pci_info)::value_type {info};
}
if (name == ov::internal::cache_header_alignment) {
- return decltype(ov::internal::cache_header_alignment)::value_type{4096};
+ return decltype(ov::internal::cache_header_alignment)::value_type{
+ static_cast<decltype(ov::internal::cache_header_alignment)::value_type>(ov::util::get_system_page_size())};
}
if (name == ov::compatibility_check) {
if (auto it = options.find(ov::runtime_requirements.name()); it != options.end()) {
diff --git a/src/plugins/intel_gpu/src/runtime/ze/ze_device.cpp b/src/plugins/intel_gpu/src/runtime/ze/ze_device.cpp
index 4b528173e69..6b0ddb4623b 100644
--- a/src/plugins/intel_gpu/src/runtime/ze/ze_device.cpp
+++ b/src/plugins/intel_gpu/src/runtime/ze/ze_device.cpp
@@ -109,6 +109,8 @@ device_info init_device_info(ze_driver_handle_t driver, ze_device_handle_t devic
supports_extension(extensions, ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_NAME, ZEX_INTEL_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_VERSION_1_0);
bool supports_dp_properties =
supports_extension(extensions, ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_NAME, ZE_INTEL_DEVICE_MODULE_DP_PROPERTIES_EXP_VERSION_1_0);
+ bool supports_external_memmap_sysmem =
+ supports_extension(extensions, ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME, ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_1_0);
void *device_properties_next = nullptr;
ze_device_ip_version_ext_t ip_version_properties = {ZE_STRUCTURE_TYPE_DEVICE_IP_VERSION_EXT, device_properties_next, 0};
@@ -227,6 +229,7 @@ device_info init_device_info(ze_driver_handle_t driver, ze_device_handle_t devic
info.supports_usm = device_memory_access_properties.hostAllocCapabilities && device_memory_access_properties.deviceAllocCapabilities;
info.supports_leo = ze_ocl_interop::get_instance().check_support(device);
+ info.supports_external_memmap_sysmem = supports_external_memmap_sysmem;
// FIXME: Could not find how to retrieve those from ZE
info.supports_work_group_collective_functions = false;
diff --git a/src/plugins/intel_gpu/src/runtime/ze/ze_engine.cpp b/src/plugins/intel_gpu/src/runtime/ze/ze_engine.cpp
index 305d06e0e98..f2cc71bc0da 100644
--- a/src/plugins/intel_gpu/src/runtime/ze/ze_engine.cpp
+++ b/src/plugins/intel_gpu/src/runtime/ze/ze_engine.cpp
@@ -5,6 +5,8 @@
#include "ze_engine.hpp"
#include "intel_gpu/runtime/utils.hpp"
#include "openvino/core/except.hpp"
+#include "openvino/util/memory.hpp"
+#include "openvino/util/mmap_object.hpp"
#include "ze_kernel_builder.hpp"
#include "openvino/zero_api.hpp"
#include "ze_engine_factory.hpp"
@@ -176,11 +178,98 @@ memory_ptr ze_engine::create_subbuffer(const memory& memory, const layout& new_l
}
memory_ptr ze_engine::create_hostbuffer(void* cpu_address, size_t data_size, allocation_type _allocation_type, const layout output_layout) {
- OPENVINO_NOT_IMPLEMENTED;
+ return create_hostbuffer_impl(cpu_address, data_size, _allocation_type, output_layout, CL_MEM_READ_WRITE);
}
memory_ptr ze_engine::create_hostbuffer(const void* cpu_address, size_t data_size, allocation_type _allocation_type, const layout output_layout, bool host_read_only) {
- OPENVINO_NOT_IMPLEMENTED;
+ const cl_mem_flags flags = host_read_only ? (CL_MEM_READ_ONLY | CL_MEM_HOST_READ_ONLY) : CL_MEM_READ_ONLY;
+ return create_hostbuffer_impl(const_cast<void*>(cpu_address), data_size, _allocation_type, output_layout, flags);
+}
+
+memory_ptr ze_engine::create_hostbuffer_impl(void* cpu_address,
+ size_t data_size,
+ allocation_type allocation,
+ const layout& output_layout,
+ cl_mem_flags access_flags) {
+ const size_t minimal_alignment = static_cast<size_t>(get_device_info().cacheline_size.value_or(0));
+ OPENVINO_ASSERT(minimal_alignment > 0, "[GPU] cacheline_size must be > 0 for host pointer import");
+ OPENVINO_ASSERT(cpu_address != nullptr, "[GPU] shared buffer pointer is invalid");
+ OPENVINO_ASSERT((reinterpret_cast<std::uintptr_t>(cpu_address) % minimal_alignment) == 0,
+ "[GPU] shared buffer pointer must be ",
+ minimal_alignment,
+ "-byte aligned");
+ OPENVINO_ASSERT((data_size % minimal_alignment) == 0,
+ "[GPU] shared buffer size must be a multiple of ",
+ minimal_alignment,
+ " bytes");
+ const auto page_size = static_cast<size_t>(ov::util::get_system_page_size());
+ OPENVINO_ASSERT(page_size > 0, "[GPU] system page size must be > 0 for host pointer import");
+ OPENVINO_ASSERT((reinterpret_cast<std::uintptr_t>(cpu_address) % page_size) == 0,
+ "[GPU] shared buffer pointer must be ",
+ page_size,
+ "-byte page aligned");
+ OPENVINO_ASSERT((data_size % page_size) == 0,
+ "[GPU] shared buffer size must be a multiple of ",
+ page_size,
+ " bytes");
+
+ auto ctx = get_context();
+
+ // Prefer mapping the host pointer directly via the native ZE_extension_external_memmap_sysmem
+ // extension: it avoids the OpenCL interop round-trip (ze_export_ocl_context + clCreateBuffer +
+ // ze_import_usm) entirely. The extension requires the pointer and size to be page-aligned.
+ if (get_device_info().supports_external_memmap_sysmem) {
+ ze_external_memmap_sysmem_ext_desc_t sysmem_desc = {};
+ sysmem_desc.stype = ZE_STRUCTURE_TYPE_EXTERNAL_MEMMAP_SYSMEM_EXT_DESC;
+ sysmem_desc.pSystemMemory = cpu_address;
+ sysmem_desc.size = data_size;
+
+ ze_host_mem_alloc_desc_t host_desc = {};
+ host_desc.stype = ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;
+ host_desc.pNext = &sysmem_desc;
+ host_desc.flags = (access_flags & CL_MEM_READ_ONLY) ? ZE_HOST_MEM_ALLOC_FLAG_MEM_READ_ONLY : 0;
+
+ ov_ze_usm_handle usm_handle{ctx.handle(), nullptr};
+ OV_ZE_EXPECT(ze::zeMemAllocHost(usm_handle.context, &host_desc, data_size, 0, &usm_handle.ptr));
+ ze_usm_resource usm_resource(usm_handle);
+ OPENVINO_ASSERT(usm_handle.ptr == cpu_address,
+ "[GPU] zeMemAllocHost with external system memory mapping returned a different pointer than requested");
+ auto mem_tracker = std::make_shared<MemoryTracker>(nullptr, usm_handle.ptr, data_size, allocation);
+ auto memory = std::make_shared<ze::gpu_usm>(
+ this, output_layout, std::move(usm_resource), allocation, mem_tracker);
+ return memory;
+ }
+
+ OPENVINO_ASSERT(get_device_info().supports_leo,
+ "[GPU] Cannot import a host pointer: the device supports neither the native "
+ "ZE_extension_external_memory_mapping extension nor Level Zero - OpenCL interoperability (LEO), "
+ "which the OpenCL fallback path requires");
+
+ ze_export_ocl_context(ctx, get_device());
+ cl_int err = CL_SUCCESS;
+ cl_mem_flags flags = access_flags | CL_MEM_USE_HOST_PTR;
+#ifdef CL_MEM_FORCE_HOST_MEMORY_INTEL
+ flags |= CL_MEM_FORCE_HOST_MEMORY_INTEL;
+#endif
+ cl_mem ocl_buffer =
+ clCreateBuffer(ctx.ocl_handle<ocl_resource_type::context>(), flags, data_size, cpu_address, &err);
+#ifdef CL_MEM_FORCE_HOST_MEMORY_INTEL
+ OPENVINO_ASSERT(err == CL_SUCCESS && ocl_buffer != nullptr,
+ "[GPU] clCreateBuffer with CL_MEM_USE_HOST_PTR and CL_MEM_FORCE_HOST_MEMORY_INTEL failed: ",
+ err);
+#else
+ OPENVINO_ASSERT(err == CL_SUCCESS && ocl_buffer != nullptr,
+ "[GPU] clCreateBuffer with CL_MEM_USE_HOST_PTR failed: ",
+ err);
+#endif
+
+ auto imported_buffer = ze_import_usm(ocl_buffer, ctx, false);
+#ifdef CL_MEM_FORCE_HOST_MEMORY_INTEL
+ auto mem_tracker = std::make_shared<MemoryTracker>(nullptr, imported_buffer.handle().ptr, data_size, allocation);
+#else
+ auto mem_tracker = std::make_shared<MemoryTracker>(this, imported_buffer.handle().ptr, data_size, allocation);
+#endif
+ return std::make_shared<ze::gpu_usm>(this, output_layout, imported_buffer, allocation, mem_tracker);
}
bool ze_engine::is_the_same_buffer(const memory& mem1, const memory& mem2) {
diff --git a/src/plugins/intel_gpu/src/runtime/ze/ze_engine.hpp b/src/plugins/intel_gpu/src/runtime/ze/ze_engine.hpp
index 28744cdce67..775e8b529be 100644
--- a/src/plugins/intel_gpu/src/runtime/ze/ze_engine.hpp
+++ b/src/plugins/intel_gpu/src/runtime/ze/ze_engine.hpp
@@ -51,6 +51,13 @@ public:
#endif
static std::shared_ptr<cldnn::engine> create(const device::ptr device, runtime_types runtime_type);
+
+private:
+ memory_ptr create_hostbuffer_impl(void* cpu_address,
+ size_t data_size,
+ allocation_type allocation,
+ const layout& output_layout,
+ cl_mem_flags access_flags);
};
} // namespace ze
diff --git a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/l0_remote_tensor_tests.cpp b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/l0_remote_tensor_tests.cpp
new file mode 100644
index 00000000000..5251fe1112e
--- /dev/null
+++ b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/l0_remote_tensor_tests.cpp
@@ -0,0 +1,79 @@
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#ifdef OV_GPU_WITH_ZE_RT
+
+#include <algorithm>
+#include <memory>
+
+#include "openvino/op/parameter.hpp"
+#include "openvino/op/result.hpp"
+#include "openvino/runtime/core.hpp"
+#include "openvino/runtime/intel_gpu/properties.hpp"
+#include "openvino/runtime/intel_gpu/remote_properties.hpp"
+#include "openvino/runtime/remote_context.hpp"
+#include "openvino/util/memory.hpp"
+#include "openvino/util/mmap_object.hpp"
+
+#include "common_test_utils/test_common.hpp"
+
+namespace {
+std::shared_ptr<ov::Model> make_l0_copy_model(const ov::Shape& shape) {
+ auto input = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, shape);
+ auto result = std::make_shared<ov::op::v0::Result>(input);
+ return std::make_shared<ov::Model>(ov::ResultVector{result}, ov::ParameterVector{input});
+}
+} // namespace
+
+TEST(GpuRemoteTensorL0, smoke_allocAlignedCPUMemory) {
+ ov::Core core;
+ const std::string target_device = "GPU";
+ const auto page_size = static_cast<size_t>(ov::util::get_system_page_size());
+ ASSERT_GT(page_size, 0u);
+
+ const size_t float_size = sizeof(float);
+ const ov::Shape shape{page_size / float_size};
+ const size_t element_count = ov::shape_size(shape);
+ const size_t byte_size = element_count * sizeof(float);
+
+ void* input_ptr = ov::util::aligned_alloc(byte_size, page_size);
+ void* output_ptr = ov::util::aligned_alloc(byte_size, page_size);
+
+ std::fill_n(static_cast<float*>(input_ptr), element_count, 2.0f);
+ std::fill_n(static_cast<float*>(output_ptr), element_count, 0.0f);
+
+ {
+ auto context = core.get_default_context(target_device);
+ auto make_cpu_va_params = [](void* ptr, size_t size, ov::intel_gpu::AccessMode access) {
+ return ov::AnyMap{{ov::intel_gpu::shared_mem_type.name(), ov::intel_gpu::SharedMemType::CPU_VA},
+ {ov::intel_gpu::cpu_va.name(), static_cast<ov::intel_gpu::gpu_handle_param>(ptr)},
+ {ov::intel_gpu::cpu_va_size.name(), static_cast<int64_t>(size)},
+ {ov::intel_gpu::cpu_va_access.name(), access}};
+ };
+ auto remote_input_tensor =
+ context.create_tensor(ov::element::f32,
+ shape,
+ make_cpu_va_params(input_ptr, byte_size, ov::intel_gpu::AccessMode::READ));
+ auto remote_output_tensor =
+ context.create_tensor(ov::element::f32,
+ shape,
+ make_cpu_va_params(output_ptr, byte_size, ov::intel_gpu::AccessMode::READ_WRITE));
+
+ auto model = make_l0_copy_model(shape);
+ auto compiled = core.compile_model(model, context);
+ auto infer_req = compiled.create_infer_request();
+ infer_req.set_tensor(compiled.input(), remote_input_tensor);
+ infer_req.set_tensor(compiled.output(), remote_output_tensor);
+ infer_req.infer();
+
+ for (size_t i = 0; i < element_count; ++i) {
+ EXPECT_FLOAT_EQ(static_cast<float*>(output_ptr)[i], 2.0f) << "Mismatch at index " << i;
+ }
+ }
+
+ ov::util::aligned_free(input_ptr);
+ ov::util::aligned_free(output_ptr);
+}
+
+#endif // OV_GPU_WITH_ZE_RT
diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp
index 6ffeff83778..378ab71ba92 100644
--- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp
+++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp
@@ -4,9 +4,35 @@
#include "behavior/ov_plugin/caching_tests.hpp"
+#include <cstdlib>
+#include <filesystem>
+
+#include "openvino/pass/manager.hpp"
+#include "openvino/pass/serialize.hpp"
+#include "common_test_utils/file_utils.hpp"
+#include "functional_test_utils/skip_tests_config.hpp"
+#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp"
+
using namespace ov::test::behavior;
namespace {
+
+void set_env(const char* name, const char* value) {
+#ifdef _WIN32
+ _putenv_s(name, value);
+#else
+ ::setenv(name, value, 1);
+#endif
+}
+
+void unset_env(const char* name) {
+#ifdef _WIN32
+ _putenv_s(name, "");
+#else
+ ::unsetenv(name);
+#endif
+}
+
static const std::vector<ov::element::Type> precisionsGPU = {
ov::element::f32,
ov::element::f16,
@@ -56,6 +82,7 @@ const std::vector<ov::AnyMap> GPULoadFromFileConfigs = {
{ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)},
{},
};
+
INSTANTIATE_TEST_SUITE_P(smoke_CachingSupportCase_GPU,
CompileModelLoadFromFileTestBase,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_GPU),
@@ -78,6 +105,78 @@ INSTANTIATE_TEST_SUITE_P(smoke_CachingSupportCase_GPU,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::ValuesIn(GPULoadFromFileConfigs)),
CompileModelLoadFromCacheTest::getTestCaseName);
+
+class CompileModelZeroCopySingleFileCacheLoadTest : public testing::WithParamInterface<CompileModelLoadFromCacheParams>,
+ virtual public ov::test::SubgraphBaseTest,
+ virtual public OVPluginTestBase {
+public:
+ static std::string getTestCaseName(testing::TestParamInfo<CompileModelLoadFromCacheParams> obj) {
+ return CompileModelLoadFromCacheTest::getTestCaseName(obj);
+ }
+
+ void SetUp() override {
+ std::tie(targetDevice, configuration) = this->GetParam();
+ target_device = targetDevice;
+ APIBaseTest::SetUp();
+ set_env("OV_GPU_ENABLE_ZERO_COPY_CACHE_LOAD", "YES");
+
+ std::string filePrefix = ov::test::utils::generateTestFilePrefix();
+ m_modelName = filePrefix + ".xml";
+ m_weightsName = filePrefix + ".bin";
+ // ".bin" extension makes ov::CoreConfig::CacheConfig::create() pick
+ // ov::runtime::SingleFileStorage instead of the folder-based FileStorageCacheManager.
+ m_cacheFilePath = filePrefix + ".cache.bin";
+ std::filesystem::remove(m_cacheFilePath);
+
+ core->set_property(ov::cache_dir());
+ ov::pass::Manager manager;
+ manager.register_pass<ov::pass::Serialize>(m_modelName, m_weightsName);
+ manager.run_passes(ov::test::utils::make_conv_pool_relu({1, 3, 227, 227}, ov::element::f32));
+ }
+
+ void TearDown() override {
+ inferRequest = {};
+ compiledModel = {};
+
+ std::filesystem::remove(m_cacheFilePath);
+ ov::test::utils::removeIRFiles(m_modelName, m_weightsName);
+ core->set_property(ov::cache_dir());
+ ov::test::utils::PluginCache::get().reset();
+
+ unset_env("OV_GPU_ENABLE_ZERO_COPY_CACHE_LOAD");
+ APIBaseTest::TearDown();
+ }
+
+ void run() override {
+ SKIP_IF_CURRENT_TEST_IS_DISABLED();
+ core->set_property(ov::cache_dir(m_cacheFilePath));
+ compiledModel = core->compile_model(m_modelName, targetDevice, configuration);
+ EXPECT_EQ(false, compiledModel.get_property(ov::loaded_from_cache.name()).as<bool>());
+
+ std::stringstream strm;
+ compiledModel.export_model(strm);
+ ov::CompiledModel importedCompiledModel = core->import_model(strm, target_device, configuration);
+ EXPECT_EQ(false, importedCompiledModel.get_property(ov::loaded_from_cache.name()).as<bool>());
+
+ compiledModel = core->compile_model(m_modelName, targetDevice, configuration);
+ EXPECT_EQ(true, compiledModel.get_property(ov::loaded_from_cache.name()).as<bool>());
+ }
+
+private:
+ std::string m_modelName;
+ std::string m_weightsName;
+ std::string m_cacheFilePath;
+};
+
+TEST_P(CompileModelZeroCopySingleFileCacheLoadTest, CanLoadFromSingleFileCache) {
+ run();
+}
+
+INSTANTIATE_TEST_SUITE_P(smoke_ZeroCopySingleFileCacheLoad_GPU,
+ CompileModelZeroCopySingleFileCacheLoadTest,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_GPU),
+ ::testing::Values(ov::AnyMap{})),
+ CompileModelZeroCopySingleFileCacheLoadTest::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(smoke_CachingSupportCase_GPU,
CompileModelWithCacheEncryptionTest,
::testing::Values(ov::test::utils::DEVICE_GPU),