Skip to content

Revert SMResource splitting fix, the problem was the test - #2321

Merged
seberg merged 1 commit into
NVIDIA:mainfrom
seberg:smresource-revert
Jul 24, 2026
Merged

Revert SMResource splitting fix, the problem was the test#2321
seberg merged 1 commit into
NVIDIA:mainfrom
seberg:smresource-revert

Conversation

@seberg

Copy link
Copy Markdown
Contributor

Description

I got things wrong, I think. While completely harmless to have the lock, I think we can consider SMResource as thread-unsafe as it is based of Device() and the green-context where Device() is thread-local and green-contexts are by definition thread unsafe to share.

There is probably some documentation that would be good that sharing device objects across threads is unsafe (to the point of crashes). But I now think the correct fix, at least for now, is to just fix the test and I have included that here.

@Andy-Jost sorry about this but FYI since you merged the other PR for me.

@sebergseberg self-assigned this Jul 8, 2026
@github-actionsgithub-actionsBot added the cuda.core Everything related to the cuda.core module label Jul 8, 2026
@sebergseberg added the enhancement Any code-related improvements label Jul 8, 2026
@seberg
sebergforce-pushed the smresource-revert branch from b51beb2 to 1e05dbdCompareJuly 8, 2026 11:50
@seberg
sebergforce-pushed the smresource-revert branch from 1e05dbd to 7a150b0CompareJuly 8, 2026 11:57
@sebergseberg added the P1 Medium priority - Should do label Jul 8, 2026
@github-actions

This comment has been minimized.

@Andy-JostAndy-Jost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good. Under the concurrency rules, the mutex is not needed here.

@seberg
seberg enabled auto-merge (squash) July 24, 2026 10:55
@seberg
seberg merged commit e51fb7f into NVIDIA:mainJul 24, 2026
202 of 206 checks passed
@seberg
seberg deleted the smresource-revert branch July 24, 2026 11:13
@github-actions

Copy link
Copy Markdown
Doc Preview CI
Preview removed because the pull request was closed or merged.

clin1234 pushed a commit to clin1234/cuda-python that referenced this pull request Jul 30, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.coreEverything related to the cuda.core moduleenhancementAny code-related improvementsP1Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@seberg@Andy-Jost