Skip to content

test(cuda.core): run test_alloc_memory_type_host and accept the driver's NOT_SUPPORTED - #3662

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

mdboom wants to merge 2 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 is the driver's real current behavior, not a hardware gap: drivers up to CUDA 13.4 support graph memory allocations only in device memory.

 test_alloc_memory_type_host
     node = g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST)
 except CUDAError as e:
-    if NOT_SUPPORTED: skip("Driver does not support graph alloc memory_type='host'")
-    raise
+    if not NOT_SUPPORTED: raise      # any other error fails
+    return                           # NOT_SUPPORTED: expected on current drivers
 ...round-trip check (runs once a driver accepts the allocation)

The test now runs everywhere: it accepts CUDA_ERROR_NOT_SUPPORTED, fails on any other error, and runs the full memory_type/dptr round-trip check if a driver accepts the allocation. The "not currently run in any CI job" comment is removed.

Evidence

Driver behavior (cuda.bindings directly; RTX 5070 and RTX A400, driver 615.71.09 / CUDA 13.4, newer than CI's 13.2 and 13.3):

Operation Result
HOST_MEMORY_POOLS_SUPPORTED, HOST_NUMA_MEMORY_POOLS_SUPPORTED 1, 1
cuGraphAddMemAllocNode, DEVICE location CUDA_SUCCESS
cuGraphAddMemAllocNode, HOST or HOST_NUMA (with or without a device access descriptor) CUDA_ERROR_NOT_SUPPORTED
Stream-captured cuMemAllocFromPoolAsync from a HOST or HOST_NUMA pool CUDA_ERROR_NOT_SUPPORTED

So no device attribute predicts support; host-located graph allocations are not available on any released driver we can test. Getting a newer driver into CI (#3579; see the comment there) would show when that changes.

CI coverage: on main the test skips in all 65 configurations: 59 with "Driver does not support graph alloc memory_type='host'" and 6 without memory pools. After this change it should pass on those 59; the 6 keep their memory-pool skip.

Locally: the test passes on both GPUs, and test_graph_definition.py passes (213 passed, 6 skipped).

Confirming in CI: in this PR's CI run, the cuda.core jobs should report the test PASSED, where main reports it SKIPPED. For example:

gh run view <CI run id> --repo NVIDIA/cuda-python --log | grep -F "test_alloc_memory_type_host"

Merge Danger

Door: two-way. Test-only change.

Blast Radius: one test in cuda_core/tests/graph/test_graph_definition.py. It now fails on an unexpected error from host-located graph allocation instead of hiding it.

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 →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Host-memory graph allocation checks now pass when CUDA reports that allocation is unsupported, rather than skipping the test. Other CUDA errors continue to be reported as failures, and successful allocations still undergo the existing graph reconstruction checks. These changes affect test outcomes only; application behavior is unchanged.

The host graph allocation test now returns when allocation raises CUDA_ERROR_NOT_SUPPORTED. It still raises other CUDAError exceptions. The comment stating that the test does not run in CI was removed.

Changes: Host graph allocation test

Layer / File(s) Summary
Handle unsupported host allocations
cuda_core/tests/graph/test_graph_definition.py
The test returns when allocation raises CUDA_ERROR_NOT_SUPPORTED and re-raises other CUDAError values. The comment about CI coverage was removed.

Assessment against linked issues

Objective Addressed Explanation
[#3588] Encode the host-allocation support requirement in the test and run it where that requirement is met. ❌ The test still returns for every CUDA_ERROR_NOT_SUPPORTED and does not check a driver or device prerequisite.

Suggested reviewers: jpascucci-nv

Change: Other

Merge Risk: Low · up to 0147a

This test-only change makes the host graph allocation test pass when the driver reports the feature as unsupported. Production behavior is unaffected. The one remaining concern is that unsupported configurations are indistinguishable from runs that actually checked the round trip. Reporting them as skipped would fix that, and the concern is minor and should not block the merge.

Security architecture risk: Minimal · up to 4f9be

The test now reports an unsupported host allocation as a pass rather than a skip. Unexpected errors still fail the test, and successful allocations still run the round-trip checks. Production behavior is unchanged by this PR.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

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

Files selected for processing: 1

  • cuda_core/tests/graph/test_graph_definition.py
Files skipped from review as they are similar to previous changes: 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; 7 remain after this review.

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.

# check below instead.
if "CUDA_ERROR_NOT_SUPPORTED" not in str(e):
raise
return

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: Report unsupported allocation as skipped.

On a driver that rejects HOST allocation, this returns before the round-trip assertions and reports a pass. This is the PR’s intended reporting change, but it makes unsupported configurations indistinguishable from configurations that passed those assertions.

Use pytest.skip for this result. As per coding guidelines, “when a CUDA call’s error means ‘feature refused by this driver’ ... skip at the call site.”

Source: Coding guidelines

@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>

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

2 participants