Skip to content

[tests] PinnedMemoryResource buffers - #3494

Open
martindurant wants to merge 1 commit into
NVIDIA:mainfrom
martindurant:pinned-memory-resource
Open

martindurant wants to merge 1 commit into
NVIDIA:mainfrom
martindurant:pinned-memory-resource

Conversation

@martindurant

Copy link
Copy Markdown
Contributor

Description

closes #3414

Expand existing tests to use PinnedMemoryResource too

Checklist

  • I have read the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@martindurant martindurant self-assigned this Nov 18, 2026
@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Nov 18, 2026
@martindurant martindurant added the test Improvements or additions to tests label Nov 18, 2026
@martindurant martindurant added this to the cuda.core 1.4.0 milestone Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Expanded coverage of CUDA graph, kernel-launch, event, linker, module, and texture operations using both legacy and current pinned-memory resources.
    • Added coverage for launching a kernel with pinned host output on a green context.
    • Updated existing tests to exercise pinned-memory allocations across more scenarios.

Changes

The test suite now supplies pinned-memory allocators for legacy and current pinned resources. Graph and direct kernel tests use these allocators for buffers, and graph lifetime tests also cover device memory.

Pinned memory kernel test coverage

Layer / File(s) Summary
Shared allocator and test helpers
cuda_core/tests/conftest.py, cuda_core/tests/helpers/memory.py, cuda_core/tests/helpers/latch.py, cuda_core/tests/test_helpers.py, cuda_core/tests/test_event.py, cuda_core/tests/memory_ipc/test_event_ipc.py
A parametrized fixture provides allocators for both pinned resource types. LatchKernel receives the allocator, as do its event and IPC test callers.
Graph kernel tests
cuda_core/tests/graph/*
Graph capture, conditional, mutation, update, node-update, and lifetime tests allocate buffers through the shared allocator. Lifetime tests cover device memory and both pinned resource types.
Direct kernel launch tests
cuda_core/tests/test_launcher.py, cuda_core/tests/test_linker.py, cuda_core/tests/test_module.py, cuda_core/tests/test_green_context.py, cuda_core/tests/test_texture_surface.py
Kernel launch tests use pinned buffers for inputs or outputs. Launcher resource cases include both pinned resource types.

Assessment against linked issues

Objective Addressed Explanation
Run kernel tests using both LegacyPinnedMemoryResource and PinnedMemoryResource buffers [#3414] ✅

Possibly related issues

  • NVIDIA/cuda-python#3472: The PR adds kernel tests that use PinnedMemoryResource, but does not address the Windows host-pool allocation failure.
  • NVIDIA/cuda-python#3415: The tests exercise kernels with PinnedMemoryResource buffers, but do not change or test device-access grants across devices.

Suggested reviewers: andy-jost, juenglin

Change: Other · Severity of issue fixed: Medium

Merge Risk: Minimal · up to b7a63

This change broadens kernel test coverage to buffers from both pinned memory resource types. It does not change library behavior. No concrete merge-blocking risk was identified, and ordinary CI on CUDA hardware should confirm the new cases.

Security architecture risk: Minimal · up to b7a63

The changes expand pinned-memory test coverage without an established change to production exposure, privileges, or ownership guarantees.

- [ ] 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 9eef4b7 and b7a6357.

Files selected for processing: 18

  • cuda_core/tests/conftest.py
  • cuda_core/tests/graph/test_device_launch.py
  • cuda_core/tests/graph/test_graph_builder.py
  • cuda_core/tests/graph/test_graph_builder_conditional.py
  • cuda_core/tests/graph/test_graph_definition_lifetime.py
  • cuda_core/tests/graph/test_graph_definition_mutation.py
  • cuda_core/tests/graph/test_graph_node_update.py
  • cuda_core/tests/graph/test_graph_update.py
  • cuda_core/tests/helpers/latch.py
  • cuda_core/tests/helpers/memory.py
  • cuda_core/tests/memory_ipc/test_event_ipc.py
  • cuda_core/tests/test_event.py
  • cuda_core/tests/test_green_context.py
  • cuda_core/tests/test_helpers.py
  • cuda_core/tests/test_launcher.py
  • cuda_core/tests/test_linker.py
  • cuda_core/tests/test_module.py
  • cuda_core/tests/test_texture_surface.py

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

@github-actions

Copy link
Copy Markdown
Contributor

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.

cuda.core tests: run kernel tests on PinnedMemoryResource buffers

1 participant