[GPU] Enable zero-copy subbuffers for usm_device on iGPUs#36645
[GPU] Enable zero-copy subbuffers for usm_device on iGPUs#36645Prithviraj-R wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Intel GPU cache serialization/deserialization for cldnn::data weights to broaden zero-copy subbuffer usage (xe2+ iGPU) and to apply sub-buffer alignment padding more consistently.
Changes:
- Move sub-buffer padding logic to be applied outside the host-accessible branch in save/load paths.
- Relax zero-copy enablement conditions (xe2+ integrated GPU + mmap alignment + non-weightless).
- Simplify branching in
load_weights().
0ecb60b to
05d98be
Compare
05d98be to
86d28cc
Compare
1dd8ab4 to
556df4f
Compare
4a4a190 to
ae5b220
Compare
8835f47 to
c6d708d
Compare
|
@Prithviraj-R , please update the PR description. The PR body lists 12 changed files (incl. ze_engine.* , sycl_engine.* , ocl_engine.hpp ) and claims CACHE_PAGE_SIZE was moved to memory_caps.hpp , but the diff touches 7 files and the constant is simply deleted (no references remain, so no build break) |
c2fec9f to
c122efa
Compare
|
@Prithviraj-R please take a look on L0 related errors. They look not a random |
5e1790e to
e086125
Compare
acf8db0 to
e0a1663
Compare
#### Details: Description of the issue (symptom, root-cause, how it was resolved) - Zero-copy handling for `usm_host` and `usm_shared` was already implemented in earlier PRs (openvinotoolkit#34494, openvinotoolkit#36539); this PR focuses on closing the `usm_device` gap. - Previously, for `usm_device` allocations, a separate GPU `usm_device` buffer was allocated and filled from mapped host buffer data during cache load, causing duplicate allocation/copy overhead and increasing inference memory footprint. - This change enables zero-copy subbuffer usage for supported XE2+ iGPUs in the `usm_device` flow, removing extra staging/copy in applicable cases. - Blob offset alignment handling in deserialization is kept correct for subbuffer creation. Implementation changes: - Extend zero-copy eligibility in `data.hpp` to include `usm_device` while preserving existing `usm_host`/`usm_shared` behavior. - Add/use helper check for zero-copy-capable device (XE2+ integrated GPU). - Use `seek_current_ptr()` for padding skip during deserialization alignment. - Refine zero-copy condition naming/readability in load path. Changed files: src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp src/plugins/intel_gpu/include/intel_gpu/runtime/device_info.hpp src/plugins/intel_gpu/src/graph/program.cpp src/plugins/intel_gpu/src/runtime/ocl/ocl_device.cpp src/plugins/intel_gpu/src/runtime/ocl/ocl_engine.cpp src/plugins/intel_gpu/tests/unit/test_cases/cache_serialization_test.cpp Reproduction step and snapshot (if applicable. Do not attach for customer model) NA Problematic graph NA #### Checklist - [x] Is it a proper fix? Yes (removes duplicate `usm_device` staging/copy in supported zero-copy cases) - [x] Did you include test case for this fix, if necessary? NA - [x] Did you review existing test that can be extended to cover this scenario? NA #### Tickets: - CVS-176160 #### AI Assistance: - AI assistance used: yes - AI was used for wording refinement and commit message cleanup.
e0a1663 to
aba5074
Compare
@p-durandin fixed. |
@maxnick fixed |
[GPU] Enable zero-copy subbuffers for usm_device on iGPUs
Details:
Description of the issue (symptom, root-cause, how it was resolved)
usm_hostandusm_sharedwas already implemented inearlier PRs ([GPU] Enable mmap for loading model weights on iGPUs #34494, [GPU] Support CPU pointers on remote tensor #36539); this PR focuses on closing the
usm_devicegap.usm_deviceallocations, a separate GPUusm_devicebufferwas allocated and filled from mapped host buffer data during cache load,
causing duplicate allocation/copy overhead and increasing inference memory
footprint.
usm_deviceflow, removing extra staging/copy in applicable cases.subbuffer creation.
Implementation changes:
data.hppto includeusm_devicewhilepreserving existing
usm_host/usm_sharedbehavior.seek_current_ptr()for padding skip during deserialization alignment.Changed files:
src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp
src/plugins/intel_gpu/include/intel_gpu/primitives/data.hpp
src/plugins/intel_gpu/include/intel_gpu/runtime/device_info.hpp
src/plugins/intel_gpu/src/graph/program.cpp
src/plugins/intel_gpu/src/runtime/ocl/ocl_device.cpp
src/plugins/intel_gpu/src/runtime/ocl/ocl_engine.cpp
src/plugins/intel_gpu/tests/unit/test_cases/cache_serialization_test.cpp
Reproduction step and snapshot (if applicable. Do not attach for customer model)
NA
Problematic graph
NA
Checklist
usm_devicestaging/copy insupported zero-copy cases)
NA
Tickets:
AI Assistance: