Commit b9c76b3
authored
Implements GraphMemoryResource (#1235)
* Implement non-pooling memory allocation.
* Add GraphMemoryResource.
* Remove mempool_enabled option now that GraphMemoryResource is ready.
* Add docstring and make GraphMemoryResource a singleton.
* Move tests to a separate file.
* Add errors for DeviceMemoryResource and GraphMemoryResource when graph capture state is not as expected.
* Add tests for attributes and memory allocation escaping graphs.
* Simplify logic for converting IsStreamT arguments.
* Standardize Stream arguments to IsStreamT. Update Buffer and MemoryResource methods to take any kind of stream-providing object. Update graph allocation tests.
* Add tests for IsStreamT conversions.
* Expand files named _gmr.*. Add __eq__ and __hash__ support to StreamWrapper (testing only)
* Fix format/lint issues.
* Minor clean up.
* Change public signatures to accept "Stream | GraphBuiler" where only streams were accepted. Add a helper Stream_accept to accept Stream-like arguments throughout. Revert changes to Stream._init that relaxed acceptance criteria for first argument. Revert addition of StreamWrapper and associated tests. Suppress invalid context errors in deallocate to avoid noise during shutdown.
* Add deprecation warning when stream protocol is used with launch.
* Fix builds post-merge.
* Simplify GraphMemoryResourceAttributes.
* Simplify Stream_accept. Default arguments can more easily be handled outside that function.
* Adjust tests for platform-dependent behavior.
* Disable additional tests for platform-dependent behavior.
* Adjust deallocation stream for legacy memory resources to avoid platform-dependent errors. Add dependence on mempool_device where needed for certain tests. Touch-ups.1 parent b347255 commit b9c76b3
File tree
20 files changed
+740
-136
lines changed- cuda_core
- cuda/core/experimental
- _memory
- _utils
- tests
- helpers
20 files changed
+740
-136
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
1306 | 1306 | | |
1307 | 1307 | | |
1308 | 1308 | | |
1309 | | - | |
| 1309 | + | |
1310 | 1310 | | |
1311 | 1311 | | |
1312 | 1312 | | |
| |||
1333 | 1333 | | |
1334 | 1334 | | |
1335 | 1335 | | |
1336 | | - | |
1337 | | - | |
1338 | 1336 | | |
1339 | 1337 | | |
1340 | 1338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 7 | | |
11 | 8 | | |
12 | | - | |
13 | 9 | | |
14 | | - | |
| 10 | + | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| |||
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
42 | | - | |
| 38 | + | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
47 | 43 | | |
48 | | - | |
| 44 | + | |
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
| |||
58 | 54 | | |
59 | 55 | | |
60 | 56 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 57 | + | |
72 | 58 | | |
73 | 59 | | |
74 | 60 | | |
| |||
85 | 71 | | |
86 | 72 | | |
87 | 73 | | |
88 | | - | |
| 74 | + | |
89 | 75 | | |
90 | 76 | | |
91 | 77 | | |
92 | 78 | | |
93 | 79 | | |
94 | 80 | | |
95 | 81 | | |
96 | | - | |
| 82 | + | |
97 | 83 | | |
98 | 84 | | |
99 | 85 | | |
100 | 86 | | |
101 | | - | |
| 87 | + | |
102 | 88 | | |
103 | 89 | | |
104 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 135 | + | |
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
| |||
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
155 | | - | |
| 153 | + | |
156 | 154 | | |
157 | 155 | | |
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
162 | | - | |
| 160 | + | |
163 | 161 | | |
164 | 162 | | |
165 | 163 | | |
166 | 164 | | |
167 | | - | |
168 | | - | |
169 | | - | |
| 165 | + | |
170 | 166 | | |
171 | 167 | | |
172 | 168 | | |
| |||
274 | 270 | | |
275 | 271 | | |
276 | 272 | | |
277 | | - | |
| 273 | + | |
278 | 274 | | |
279 | 275 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 276 | + | |
288 | 277 | | |
289 | 278 | | |
290 | 279 | | |
| |||
305 | 294 | | |
306 | 295 | | |
307 | 296 | | |
308 | | - | |
| 297 | + | |
309 | 298 | | |
310 | 299 | | |
311 | 300 | | |
312 | 301 | | |
313 | 302 | | |
314 | 303 | | |
315 | | - | |
| 304 | + | |
316 | 305 | | |
317 | 306 | | |
318 | 307 | | |
| |||
326 | 315 | | |
327 | 316 | | |
328 | 317 | | |
329 | | - | |
| 318 | + | |
330 | 319 | | |
331 | 320 | | |
332 | 321 | | |
| |||
335 | 324 | | |
336 | 325 | | |
337 | 326 | | |
338 | | - | |
| 327 | + | |
339 | 328 | | |
340 | 329 | | |
341 | 330 | | |
| |||
Lines changed: 35 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
| |||
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
136 | | - | |
| 142 | + | |
137 | 143 | | |
138 | 144 | | |
139 | 145 | | |
| |||
309 | 315 | | |
310 | 316 | | |
311 | 317 | | |
312 | | - | |
| 318 | + | |
313 | 319 | | |
314 | 320 | | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
318 | 324 | | |
319 | | - | |
| 325 | + | |
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
| |||
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
331 | | - | |
332 | | - | |
333 | | - | |
| 337 | + | |
| 338 | + | |
334 | 339 | | |
335 | | - | |
| 340 | + | |
336 | 341 | | |
337 | 342 | | |
338 | 343 | | |
| |||
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
344 | | - | |
| 349 | + | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
348 | 353 | | |
349 | | - | |
| 354 | + | |
| 355 | + | |
350 | 356 | | |
351 | 357 | | |
352 | 358 | | |
| 359 | + | |
353 | 360 | | |
354 | 361 | | |
355 | 362 | | |
| |||
467 | 474 | | |
468 | 475 | | |
469 | 476 | | |
470 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
471 | 488 | | |
472 | 489 | | |
473 | 490 | | |
| 491 | + | |
474 | 492 | | |
475 | 493 | | |
476 | 494 | | |
| |||
481 | 499 | | |
482 | 500 | | |
483 | 501 | | |
484 | | - | |
| 502 | + | |
485 | 503 | | |
486 | 504 | | |
487 | 505 | | |
488 | 506 | | |
| 507 | + | |
489 | 508 | | |
490 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
491 | 512 | | |
492 | 513 | | |
493 | | - | |
| 514 | + | |
494 | 515 | | |
495 | 516 | | |
496 | 517 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments