Skip to content

test(cuda.core): assert host-located graph allocations are unsupported - #3662

Open
mdboom wants to merge 4 commits into
NVIDIA:mainfrom
mdboom:issue3588
Open

mdboom wants to merge 4 commits into
NVIDIA:mainfrom
mdboom:issue3588

Conversation

@mdboom

@mdboom mdboom commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3588. Part of #2077.

Summary

test_alloc_memory_type_host skipped on every runner with "Driver does not support graph alloc memory_type='host'". That reflects how drivers actually behave: no driver we can reach supports host-located graph allocations (evidence below), and graph memory nodes are documented only for device-resident memory ("poolProps.location ... specifies the resident device").

So this replaces the round trip that never ran in any configuration with a test that covers the rejection:

 cuda_core/tests/graph/test_graph_definition.py
-test_alloc_memory_type_host               # round trip; skipped on NOT_SUPPORTED everywhere
+test_alloc_memory_type_host_not_supported
+    allocate(memory_type=HOST) must raise CUDA_ERROR_NOT_SUPPORTED
+    (keeps the existing memory-pool and pre-CUDA-13.0 skips)

If a future driver starts accepting host locations, the new test fails. Its docstring says to replace it with a round-trip test at that point.

Whether cuda.core should keep offering GraphMemoryType.HOST for graph allocations is an API question, and is out of scope here.

Evidence

Driver behavior: the probe in #3690 tried every API path, location and allocation type on each CI configuration. Its results, and the 13.4/13.5 measurements, are summarized in #3662 (comment). No driver or platform accepted a host-located graph allocation:

Driver (CUDA) Where measured Host-located graph allocation
580.196.11, 582.16 (13.0) #3690 CI: V100, Linux and Windows NOT_SUPPORTED
595.112.07, 596.36 (13.2) #3690 CI: T4, A100, L4, H100, RTX PRO 6000, RTX 2080/4090, GH200, GB300; Linux, Windows TCC/MCDM/WDDM, WSL NOT_SUPPORTED
615.71.09 (13.4) locally: RTX 5070, RTX A400 NOT_SUPPORTED
620.70.10 (13.5) #3691 CI, all 37 Linux jobs (the existing test's NOT_SUPPORTED skip) NOT_SUPPORTED

Locally (driver 615.71.09): test_alloc_memory_type_host_not_supported PASSED.

Confirming in CI: on main, test_alloc_memory_type_host skips in every configuration. With this change, test_alloc_memory_type_host_not_supported should pass in every cuda.core job whose device supports memory pools and whose driver is CUDA 13.0 or newer. To check one job:

gh api repos/NVIDIA/cuda-python/actions/jobs/<job id>/logs > job.log
grep -E "test_alloc_memory_type_host(_not_supported)? (PASSED|SKIPPED|FAILED)" job.log
# expect: test_alloc_memory_type_host_not_supported PASSED

Merge Danger

Door: two-way. Test-only change.

Blast Radius: one test in cuda_core/tests/graph/test_graph_definition.py. It fails if a driver starts accepting host-located graph allocations; that is intended, as a prompt to restore a round-trip test.

Reviewers: please feel free to push commits directly to this PR to improve it.

🤖 Generated with Claude Code

…r's NOT_SUPPORTED

test_alloc_memory_type_host skipped on every runner because graph
allocation nodes with a host pool location return CUDA_ERROR_NOT_SUPPORTED.
Drivers up to CUDA 13.4 support graph allocations only in device memory:
cuGraphAddMemAllocNode and stream-captured allocations from a host pool
both reject HOST and HOST_NUMA locations, although host memory pools
themselves are supported.

Treat CUDA_ERROR_NOT_SUPPORTED as the expected current result instead of a
skip, fail on any other error, and keep the round-trip check for a driver
that accepts the allocation. Remove the "not currently run in any CI job"
comment.

Closes NVIDIA#3588.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdboom mdboom added this to the cuda.core 1.4.0 milestone Nov 30, 2026
@mdboom mdboom added test Improvements or additions to tests cuda.core Everything related to the cuda.core module labels Nov 30, 2026
@mdboom mdboom self-assigned this Nov 30, 2026
@mdboom
mdboom requested review from jpascucci-nv and rluo8 November 30, 2026 20:27
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

Summary

Summary by CodeRabbit

  • Tests
    • Host-memory graph allocation tests now verify that allocation is reported as unsupported on CUDA 13.0 or later when memory-pool support is available.

The HOST graph allocation test no longer checks reconstruction of a HOST allocation. On drivers version 13.0 or later, when mempool support is available, it asserts that allocation raises CUDA_ERROR_NOT_SUPPORTED. The test file also removes an unused import and a redundant local import.

