Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPU] Common shape info buffer. phase 1 #28167

Merged
merged 16 commits into from
Jan 14, 2025

Conversation

dnkurek
Copy link
Contributor

@dnkurek dnkurek commented Dec 20, 2024

Details:

  • Reduce memory usage
  • common buffer for shape info as the first step

Tickets:

  • ticket-id

@dnkurek dnkurek requested review from a team as code owners December 20, 2024 09:56
@dnkurek dnkurek marked this pull request as draft December 20, 2024 09:56
@github-actions github-actions bot added the category: GPU OpenVINO GPU plugin label Dec 20, 2024
@@ -215,6 +216,7 @@ struct network {
bool _is_dynamic = false;
bool _enable_profiling = false;
bool _reset_arguments;
memory::ptr _ptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to hold the pointer to the base buffer in the sub-buffer itself, thus their lifetimes will be better aligned

Comment on lines 926 to 928
void add_offset(size_t offsetPtr) const {
_usm_pointer->_ptr = (void*) ((unsigned char*) _usm_pointer->_ptr + offsetPtr);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we shouldn't expose this function because it allows shifting the pointer of any UsmMemory. This pointer is also used for free_mem() call, and I'm not sure it will be properly handled if shifted accidently for the not-shared memory buffer. Maybe it would be better to limit shifting only with specialized c-tr like UsmMemory(const cl::UsmHelper& usmHelper, void* usm_ptr, size_t offset = 0), which creates UsmHolder with shared_memory=true option

@dnkurek dnkurek marked this pull request as ready for review January 13, 2025 13:36
Copy link
Contributor

@vladimir-paramuzov vladimir-paramuzov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM

src/plugins/intel_gpu/src/graph/network.cpp Outdated Show resolved Hide resolved
src/plugins/intel_gpu/src/runtime/ocl/ocl_engine.cpp Outdated Show resolved Hide resolved
src/plugins/intel_gpu/src/graph/network.cpp Outdated Show resolved Hide resolved
src/plugins/intel_gpu/src/graph/network.cpp Outdated Show resolved Hide resolved
src/plugins/intel_gpu/src/graph/primitive_inst.cpp Outdated Show resolved Hide resolved
src/plugins/intel_gpu/src/runtime/ocl/ocl_ext.hpp Outdated Show resolved Hide resolved
Co-authored-by: Vladimir Paramuzov <vladimir.paramuzov@intel.com>
@p-durandin p-durandin changed the title [GPU][PoC] Common shape info buffer [GPU] Common shape info buffer. phase 1 Jan 14, 2025
@dnkurek dnkurek enabled auto-merge January 14, 2025 08:58
@dnkurek dnkurek added this pull request to the merge queue Jan 14, 2025
Merged via the queue into openvinotoolkit:master with commit d63a9df Jan 14, 2025
167 checks passed
@dnkurek dnkurek deleted the shape_info_test branch January 14, 2025 14:36
@dnkurek dnkurek mentioned this pull request Jan 15, 2025
3 tasks
MirceaDan99 pushed a commit to MirceaDan99/openvino that referenced this pull request Jan 22, 2025
### Details:
 - Reduce memory usage
 - common buffer for shape info as the first step

### Tickets:
 - *ticket-id*

---------

Co-authored-by: Vladimir Paramuzov <vladimir.paramuzov@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GPU OpenVINO GPU plugin Code Freeze
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants