Commit 8b55a6c
authored
* cuda.core: address naming-audit items from #1945
Apply the in-scope renames from the issue checklist. Each change is
described in the 1.0.0 release notes' Breaking changes section.
Property conversions (no-arg deterministic getters):
Buffer.get_ipc_descriptor() -> Buffer.ipc_descriptor
Event.get_ipc_descriptor() -> Event.ipc_descriptor
DeviceMemoryResource.get_allocation_handle() -> .allocation_handle
PinnedMemoryResource.get_allocation_handle() -> .allocation_handle
Boolean / non-noun properties (renamed for clarity, polarity fixed):
LaunchConfig.cooperative_launch -> .is_cooperative
Event.is_timing_disabled -> .is_timing_enabled
Event.is_sync_busy_waited -> .uses_blocking_sync
EventOptions.busy_waited_sync -> .use_blocking_sync
The Event boolean rename also corrects a long-standing inversion in the
underlying handle module: the C++ field/accessor pair stored
"BLOCKING_SYNC is set" but was named "busy_waited", which is the
opposite of what the flag actually does. The new name (and the public
property) match CUDA's terminology directly.
Graph allocation method consistency (matches MemoryResource):
GraphDefinition.alloc() -> .allocate()
GraphDefinition.free() -> .deallocate()
GraphNode.alloc() -> .allocate()
GraphNode.free() -> .deallocate()
Cross-API consistency for graph builders:
GraphBuilder.add_child() -> .embed()
GraphDefinition.record_event() / .wait_event() -> .record() / .wait()
GraphNode.record_event() / .wait_event() -> .record() / .wait()
Also updates the underlying handle layer to match the renamed public
properties:
C++ EventBox.timing_disabled -> .timing_enabled (polarity flipped)
C++ EventBox.busy_waited -> .uses_blocking_sync
C++ get_event_timing_disabled -> get_event_timing_enabled
C++ get_event_busy_waited -> get_event_uses_blocking_sync
Cython mirrors in _resource_handles.{pxd,pyx}
IPCEventDescriptor._busy_waited -> ._uses_blocking_sync
Historical references to renamed/removed names in 0.3.0 and 0.4.0
release notes are converted to inline literals so latest-only Sphinx
builds do not break.
Out of scope (deferred):
- KernelAttributes redesign (separate design PR)
- Conditional API rework (create_condition unification, if_then,
GraphCondition.__int__) -- separate work in progress on this branch
- DeviceProperties.cooperative_launch (pending team discussion)
- All system/* and fan items (Mike)
Made-with: Cursor
* cuda.core: unify conditional graph API (#1945)
GraphBuilder, GraphDefinition, and GraphNode now share one conditional
vocabulary. The factory returns a GraphCondition (no raw handle on the
public surface), the conditional-node verbs are consistent, and a
GraphCondition can be passed straight to launch().
Public API changes:
GraphBuilder.create_conditional_handle() -> .create_condition()
Returns GraphCondition (matches GraphDefinition.create_condition).
The four conditional builder methods (if_then, if_else, while_loop,
switch) on GraphBuilder now accept GraphCondition instead of a raw
CUgraphConditionalHandle, and they validate the argument type.
GraphBuilder.if_cond() -> .if_then()
GraphDefinition.if_cond() -> .if_then()
GraphNode.if_cond() -> .if_then()
The new name parallels if_else / while_loop / switch (verb
describing the construct) and matches Python's if/then/else.
GraphCondition.__int__ (new)
Returns the underlying CUgraphConditionalHandle value, so a
GraphCondition can be passed directly as a kernel argument.
_kernel_arg_handler grew an explicit GraphCondition fast path that
packs it as CUgraphConditionalHandle, mirroring the existing
driver.CUgraphConditionalHandle case.
Internals:
GraphCondition._from_handle (static cdef factory) keeps the
GraphBuilder and GraphDefinition implementations of create_condition
on the same construction path.
Tests updated to use the new flow throughout, including passing
GraphCondition directly to set_handle / countdown kernels rather than
extracting .handle.
Made-with: Cursor
* cuda.core: KernelAttributes are properties; per-device via indexing (#1945)
Replace the 16 (device_id) accessor methods on KernelAttributes with
properties, and expose per-device queries via __getitem__:
Old: kernel.attributes.num_regs()
kernel.attributes.num_regs(dev)
New: kernel.attributes.num_regs # current device
kernel.attributes[dev].num_regs # specific device
The default view returned by Kernel.attributes is bound to the current
device (resolved at attribute-access time, so it follows context
changes). Indexing returns a sibling view bound to the given Device or
device ordinal; the underlying cache (keyed by (device_id, attr_enum))
is shared across views of the same kernel, so a value queried through
one view is visible through the others.
Internals:
_device_id == -1 sentinel marks the "current device" view.
_effective_device_id() resolves it via Device().device_id per access.
_view_for_device() builds a sibling view that aliases _cache.
_resolve_device_id() is removed (no longer needed).
The 6 in-tree call sites (5 in test_module.py, 3 in
test_graph_definition_lifetime.py) just drop the (); two new tests
exercise the per-device view shape and reject invalid device arguments.
Made-with: Cursor
* fix: update test_read_only_kernel_attributes for property API (#1945)
The parametrized test in test_module.py exercised the previous
KernelAttributes(method, optional device_id) shape via getattr() +
call. Rewrite it to use property access on the default view and on
the per-device views returned by kernel.attributes[device], for both
Device-object and ordinal-int forms. Type-check the value at every
access path rather than just the last one.
Made-with: Cursor
* cuda.core: remove GraphCondition.__int__ (#1945)
Address review feedback on #1986: drop the implicit int() conversion on
GraphCondition. Passing a GraphCondition directly to launch() is still
supported; the kernel-arg handler now reaches into _c_handle directly
instead of going through __int__.
Made-with: Cursor
* cuda.core: rename EventOptions to bare-adjective form (#1945)
Address review feedback on #1986: align EventOptions field names with
the convention used elsewhere in the API (option name = bare adjective,
property name = is_/uses_ prefix).
- EventOptions.enable_timing -> EventOptions.timing_enabled
(matches Event.is_timing_enabled)
- EventOptions.use_blocking_sync -> EventOptions.blocking_sync
(matches Event.uses_blocking_sync)
Same pattern as ipc_enabled / Event.is_ipc_enabled and
StreamOptions.nonblocking / Stream.is_nonblocking.
Made-with: Cursor
* cuda.core: rename Event.uses_blocking_sync to is_blocking_sync (#1945)
Adopt the is_-prefix convention used everywhere else (is_ipc_enabled,
is_timing_enabled, is_nonblocking) and eliminate the lone uses_- form.
Keep the _sync suffix so the name disambiguates from Stream's separate
"blocking" concept and stays close to the underlying CU_EVENT_BLOCKING_SYNC
driver flag.
EventOptions.blocking_sync is unchanged.
Made-with: Cursor
* cuda.core: fix int(condition) call sites missed when removing GraphCondition.__int__ (#1945)
The conditional builder methods (if_then, if_else, switch, while_loop)
were still calling int(condition) on the GraphCondition object after
__int__ was removed in the prior commit. Use the public .handle property
instead, which mirrors the kernel argument handler fix.
This was caught by CI: 26 conditional graph tests failed with
TypeError in cuda/core/graph/_graph_builder.pyx:549.
Made-with: Cursor
1 parent 7f32b39 commit 8b55a6c
43 files changed
Lines changed: 680 additions & 469 deletions
File tree
- cuda_core
- cuda/core
- _cpp
- _memory
- graph
- docs/source/release
- tests
- graph
- memory_ipc
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
| 356 | + | |
| 357 | + | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | | - | |
| 371 | + | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
376 | | - | |
| 375 | + | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
| 404 | + | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
| 237 | + | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | | - | |
110 | | - | |
| 109 | + | |
| 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 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | | - | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | | - | |
200 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
209 | | - | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
| |||
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
218 | | - | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
234 | 236 | | |
235 | 237 | | |
236 | | - | |
237 | | - | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
| |||
302 | 305 | | |
303 | 306 | | |
304 | 307 | | |
305 | | - | |
| 308 | + | |
306 | 309 | | |
307 | 310 | | |
308 | 311 | | |
309 | 312 | | |
310 | 313 | | |
311 | | - | |
| 314 | + | |
312 | 315 | | |
313 | 316 | | |
314 | | - | |
| 317 | + | |
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
318 | | - | |
| 321 | + | |
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
322 | | - | |
| 325 | + | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
327 | | - | |
| 330 | + | |
328 | 331 | | |
329 | 332 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
321 | 327 | | |
322 | 328 | | |
323 | 329 | | |
| |||
341 | 347 | | |
342 | 348 | | |
343 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
344 | 355 | | |
345 | 356 | | |
346 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments