You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The VMM fast path grows a Buffer in place, but the C++ MemoryResource deleter previously retained the original allocation size. This change keeps the deleter metadata synchronized with the grown buffer so closing it releases the complete VMM reservation.
Changes
store the MemoryResource deallocation size in the shared C++ device-pointer box;
add an internal update path for in-place VMM growth;
update the size after a successful fast-path grow;
extend the fast-path regression coverage.
Validation
pre-commit passed: Ruff, Ruff format, SPDX, stub generation, mypy, and repository checks;
git diff --check passed;
full CUDA/GPU pytest validation was unavailable on the macOS development host.
The branch is DCO signed and contains only the issue-focused changes.
Thanks for the PR. VMM work is consolidated under #2906.
This cannot fix #2887, for a driver reason: cuMemAddressFree frees a reservation only when ptr and size match exactly one reservation (driver API docs). A fast-path-grown range spans two reservations, so deallocate(ptr, grown_size) unmaps both chunks and then fails at address-free; both reservations leak, and every close of a grown buffer emits a CUDAWarning. Two smaller points: Buffer._set_deallocation_size is a cdef method, so the pure-Python resource cannot call it (the FakeBuffer test hides this), and the new field widens DevicePtrBox for every device pointer.
The fix needs the buffer to own each reservation and mapping, which is the redesign in #2906. Closing. Reviews of the redesign PR are welcome.
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
cuda.coreEverything related to the cuda.core module
2 participants
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.
Summary
Fixes #2887.
The VMM fast path grows a Buffer in place, but the C++ MemoryResource deleter previously retained the original allocation size. This change keeps the deleter metadata synchronized with the grown buffer so closing it releases the complete VMM reservation.
Changes
Validation
The branch is DCO signed and contains only the issue-focused changes.