Skip to content

Commit 1b0b370

Browse files
Andy-Jostclaude
andcommitted
cuda.core: point the conditional-body limitation at issue NVIDIA#2918
An invalidated capture of a conditional body leaves the parent graph invalid, and ending the parent capture afterwards crashes inside the driver (NVIDIA#2918, a CUDA driver bug reproduced with the driver API alone). Say so in the end_building docstring and the release note instead of explaining the mechanism. Issue NVIDIA#2834 Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 5310cf3 commit 1b0b370

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎cuda_core/cuda/core/graph/_graph_builder.pyi‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,9 @@ class GraphBuilder:
228228
not permitted while capturing. The capture is ended and the
229229
builder holds no graph afterwards, so :meth:`complete` and
230230
:attr:`graph_definition` are unavailable. This applies to a
231-
top-level builder. The body builder of a conditional node cannot
232-
recover from an invalidated capture: the driver discards the body
233-
graph that the parent graph still refers to, so the parent
234-
builder's graph is invalid as well.
231+
top-level builder. An invalidated capture of a conditional body
232+
leaves the parent builder's graph invalid as well; ending it may
233+
crash the process (see issue #2918).
235234
"""
236235
def complete(self, options: GraphCompleteOptions | None=None) -> Graph:
237236
"""Completes the graph builder and returns the built :obj:`~graph.Graph` object.

‎cuda_core/cuda/core/graph/_graph_builder.pyx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,9 @@ cdef class GraphBuilder:
535535
not permitted while capturing. The capture is ended and the
536536
builder holds no graph afterwards, so :meth:`complete` and
537537
:attr:`graph_definition` are unavailable. This applies to a
538-
top-level builder. The body builder of a conditional node cannot
539-
recover from an invalidated capture: the driver discards the body
540-
graph that the parent graph still refers to, so the parent
541-
builder's graph is invalid as well.
538+
top-level builder. An invalidated capture of a conditional body
539+
leaves the parent builder's graph invalid as well; ending it may
540+
crash the process (see issue #2918).
542541
"""
543542
GB_check_open(self)
544543
if self._state != CAPTURING:

‎cuda_core/docs/source/release/1.3.0-notes.rst‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ Fixes and enhancements
6161
error, after which the builder holds no graph. A failed ``join`` also closes
6262
the forked builders it did not join. This does not extend to the body
6363
builder of a conditional node: an invalidated body capture leaves the parent
64-
graph invalid as well. Calling ``end_building`` on a forked builder is now
65-
rejected with ``RuntimeError``; forked builders are ended by ``join``.
64+
graph invalid as well, and ending it may crash the process
65+
(`#2918 <https://github.com/NVIDIA/cuda-python/issues/2918>`__). Calling
66+
``end_building`` on a forked builder is now rejected with ``RuntimeError``;
67+
forked builders are ended by ``join``.
6668
(`#2834 <https://github.com/NVIDIA/cuda-python/issues/2834>`__,
6769
`#2776 <https://github.com/NVIDIA/cuda-python/issues/2776>`__)
6870

0 commit comments

Comments
 (0)