From 4bd04dae3b12a522ae0c688857b1ec5bb7bdfc08 Mon Sep 17 00:00:00 2001 From: "Kim, Mingyu" Date: Fri, 1 Nov 2024 05:52:26 +0900 Subject: [PATCH] [GPU] More test for weightless model cache --- .../tests/functional/behavior/model_cache.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp b/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp index 880868d8666560..bcce69a934c787 100644 --- a/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp +++ b/src/plugins/intel_gpu/tests/functional/behavior/model_cache.cpp @@ -96,6 +96,22 @@ void CheckWeightlessCacheAccuracy::run() { auto new_out = new_req.get_tensor(res); ov::test::utils::compare(orig_out, new_out); } + + { + // for functionality check of non-weightless flow + ov::AnyMap config_without_weightless_cache = { ov::cache_mode(ov::CacheMode::OPTIMIZE_SPEED) }; + ov::CompiledModel compiled_model; + OV_ASSERT_NO_THROW(compiled_model = core->compile_model(xml_path, ov::test::utils::DEVICE_GPU, config_without_weightless_cache)); + + auto ofstr = std::ofstream(cache_path, std::ofstream::binary); + OV_ASSERT_NO_THROW(compiled_model.export_model(ofstr)); + ofstr.close(); + + auto ifstr = std::ifstream(cache_path, std::ifstream::binary); + ov::CompiledModel imported_model; + OV_ASSERT_NO_THROW(imported_model = core->import_model(ifstr, ov::test::utils::DEVICE_GPU, config_without_weightless_cache)); + ifstr.close(); + } } TEST_F(CheckWeightlessCacheAccuracy, ReadConcatSplitAssign) {