coverage: add cuda.core tests for system device, checkpoint, memory, stream, green context, and tensor map#2404
Open
rluo8 wants to merge 1 commit into
Open
Conversation
…stream, green context, and tensor map Signed-off-by: Rui Luo <ruluo@nvidia.com>
|
Contributor
|
The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds focused unit tests across
cuda.core, targeting input-validation branches, error paths, and object-lifecycle behavior that were previously uncovered. All tests are real-path: host-only tests exercise pure helpers / argument validation directly, and GPU-required tests use the existing fixtures and skips. No production changes.Measured effect on
cuda/core/line coverage : 84.34% → ~85.6%, withsystem/_device.pyxcrossing 85%. Largest gains incheckpoint.py,_stream.pyx,_memory/_memory_pool.pyx,_tensor_map.pyx, andsystem/_device.pyx.Note that the coverage numbers are for
cuda/core/only, combined across the local systems Linux (A10), Windows (A10), and Linux (H200).graph/test_graph_definition.py_create_from_driverthrough an embedded child graphsystem/test_system_device.pytest_checkpoint.pyTestCheckpointHelpers(host-only_check_timeout_ms/_make_restore_args/_as_cuuuidmarshalling + validation) andTestCheckpointDriverDispatch(_call_driverresult-code / missing-symbol translation via a dependency-injected boundary fake)test_green_context.pyis_green/resourcesdegradation, empty/wrong-typecountsplit rejection, primary-context stream SM-resource pathtest_launcher.pytest_launch_scalar_argument_subclass_fallbackexpanded to all ctypes scalar widths/signs + numpy, with kernel read-back asserting correct C-type marshalling (guards e.g.uint64 → uint32_ttruncation)test_memory.pyDeviceMemoryResourcehandle ownership, idempotent close, deallocate-frees-pointer (verified viaused_mem_currentdrop, not justhandle == 0), IPC-unsupported raise,_MemPoolAttributesnon-instantiabletest_stream.py__cuda_stream__protocol validation (malformed value / wrong length / bad version / deprecated attribute form), borrow-from-existing-Stream, from_handle flag/priority query, per-thread vs legacy default-stream env selectiontest_tensor_map.pyTensorMapDescriptorOptions(...)constructor, dtype andbox_dim-required via the host-only marshalling helpers