Skip to content

Commit 45c9a18

Browse files
committed
Small changes
1 parent 527debf commit 45c9a18

9 files changed

Lines changed: 39 additions & 14 deletions

File tree

‎cuda_core/cuda/core/_module.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ class KernelAttributes:
9999
"""int : The block scheduling policy of a function."""
100100
@property
101101
def device_node_update_supported(self) -> bool:
102-
"""bool : Whether this kernel supports device-side graph node updates.
102+
"""bool : Whether this kernel can be the target of device-side graph node updates.
103103
104-
Requires the CUDA 13 build and CUDA driver 13.3 or newer.
104+
Requires CUDA 13 build and CUDA driver 13.3+.
105105
This attribute is read-only.
106106
"""
107107

‎cuda_core/cuda/core/_module.pyx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ cdef class KernelAttributes:
237237

238238
@property
239239
def device_node_update_supported(self) -> bool:
240-
"""bool : Whether this kernel supports device-side graph node updates.
240+
"""bool : Whether this kernel can be the target of device-side graph node updates.
241241

242-
Requires the CUDA 13 build and CUDA driver 13.3 or newer.
242+
Requires CUDA 13 build and CUDA driver 13.3+.
243243
This attribute is read-only.
244244
"""
245245
IF CUDA_CORE_BUILD_MAJOR >= 13:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class GraphDefinition:
6767
def id(self) -> int:
6868
"""The driver-assigned graph ID, as used in GraphViz DOT output.
6969
70-
Requires the CUDA 13 build and CUDA driver 13.1 or newer.
70+
Requires CUDA 13 build and driver 13.1+
7171
"""
7272
@property
7373
def is_valid(self) -> bool:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ cdef class GraphDefinition:
151151
def id(self) -> int:
152152
"""The driver-assigned graph ID, as used in GraphViz DOT output.
153153

154-
Requires the CUDA 13 build and CUDA driver 13.1 or newer.
154+
Requires CUDA 13 build and driver 13.1+
155155
"""
156156
GD_check_valid(self)
157157
IF CUDA_CORE_BUILD_MAJOR >= 13:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ class GraphNode:
4545
@property
4646
def local_id(self) -> int:
4747
"""The node's ID within its graph.
48+
49+
Requires CUDA 13 build and driver 13.1+
4850
"""
4951
@property
5052
def tools_id(self) -> int:
5153
"""The node's ID reported by CUDA profiling and tooling interfaces.
54+
55+
Requires CUDA 13 build and driver 13.1+
5256
"""
5357
@property
5458
def graph(self) -> GraphDefinition:

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,36 +150,40 @@ cdef class GraphNode:
150150
@property
151151
def local_id(self) -> int:
152152
"""The node's ID within its graph.
153+
154+
Requires CUDA 13 build and driver 13.1+
153155
"""
154156
GN_check_valid(self)
155157
if self._is_entry:
156158
raise ValueError("The entry node has no driver-assigned ID")
157159
IF CUDA_CORE_BUILD_MAJOR >= 13:
158160
cdef unsigned int node_id
159161
if cy_driver_version() < (13, 1, 0):
160-
raise NotImplementedError("Graph node IDs require CUDA driver 13.1 or newer")
162+
raise NotImplementedError("Graph IDs require a CUDA 13 build of cuda.core and CUDA driver 13.1 or newer")
161163
with nogil:
162164
HANDLE_RETURN(cydriver.cuGraphNodeGetLocalId(as_cu(self._h_node), &node_id))
163165
return node_id
164166
ELSE:
165-
raise NotImplementedError("Graph node IDs require CUDA driver 13.1 or newer")
167+
raise NotImplementedError("Graph IDs require a CUDA 13 build of cuda.core and CUDA driver 13.1 or newer")
166168

