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
{{ message }}
Repository navigation
cuda.core: VirtualMemoryResource.deallocate() unmaps without ordering on the stream #2886
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.
Update: I opened PR #2889 with the focused stream-ordering fix and regression coverage. It is a draft so maintainers can review the direction and run CUDA validation.
Activity
aryanputta commentedon Sep 17, 2026
Update: I opened PR #2889 with the focused stream-ordering fix and regression coverage. It is a draft so maintainers can review the direction and run CUDA validation.
fix(cuda.core): move VirtualMemoryResource onto the _rt handle layer (N…