Commit e0a1663
committed
[GPU] Enable zero-copy subbuffers for usm_device on iGPUs
#### 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.1 parent 3902b4a commit e0a1663
7 files changed
Lines changed: 75 additions & 78 deletions
File tree
- src/plugins/intel_gpu
- include/intel_gpu
- graph/serialization
- primitives
- runtime
- src
- graph
- runtime/ocl
- tests/unit/test_cases
Lines changed: 12 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 17 | | |
25 | 18 | | |
26 | 19 | | |
| |||
61 | 54 | | |
62 | 55 | | |
63 | 56 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 57 | + | |
| 58 | + | |
70 | 59 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 60 | + | |
| 61 | + | |
78 | 62 | | |
79 | 63 | | |
80 | 64 | | |
| |||
117 | 101 | | |
118 | 102 | | |
119 | 103 | | |
120 | | - | |
| 104 | + | |
121 | 105 | | |
122 | 106 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 107 | + | |
| 108 | + | |
126 | 109 | | |
127 | | - | |
128 | | - | |
| 110 | + | |
129 | 111 | | |
130 | 112 | | |
131 | 113 | | |
| |||
142 | 124 | | |
143 | 125 | | |
144 | 126 | | |
145 | | - | |
146 | 127 | | |
147 | 128 | | |
148 | 129 | | |
149 | 130 | | |
150 | 131 | | |
151 | 132 | | |
152 | 133 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | 134 | | |
157 | | - | |
158 | | - | |
| 135 | + | |
| 136 | + | |
159 | 137 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 138 | + | |
| 139 | + | |
167 | 140 | | |
168 | 141 | | |
169 | 142 | | |
| |||
Lines changed: 27 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
393 | 398 | | |
394 | 399 | | |
395 | 400 | | |
| 401 | + | |
| 402 | + | |
396 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
397 | 409 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | 410 | | |
403 | 411 | | |
404 | 412 | | |
| |||
414 | 422 | | |
415 | 423 | | |
416 | 424 | | |
417 | | - | |
| 425 | + | |
418 | 426 | | |
419 | 427 | | |
420 | 428 | | |
| |||
430 | 438 | | |
431 | 439 | | |
432 | 440 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
439 | 446 | | |
440 | 447 | | |
441 | 448 | | |
442 | 449 | | |
443 | 450 | | |
444 | 451 | | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
455 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
456 | 462 | | |
457 | 463 | | |
458 | 464 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
1985 | 1986 | | |
1986 | 1987 | | |
1987 | 1988 | | |
1988 | | - | |
1989 | | - | |
1990 | | - | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
1991 | 1993 | | |
1992 | 1994 | | |
1993 | 1995 | | |
| |||
2017 | 2019 | | |
2018 | 2020 | | |
2019 | 2021 | | |
2020 | | - | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
2024 | | - | |
2025 | | - | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
2026 | 2034 | | |
2027 | 2035 | | |
2028 | 2036 | | |
| |||
2055 | 2063 | | |
2056 | 2064 | | |
2057 | 2065 | | |
2058 | | - | |
| 2066 | + | |
2059 | 2067 | | |
2060 | 2068 | | |
2061 | 2069 | | |
| |||
2214 | 2222 | | |
2215 | 2223 | | |
2216 | 2224 | | |
2217 | | - | |
2218 | | - | |
2219 | | - | |
2220 | | - | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
2221 | 2228 | | |
2222 | 2229 | | |
2223 | 2230 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
| 383 | + | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
332 | 339 | | |
333 | | - | |
334 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
335 | 343 | | |
336 | 344 | | |
337 | 345 | | |
| |||
0 commit comments