Skip to content

Commit 44e0197

Browse files
committed
Fix NvlinkInfo max_links replacement guidance
1. Review finding: NvlinkInfo.max_links deprecation text pointed users to Device.get_num_nvlinks, but the PR adds Device.get_nvlink_count and Device.get_nvlinks; following the warning led to a missing API.\n\n2. Suggested fix implemented in this commit: update the warning reason and generated stub docstring to point to Device.get_nvlink_count, and use a method cross-reference for the docstring target.
1 parent 0120702 commit 44e0197

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎cuda_core/cuda/core/system/_device.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,14 +792,14 @@ class MigInfo:
792792
class _NvlinkInfoMeta(type):
793793

794794
@property
795-
@deprecated(version='1.1.0', reason='Use Device.get_num_nvlinks instead to get the actual number of Nvlinks available on a specific device.')
795+
@deprecated(version='1.1.0', reason='Use Device.get_nvlink_count instead to get the actual number of Nvlinks available on a specific device.')
796796
def max_links(cls):
797797
"""
798798
The statically-defined maximum number of Nvlinks available. Defined in
799799
upstream NVML as ``NVML_NVLINK_MAX_LINKS``.
800800
801801
To find the actual number of Nvlinks available on a device, use
802-
:py:attr:`Device.get_num_nvlinks`.
802+
:py:meth:`Device.get_nvlink_count`.
803803
"""
804804

805805
class _NvlinkInfo:

‎cuda_core/cuda/core/system/_nvlink.pxi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ class _NvlinkInfoMeta(type):
2222
@property
2323
@deprecated(
2424
version="1.1.0",
25-
reason="Use Device.get_num_nvlinks instead to get the actual number of Nvlinks available on a specific device."
25+
reason="Use Device.get_nvlink_count instead to get the actual number of Nvlinks available on a specific device."
2626
)
2727
def max_links(cls):
2828
"""
2929
The statically-defined maximum number of Nvlinks available. Defined in
3030
upstream NVML as ``NVML_NVLINK_MAX_LINKS``.
3131
3232
To find the actual number of Nvlinks available on a device, use
33-
:py:attr:`Device.get_num_nvlinks`.
33+
:py:meth:`Device.get_nvlink_count`.
3434
"""
3535
return nvml.NVLINK_MAX_LINKS
3636

0 commit comments

Comments
 (0)