Changes: HOST graph allocation test

Layer / File(s) Summary
HOST allocation rejection test
cuda_core/tests/graph/test_graph_definition.py
The test now expects HOST graph allocation to raise CUDA_ERROR_NOT_SUPPORTED when the driver is version 13.0 or later and mempool support is available. It removes the prior reconstruction checks and skips. The file also removes an unused weakref import and a function-local gc import.

Assessment against linked issues

Objective Addressed Explanation
[#3588] Encode the host-allocation requirement in the test and run it where that requirement is met. ❓ The test asserts the observed CUDA_ERROR_NOT_SUPPORTED result for drivers version 13.0 or later, but the provided context does not establish that this is the documented requirement or confirm that the test runs in CI.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
None No functional changes outside the linked objective are identified.

Possibly related issues

  • NVIDIA/cuda-python#3579 — The issue notes that CI lacks drivers as new as CTK 13.5. The changed test asserts rejection on qualifying drivers, but the supplied context does not confirm the result on a CTK 13.5 driver.

Suggested reviewers: jpascucci-nv, juenglin

Change: Other

Merge Risk: Low · up to 571ab

This only changes a test. A future driver that accepts host-located graph allocations would make the test fail until it is updated, and the round-trip check is no longer covered. Production behavior is unaffected, so merge risk is low.

Security architecture risk: Minimal · up to 571ab

The cuda.core test now checks that eligible CUDA drivers reject HOST graph allocations with CUDA_ERROR_NOT_SUPPORTED. The PR does not change how applications allocate graph memory.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Finishing Touches
Fix failing CI checks

  • Create a new PR

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between daeda6d and 4f9be79.

Files selected for processing: 1

  • cuda_core/tests/graph/test_graph_definition.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

@jpascucci-nv jpascucci-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an idea of how this should be fixed, but sol 6.1 high detected:
[P2] Unsupported configurations now report false coverage. The new return marks the test passed without reaching its HOST-node reconstruction assertions. It also accepts NOT_SUPPORTED indefinitely, including on future drivers that should support the feature. This leaves #3588’s central requirement unresolved.
Keep a documented skip for unsupported configurations, or separate rejection coverage from the round-trip test. Once support is known, unexpected NOT_SUPPORTED should fail.

… test comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rluo8

rluo8 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Thanks @mdboom . Our earlier testing with a CUDA 13.5 driver also returned CUDA_ERROR_NOT_SUPPORTED.

…e round trip

Instead of returning early (and passing) on CUDA_ERROR_NOT_SUPPORTED, record
the newest driver known to reject host-located graph allocation nodes
(_HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH, CUDA 13.4). On those drivers,
test_alloc_memory_type_host_not_supported asserts the rejection and
test_alloc_memory_type_host skips with a documented reason. On newer drivers
the round-trip test runs and fails on an unexpected NOT_SUPPORTED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdboom mdboom changed the title test(cuda.core): run test_alloc_memory_type_host and accept the driver's NOT_SUPPORTED test(cuda.core): cover the driver's NOT_SUPPORTED for host graph allocations; gate the round trip on driver version Dec 1, 2026
@mdboom

mdboom commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @jpascucci-nv, good catch. Addressed in d1441a7 by separating rejection coverage from the round trip:

  • _HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH = (13, 4) records the newest driver known to reject host-located graph allocations (seen on 13.2, 13.3 and 13.4).
  • New test_alloc_memory_type_host_not_supported: on those drivers, asserts CUDA_ERROR_NOT_SUPPORTED. This is the coverage that runs in CI today.
  • test_alloc_memory_type_host (the round trip): skips on those drivers with a documented reason pointing at test(cuda.core): host-located graph memory-allocation nodes return NOT_SUPPORTED on every runner #3588. On newer drivers it runs, and an unexpected NOT_SUPPORTED fails with a message to raise the threshold, so it no longer reports a pass without reaching the assertions.

I updated the PR title and description to match.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted (1)

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0147a44 and d1441a7.

Files selected for processing: 1

  • cuda_core/tests/graph/test_graph_definition.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

@mdboom
mdboom requested review from Andy-Jost and rluo8 December 1, 2026 17:19
…the round trip

The NVIDIA#3690 probe found no driver or platform that accepts a host-located
graph allocation: CUDA 13.0 and 13.2 drivers on every CI row (Linux,
Windows TCC/MCDM/WDDM, WSL; V100 through GB300), 13.4 locally, and 13.5
(620.70.10) on every Linux row of NVIDIA#3691. Graph memory nodes are documented
only for device-resident memory.

So the rejection test no longer depends on a driver-version threshold, and
the round-trip test, which no configuration ever ran, is removed. The
rejection test's docstring says to replace it with a round trip if a
driver starts accepting host locations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdboom

mdboom commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Probe results (#3690): no driver supports host-located graph allocations

What #3690's probe covered. 61 of its 65 CI jobs ran the probe:

  • Drivers: 580.196.11 and 582.16 (CUDA 13.0), 595.112.07 and 596.36 (CUDA 13.2).
  • GPUs: V100, T4, A100, L4, H100 NVL, RTX PRO 6000, RTX 2080/4090, GH200 and GB300.
  • Platforms: Linux, Windows in TCC, MCDM and WDDM modes, and WSL.

The other 4 jobs:

  • Two 620.85.02 rows: their cuda.core tests failed first on an unrelated host-pinned IPC regression, so the probe step never ran.
  • One cancelled job.
  • One Windows crash.

Results. No host-located graph allocation succeeded anywhere:

  • HOST and HOST_NUMA: every attempt returned CUDA_ERROR_NOT_SUPPORTED.
  • HOST_NUMA_CURRENT: every attempt returned CUDA_ERROR_INVALID_VALUE.
  • Coverage: this held for all three API paths (cuGraphAddMemAllocNode, cuGraphAddNode(MEM_ALLOC) and stream-captured cuMemAllocFromPoolAsync), and with and without a device access descriptor.

Controls. On Linux, device-located graph allocations succeeded alongside, and host pools work for ordinary allocations outside graphs. That includes GH200 and GB300, whose host memory is coherent with the GPU.

Newer drivers, measured elsewhere:

One caveat. On the Windows and WSL rows, the probe also got NOT_SUPPORTED for device-located graph allocations, so those rows don't isolate the host location. cuda.core's own suite does: on Windows, test_alloc_free_chain and test_alloc_device_option pass with device memory while the host test is rejected. I haven't tracked down why the probe differs from cuda.core on Windows.

Documentation agrees. The 12.9–13.6 headers and the Programming Guide only describe a device location ("resident device") for graph memory nodes.

What changed in this PR as a result. I've reduced it to an unconditional test that host-located graph allocations raise CUDA_ERROR_NOT_SUPPORTED on CUDA 13.0 and newer. The driver-version threshold is gone, and so is the round-trip test that never ran anywhere.

🤖 Generated with Claude Code

@mdboom mdboom changed the title test(cuda.core): cover the driver's NOT_SUPPORTED for host graph allocations; gate the round trip on driver version test(cuda.core): assert host-located graph allocations are unsupported Dec 3, 2026
@mdboom
mdboom requested a review from Andy-Jost December 3, 2026 15:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments

Minor 1
  1. important: The test now permanently asserts that the driver rejects HOST graph allocation. A driver that starts accepting it will fail the suite.
Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d1441a7 and 571ab8a.

Files selected for processing: 1

  • cuda_core/tests/graph/test_graph_definition.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

Comment on lines 946 to +948
g = GraphDefinition()
try:
node = g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST)
except CUDAError as e:
if "CUDA_ERROR_NOT_SUPPORTED" in str(e):
pytest.skip("Driver does not support graph alloc memory_type='host'")
raise

expected_dptr = node.dptr
succ = node.record(Device().create_event())
node_ref = weakref.ref(node)
del node
gc.collect()
assert node_ref() is None
reconstructed = next(iter(succ.pred))
assert isinstance(reconstructed, AllocNode)
assert reconstructed.memory_type == GraphMemoryType.HOST
assert reconstructed.dptr == expected_dptr
assert reconstructed.dptr != 0
with pytest.raises(CUDAError, match="CUDA_ERROR_NOT_SUPPORTED"):
g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

important: The test now permanently asserts that the driver rejects HOST graph allocation. A driver that starts accepting it will fail the suite.

Take a driver on CUDA 13.0 or later with mempool support that accepts HOST graph allocation. g.allocate(...) succeeds, pytest.raises fails, and the test gives no skip or round-trip coverage. The docstring tells maintainers to replace the test in that case. That makes a driver upgrade break CI. It also removes the earlier memory_type and dptr round-trip coverage.

The PR objectives record this as intended, backed by reported probes on CUDA 13.0 through 13.5. The linked issue #3588 asks for the feature requirement to be encoded in a skip condition. The test does not do that. The failure is a deliberate signal, but it blocks unrelated work. Check whether a failure on a newer driver should block CI. If it should not, accept a successful allocation and run the round trip on that path. Keep the NOT_SUPPORTED assertion for drivers that reject it.

Based on learnings, do not replace test coverage by deleting it. Keep the round-trip assertions available for drivers that accept HOST allocation.

Source: Learnings

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cuda.core): host-located graph memory-allocation nodes return NOT_SUPPORTED on every runner

4 participants