Skip to content

Commit 9a40e82

Browse files
authored
Merge branch 'main' into rparolin/greptile_config
2 parents 24a355a + ef4a9cc commit 9a40e82

File tree

12 files changed

+105
-97
lines changed

12 files changed

+105
-97
lines changed

cuda_bindings/docs/source/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99

1010
# -- Path setup --------------------------------------------------------------
1111

12-
# If extensions (or modules to document with autodoc) are in another directory,
13-
# add these directories to sys.path here. If the directory is relative to the
14-
# documentation root, use os.path.abspath to make it absolute, like shown here.
1512
import os
13+
import sys
14+
from pathlib import Path
1615

17-
# import sys
18-
# sys.path.insert(0, os.path.abspath('.'))
16+
sys.path.insert(0, str((Path(__file__).parents[3] / "cuda_python" / "docs" / "exts").absolute()))
1917

2018

2119
# -- Project information -----------------------------------------------------
@@ -41,6 +39,7 @@
4139
"myst_nb",
4240
"enum_tools.autoenum",
4341
"sphinx_copybutton",
42+
"release_toc",
4443
]
4544

4645
nb_execution_mode = "off"

cuda_bindings/docs/source/release.rst

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,6 @@ Release Notes
66

77
.. toctree::
88
:maxdepth: 3
9+
:glob:
910

