Skip to content

Commit

Permalink
[GPU] Re-enable memory reuse for gemm (openvinotoolkit#23600)
Browse files Browse the repository at this point in the history
### Details:
- Since openvinotoolkit#22726 gemm is derived from multi-stage impl which had memory
reuse flag enforced to false for all sub-classes.
- This patch enables memory reuse back for gemm kernel to reduce memory
consumption.

### Tickets:
 - *135361*
  • Loading branch information
vladimir-paramuzov authored and bbielawx committed Apr 12, 2024
1 parent eb0a0a4 commit 58ccf47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/plugins/intel_gpu/src/graph/impls/ocl/gemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ struct gemm_impl : multi_stage_primitive<gemm> {
return make_unique<gemm_impl>(*this);
}

gemm_impl() = default;

gemm_impl(const std::vector<kernel_selector::kernel_data>& kd) : parent(kd) {
this->can_reuse_memory = true;
}

void load(BinaryInputBuffer& ib) override {
parent::load(ib);
if (is_dynamic()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct multi_stage_primitive : public typed_primitive_impl<PType> {
for (size_t k = 0; k < other._kernels.size(); ++k) {
_kernels.emplace_back(other._kernels[k]->clone());
}
this->can_reuse_memory = false;
this->can_reuse_memory = other.can_reuse_memory;
this->_kernel_name = other._kernel_name;
this->_is_dynamic = other._is_dynamic;
}
Expand Down

0 comments on commit 58ccf47

Please sign in to comment.