cuda.core: VirtualMemoryResource.deallocate() unmaps without ordering on the stream
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- backend-api-design, performance
Research direction
Start at VirtualMemoryResource.deallocate() and compare its handling of stream validation and cuMemUnmap with _SynchronousMemoryResource and LegacyPinnedMemoryResource. Confirm Buffer.close()'s stream-ordering documentation, then verify that deallocation synchronizes the stream before unmapping and that the slow-path grow behavior remains correct.
Written by the indexing model from the issue text.
Description
Summary
VirtualMemoryResource.deallocate() validates its stream argument and then calls cuMemUnmap at once. The VMM unmap does not synchronize, so work still in flight on the buffer accesses an unmapped range.
Buffer.close() documents stream-ordered deallocation, and the two synchronous resources (_SynchronousMemoryResource, LegacyPinnedMemoryResource) call stream.sync() before they free. VirtualMemoryResource is the only synchronous resource that skips this.
Suggested fix
Sync the stream before cuMemUnmap, as the siblings do. After #2880 the slow-path grow closes the old buffer through deallocate(), so a grow will sync once; that is the correct cost for a synchronous resource.
Refs: found while analyzing #2882.
- Dominant language
- Cython
- Stars
- 3.4k
- Forks
- 329
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 113
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-python
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NVIDIA/cuda-python#2717 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
NVIDIA/cuda-python#2712 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NVIDIA/cuda-python#2646 · 1 reaction ·
-
cuda.core triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
NVIDIA/cuda-python#2435 · 1 comment ·
-
CI/CD
NVIDIA/cuda-python#2926 · 1 assignee ·
All issues in NVIDIA/cuda-python
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100