10-
13.0.3 <release/13.0.3-notes.rst>
11-
13.0.2 <release/13.0.2-notes.rst>
12-
13.0.1 <release/13.0.1-notes.rst>
13-
13.0.0 <release/13.0.0-notes.rst>
14-
12.9.4 <release/12.9.4-notes.rst>
15-
12.9.3 <release/12.9.3-notes.rst>
16-
12.9.2 <release/12.9.2-notes.rst>
17-
12.9.1 <release/12.9.1-notes.rst>
18-
12.9.0 <release/12.9.0-notes.rst>
19-
12.8.0 <release/12.8.0-notes.rst>
20-
12.6.2 <release/12.6.2-notes.rst>
21-
12.6.1 <release/12.6.1-notes.rst>
22-
12.6.0 <release/12.6.0-notes.rst>
23-
12.5.0 <release/12.5.0-notes.rst>
24-
12.4.0 <release/12.4.0-notes.rst>
25-
12.3.0 <release/12.3.0-notes.rst>
26-
12.2.1 <release/12.2.1-notes.rst>
27-
12.2.0 <release/12.2.0-notes.rst>
28-
12.1.0 <release/12.1.0-notes.rst>
29-
12.0.0 <release/12.0.0-notes.rst>
30-
11.8.7 <release/11.8.7-notes.rst>
31-
11.8.6 <release/11.8.6-notes.rst>
32-
11.8.5 <release/11.8.5-notes.rst>
33-
11.8.4 <release/11.8.4-notes.rst>
34-
11.8.3 <release/11.8.3-notes.rst>
35-
11.8.2 <release/11.8.2-notes.rst>
36-
11.8.1 <release/11.8.1-notes.rst>
37-
11.8.0 <release/11.8.0-notes.rst>
38-
11.7.1 <release/11.7.1-notes.rst>
39-
11.7.0 <release/11.7.0-notes.rst>
40-
11.6.1 <release/11.6.1-notes.rst>
41-
11.6.0 <release/11.6.0-notes.rst>
42-
11.5.0 <release/11.5.0-notes.rst>
43-
11.4.0 <release/11.4.0-notes.rst>
11+
release/*[0-9]-notes

cuda_core/cuda/core/experimental/_memory.pyx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ class VirtualMemoryResourceOptions:
11321132
location_type: VirtualMemoryLocationTypeT = "device"
11331133
handle_type: VirtualMemoryHandleTypeT = "posix_fd"
11341134
granularity: VirtualMemoryGranularityT = "recommended"
1135-
gpu_direct_rdma: bool = True
1135+
gpu_direct_rdma: bool = False
11361136
addr_hint: Optional[int] = 0
11371137
addr_align: Optional[int] = None
11381138
peers: Iterable[int] = field(default_factory=tuple)
@@ -1211,6 +1211,11 @@ class VirtualMemoryResource(MemoryResource):
12111211
if platform.system() == "Windows":
12121212
raise NotImplementedError("VirtualMemoryResource is not supported on Windows")
12131213

1214+
# Validate RDMA support if requested
1215+
if self.config.gpu_direct_rdma and self.device is not None:
1216+
if not self.device.properties.gpu_direct_rdma_supported:
1217+
raise RuntimeError("GPU Direct RDMA is not supported on this device")
1218+
12141219
@staticmethod
12151220
def _align_up(size: int, gran: int) -> int:
12161221
"""

cuda_core/docs/source/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99

1010
# -- Path setup --------------------------------------------------------------
1111

12-
# If extensions (or modules to document with autodoc) are in another directory,
13-
# add these directories to sys.path here. If the directory is relative to the
14-
# documentation root, use os.path.abspath to make it absolute, like shown here.
1512
import os
13+
import sys
14+
from pathlib import Path
1615

17-
# sys.path.insert(0, os.path.abspath('.'))
16+
sys.path.insert(0, str((Path(__file__).parents[3] / "cuda_python" / "docs" / "exts").absolute()))
1817

1918

2019
# -- Project information -----------------------------------------------------
@@ -41,6 +40,7 @@
4140
"enum_tools.autoenum",
4241
"sphinx_copybutton",
4342
"sphinx_toolbox.more_autodoc.autoprotocol",
43+
"release_toc",
4444
]
4545

4646
# Add any paths that contain templates here, relative to this directory.

cuda_core/docs/source/release.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ Release Notes
66

77
.. toctree::
88
:maxdepth: 3
9+
:glob:
910

10-
0.4.0 <release/0.4.0-notes>
11-
0.3.2 <release/0.3.2-notes>
12-
0.3.1 <release/0.3.1-notes>
13-
0.3.0 <release/0.3.0-notes>
14-
0.2.0 <release/0.2.0-notes>
15-
0.1.1 <release/0.1.1-notes>
16-
0.1.0 <release/0.1.0-notes>
11+
release/*[0-9]-notes

cuda_core/examples/thread_block_cluster.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
launch,
2323
)
2424

25+
if np.lib.NumpyVersion(np.__version__) < "2.2.5":
26+
print("This example requires NumPy 2.2.5 or later", file=sys.stderr)
27+
sys.exit(0)
28+
2529
# prepare include
2630
cuda_path = os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME"))
2731
if cuda_path is None:

cuda_core/tests/test_memory.py

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from cuda.core.experimental._utils.cuda_utils import handle_return
2929
from cuda.core.experimental.utils import StridedMemoryView
3030

31-
from cuda_python_test_helpers import IS_WSL, supports_ipc_mempool
31+
from cuda_python_test_helpers import supports_ipc_mempool
3232

3333
POOL_SIZE = 2097152 # 2MB size
3434

@@ -322,13 +322,13 @@ def test_vmm_allocator_basic_allocation():
322322
This test verifies that VirtualMemoryResource can allocate memory
323323
using CUDA VMM APIs with default configuration.
324324
"""
325-
if platform.system() == "Windows":
326-
pytest.skip("VirtualMemoryResource is not supported on Windows TCC")
327-
if IS_WSL:
328-
pytest.skip("VirtualMemoryResource is not supported on WSL")
329-
330325
device = Device()
331326
device.set_current()
327+
328+
# Skip if virtual memory management is not supported
329+
if not device.properties.virtual_memory_management_supported:
330+
pytest.skip("Virtual memory management is not supported on this device")
331+
332332
options = VirtualMemoryResourceOptions()
333333
# Create VMM allocator with default config
334334
vmm_mr = VirtualMemoryResource(device, config=options)
@@ -361,13 +361,17 @@ def test_vmm_allocator_policy_configuration():
361361
with different allocation policies and that the configuration affects
362362
the allocation behavior.
363363
"""
364-
if platform.system() == "Windows":
365-
pytest.skip("VirtualMemoryResource is not supported on Windows TCC")
366-
if IS_WSL:
367-
pytest.skip("VirtualMemoryResource is not supported on WSL")
368364
device = Device()
369365
device.set_current()
370366

367+
# Skip if virtual memory management is not supported
368+
if not device.properties.virtual_memory_management_supported:
369+
pytest.skip("Virtual memory management is not supported on this device")
370+
371+
# Skip if GPU Direct RDMA is supported (we want to test the unsupported case)
372+
if not device.properties.gpu_direct_rdma_supported:
373+
pytest.skip("This test requires a device that doesn't support GPU Direct RDMA")
374+
371375
# Test with custom VMM config
372376
custom_config = VirtualMemoryResourceOptions(
373377
allocation_type="pinned",
@@ -420,13 +424,13 @@ def test_vmm_allocator_grow_allocation():
420424
This test verifies that VirtualMemoryResource can grow existing
421425
allocations while preserving the base pointer when possible.
422426
"""
423-
if platform.system() == "Windows":
424-
pytest.skip("VirtualMemoryResource is not supported on Windows TCC")
425-
if IS_WSL:
426-
pytest.skip("VirtualMemoryResource is not supported on WSL")
427427
device = Device()
428428
device.set_current()
429429

430+
# Skip if virtual memory management is not supported (we need it for VMM)
431+
if not device.properties.virtual_memory_management_supported:
432+
pytest.skip("Virtual memory management is not supported on this device")
433+
430434
options = VirtualMemoryResourceOptions()
431435

432436
vmm_mr = VirtualMemoryResource(device, config=options)
@@ -458,6 +462,29 @@ def test_vmm_allocator_grow_allocation():
458462
grown_buffer.close()
459463

460464

465+
def test_vmm_allocator_rdma_unsupported_exception():
466+
"""Test that VirtualMemoryResource throws an exception when RDMA is requested but device doesn't support it.
467+
468+
This test verifies that the VirtualMemoryResource constructor throws a RuntimeError
469+
when gpu_direct_rdma=True is requested but the device doesn't support virtual memory management.
470+
"""
471+
device = Device()
472+
device.set_current()
473+
474+
# Skip if virtual memory management is not supported (we need it for VMM)
475+
if not device.properties.virtual_memory_management_supported:
476+
pytest.skip("Virtual memory management is not supported on this device")
477+
478+
# Skip if GPU Direct RDMA is supported (we want to test the unsupported case)
479+
if device.properties.gpu_direct_rdma_supported:
480+
pytest.skip("This test requires a device that doesn't support GPU Direct RDMA")
481+
482+
# Test that requesting RDMA on an unsupported device throws an exception
483+
options = VirtualMemoryResourceOptions(gpu_direct_rdma=True)
484+
with pytest.raises(RuntimeError, match="GPU Direct RDMA is not supported on this device"):
485+
VirtualMemoryResource(device, config=options)
486+
487+
461488
def test_mempool(mempool_device):
462489
device = mempool_device
463490

cuda_pathfinder/docs/source/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99

1010
# -- Path setup --------------------------------------------------------------
1111

12-
# If extensions (or modules to document with autodoc) are in another directory,
13-
# add these directories to sys.path here. If the directory is relative to the
14-
# documentation root, use os.path.abspath to make it absolute, like shown here.
1512
import os
13+
import sys
14+
from pathlib import Path
1615

17-
# import sys
18-
# sys.path.insert(0, os.path.abspath('.'))
16+
sys.path.insert(0, str((Path(__file__).parents[3] / "cuda_python" / "docs" / "exts").absolute()))
1917

2018

2119
# -- Project information -----------------------------------------------------
@@ -41,6 +39,7 @@
4139
"myst_nb",
4240
"enum_tools.autoenum",
4341
"sphinx_copybutton",
42+
"release_toc",
4443
]
4544

4645
nb_execution_mode = "off"

cuda_pathfinder/docs/source/release.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ Release Notes
66

77
.. toctree::
88
:maxdepth: 3
9+
:glob:
910

10-
1.3.1 <release/1.3.1-notes>
11-
1.3.0 <release/1.3.0-notes>
12-
1.2.3 <release/1.2.3-notes>
13-
1.2.2 <release/1.2.2-notes>
14-
1.2.1 <release/1.2.1-notes>
15-
1.2.0 <release/1.2.0-notes>
16-
1.1.0 <release/1.1.0-notes>
17-
1.0.0 <release/1.0.0-notes>
11+
release/*[0-9]-notes
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
from pathlib import Path
5+
6+
from packaging.version import Version
7+
from sphinx.directives.other import TocTree
8+
9+
10+
class TocTreeSorted(TocTree):
11+
"""A toctree directive that sorts entries by version."""
12+
13+
def parse_content(self, toctree):
14+
super().parse_content(toctree)
15+
16+
if not toctree["glob"]:
17+
return
18+
19+
entries = toctree.get("entries", [])
20+
if not entries:
21+
return
22+
23+
entries = [(Version(Path(x[1]).name.removesuffix("-notes")), x[1]) for x in entries]
24+
entries.sort(key=lambda x: x[0], reverse=True)
25+
entries = [(str(x[0]), x[1]) for x in entries]
26+
toctree["entries"] = entries
27+
28+
29+
def setup(app):
30+
app.add_directive("toctree", TocTreeSorted, override=True)

0 commit comments

Comments
 (0)