WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@bdice
Copy link
Contributor

@bdice bdice commented Nov 26, 2025

Description

allocate_sync promises that the returned pointer is immediately valid on all streams. However, the previous implementation only allocated on the default stream without synchronizing it. This caused race conditions when using non-blocking streams, as the allocation might not be visible to other streams.

This fix adds a synchronization of the default stream after allocation to ensure the pointer is immediately valid on all streams, including non-blocking streams.

Closes #2156.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

…eams.

`allocate_sync` promises that the returned pointer is immediately valid on all streams. However, the previous implementation only allocated on the default stream without synchronizing it. This caused race conditions when using non-blocking streams, as the allocation might not be visible to other streams.

This fix adds a synchronization of the default stream after allocation to ensure the pointer is immediately valid on all streams, including non-blocking streams.

Closes rapidsai#2156.
@bdice bdice requested a review from a team as a code owner November 26, 2025 01:15
@bdice bdice requested review from miscco and wence- November 26, 2025 01:15
@bdice bdice added bug Something isn't working non-breaking Non-breaking change labels Nov 26, 2025
@bdice bdice self-assigned this Nov 26, 2025
@bdice bdice moved this to In Progress in RMM Project Board Nov 26, 2025
@bdice
Copy link
Contributor Author

bdice commented Dec 1, 2025

/merge

@rapids-bot rapids-bot bot merged commit b1fb185 into rapidsai:main Dec 2, 2025
209 of 224 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in RMM Project Board Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] cuda_async_memory_resource.allocate_sync doesn't

2 participants