Skip to content

Fix cuda allocator copy condition#2800

Merged
awni merged 1 commit into
ml-explore:mainfrom
awni:fix_cuda_alloc
Nov 20, 2025
Merged

Fix cuda allocator copy condition#2800
awni merged 1 commit into
ml-explore:mainfrom
awni:fix_cuda_alloc

Conversation

@awni

@awni awni commented Nov 20, 2025

Copy link
Copy Markdown
Member

Also decrease the cache threshold slightly to avoid OOMs when close to the limit.

Comment on lines +179 to 181
if (buf->device >= 0 && buf->device != device) {
copy_to_managed(*buf);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If the buffer is already managed (device = -1) then don't need a copy here

@awni awni requested review from angeloskath and zcbenz November 20, 2025 00:05

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@awni awni merged commit d8e9ded into ml-explore:main Nov 20, 2025
10 checks passed
@awni awni deleted the fix_cuda_alloc branch November 22, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants