Skip to content

test(pinned): use mapped memory for UVA pointer check - #125

Open
huo-ju wants to merge 1 commit into
FlashML-org:mainfrom
huo-ju:test/pinned-uva-cuda13
Open

test(pinned): use mapped memory for UVA pointer check#125
huo-ju wants to merge 1 commit into
FlashML-org:mainfrom
huo-ju:test/pinned-uva-cuda13

Conversation

@huo-ju

@huo-ju huo-ju commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • use alloc_pinned_tensor in test_host_device_ptr_is_identity_under_uva
  • verify UVA pointer identity with mapped pinned memory, which is the supported host_device_ptr contract
  • update the test comment to reflect CUDA 13 registration validation

Why

On Linux/UVA with CUDA 13, cudaHostGetDevicePointer rejects an unregistered pageable host pointer with cudaErrorInvalidValue. The existing test passes a pageable tensor, contradicting the pinned + mapped contract of host_device_ptr and failing before pointer identity can be checked.

This is a test-only change; runtime code is unchanged.

Testing

Environment:

  • OS: Ubuntu 26.04 LTS, x86_64
  • CPU: Intel Core i9-9920X
  • GPU: 4 × NVIDIA TITAN RTX 24 GiB (SM75); test executed on the default CUDA device
  • NVIDIA driver: 610.57.04
  • Python: 3.14.4
  • PyTorch: 2.12.0+cu130
  • CUDA runtime: 13.0
  • CUDA toolkit: 13.3 (nvcc V13.3.73)
  • Checkpoint: N/A; these tests do not load model weights

Commands:

pytest -q tests/kernels/test_pinned_tensor.py::test_host_device_ptr_is_identity_under_uva
pytest -q tests/kernels/test_pinned_tensor.py

Results:

  • origin/main at bd372b6: targeted test failed with cudaHostGetDevicePointer failed ... invalid argument
  • this branch at cb44bde: targeted test passed (1 passed)
  • this branch at cb44bde: complete pinned-memory test file passed (8 passed)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant