Commit f9b3e5b
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 ea600b7 commit f9b3e5b
7 files changed
Lines changed: 77 additions & 79 deletions
File tree
- src/plugins/intel_gpu
- include/intel_gpu
- graph/serialization
- primitives
- runtime
- src
- graph
- runtime/ocl
- tests/unit/test_cases
Lines changed: 15 additions & 40 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 | 57 | | |
68 | | - | |
69 | | - | |
| 58 | + | |
| 59 | + | |
70 | 60 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 61 | + | |
| 62 | + | |
78 | 63 | | |
79 | 64 | | |
80 | 65 | | |
| |||
117 | 102 | | |
118 | 103 | | |
119 | 104 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 105 | | |
128 | | - | |
| 106 | + | |
129 | 107 | | |
130 | 108 | | |
131 | 109 | | |
| |||
142 | 120 | | |
143 | 121 | | |
144 | 122 | | |
145 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
146 | 129 | | |
147 | 130 | | |
148 | 131 | | |
149 | 132 | | |
150 | 133 | | |
151 | 134 | | |
152 | 135 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | 136 | | |
161 | | - | |
162 | | - | |
| 137 | + | |
| 138 | + | |
163 | 139 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 140 | + | |
| 141 | + | |
167 | 142 | | |
168 | 143 | | |
169 | 144 | | |
| |||
Lines changed: 25 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
393 | 397 | | |
394 | 398 | | |
395 | 399 | | |
| 400 | + | |
| 401 | + | |
396 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
397 | 408 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | 409 | | |
403 | 410 | | |
404 | 411 | | |
| |||
414 | 421 | | |
415 | 422 | | |
416 | 423 | | |
417 | | - | |
| 424 | + | |
418 | 425 | | |
419 | 426 | | |
420 | 427 | | |
| |||
430 | 437 | | |
431 | 438 | | |
432 | 439 | | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
439 | 444 | | |
440 | 445 | | |
441 | 446 | | |
442 | 447 | | |
443 | 448 | | |
444 | 449 | | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
455 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
456 | 460 | | |
457 | 461 | | |
458 | 462 | | |
| |||
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: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
335 | 344 | | |
336 | 345 | | |
337 | 346 | | |
| |||
0 commit comments