167169
@property
168170
def tools_id(self) -> int:
169171
"""The node's ID reported by CUDA profiling and tooling interfaces.
172+
173+
Requires CUDA 13 build and driver 13.1+
170174
"""
171175
GN_check_valid(self)
172176
if self._is_entry:
173177
raise ValueError("The entry node has no driver-assigned ID")
174178
IF CUDA_CORE_BUILD_MAJOR >= 13:
175179
cdef unsigned long long node_id
176180
if cy_driver_version() < (13, 1, 0):
177-
raise NotImplementedError("Graph node IDs require CUDA driver 13.1 or newer")
181+
raise NotImplementedError("Graph IDs require a CUDA 13 build of cuda.core and CUDA driver 13.1 or newer")
178182
with nogil:
179183
HANDLE_RETURN(cydriver.cuGraphNodeGetToolsId(as_cu(self._h_node), &node_id))
180184
return node_id
181185
ELSE:
182-
raise NotImplementedError("Graph node IDs require CUDA driver 13.1 or newer")
186+
raise NotImplementedError("Graph IDs require a CUDA 13 build of cuda.core and CUDA driver 13.1 or newer")
183187

184188
@property
185189
def graph(self) -> GraphDefinition:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ New features
4646
------------
4747

4848
- Added read-only ``GraphDefinition.id``, ``Graph.id``, ``GraphNode.local_id``
49-
and ``GraphNode.tools_id`` properties (CUDA 13.1+), and
50-
``KernelAttributes.device_node_update_supported`` (CUDA 13.3+).
49+
and ``GraphNode.tools_id`` properties (CUDA 13 build and driver 13.1+), and
50+
``KernelAttributes.device_node_update_supported`` (CUDA 13 build and driver 13.3+).
5151
The existing ``GraphNode.graph`` property provides containing-graph navigation.
5252
(`#2360 <https://github.com/NVIDIA/cuda-python/issues/2360>`__)
5353

‎cuda_core/tests/graph/test_graph_definition.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,19 +812,23 @@ def test_graphdef_handle_valid(init_cuda):
812812

813813

814814
def test_graph_identity_attributes(init_cuda):
815-
from cuda.core._utils.version import driver_version
815+
from cuda.core._utils.version import BUILD_CUDA_MAJOR, driver_version
816816

817817
definition = GraphDefinition()
818818
node = definition.empty()
819819
other = definition.empty()
820820
graph = definition.instantiate()
821821

822822
try:
823-
if driver_version() < (13, 1, 0):
823+
if BUILD_CUDA_MAJOR < 13 or driver_version() < (13, 1, 0):
824824
with pytest.raises(NotImplementedError):
825825
_ = definition.id
826826
with pytest.raises(NotImplementedError):
827827
_ = graph.id
828+
with pytest.raises(NotImplementedError):
829+
_ = node.local_id
830+
with pytest.raises(NotImplementedError):
831+
_ = node.tools_id
828832
return
829833
assert isinstance(definition.id, int)
830834
assert isinstance(graph.id, int)

‎cuda_core/tests/test_module.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,19 @@ def test_read_only_kernel_attributes(get_saxpy_kernel_cubin, attr, expected_type
345345
assert isinstance(value, expected_type), f"Expected {attr} to be of type {expected_type}, but got {type(value)}"
346346

347347

348+
def test_device_node_update_supported(get_saxpy_kernel_cubin):
349+
from cuda.core._utils.version import BUILD_CUDA_MAJOR, driver_version
350+
351+
kernel, _ = get_saxpy_kernel_cubin
352+
353+
for device in Device.get_all_devices():
354+
if BUILD_CUDA_MAJOR < 13 or driver_version() < (13, 3, 0):
355+
with pytest.raises(NotImplementedError):
356+
_ = kernel.attributes[device].device_node_update_supported
357+
else:
358+
assert isinstance(kernel.attributes[device].device_node_update_supported, bool)
359+
360+
348361
def test_object_code_load_ptx(get_saxpy_kernel_ptx):
349362
ptx, mod = get_saxpy_kernel_ptx
350363
sym_map = mod.symbol_mapping

0 commit comments

Comments
 (0)