Skip to content

Commit

Permalink
[GPU] clean oneDNN cache by release memory method (#27403)
Browse files Browse the repository at this point in the history
### Details:
 - Partial fix for https://jira.devtools.intel.com/browse/CVS-156022
 - explicit call for release memory is required

### Tickets:
 - *ticket-id*
  • Loading branch information
p-durandin authored Nov 5, 2024
1 parent 41b2093 commit 7cf2bbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class CompiledModel : public ov::ICompiledModel {
const std::vector<std::shared_ptr<Graph>>& get_graphs() const;
std::shared_ptr<Graph> get_graph(size_t n) const;

void release_memory() override;

private:
RemoteContextImpl::Ptr m_context;
ExecutionConfig m_config;
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/intel_gpu/src/plugin/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,13 @@ std::shared_ptr<ov::ISyncInferRequest> CompiledModel::create_sync_infer_request(
return std::make_shared<SyncInferRequest>(std::static_pointer_cast<const CompiledModel>(shared_from_this()));
}


void CompiledModel::release_memory() {
#ifdef ENABLE_ONEDNN_FOR_GPU
auto capacity = dnnl::get_primitive_cache_capacity();
dnnl::set_primitive_cache_capacity(0);
dnnl::set_primitive_cache_capacity(capacity);
#endif
}
} // namespace intel_gpu
} // namespace ov

0 comments on commit 7cf2bbb

Please sign in to comment.