Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make allocator::malloc throw on allocation failure#2874

Merged
zcbenz merged 1 commit intoml-explore:mainfrom
zcbenz:oom-throw
Dec 5, 2025
Merged

Make allocator::malloc throw on allocation failure#2874
zcbenz merged 1 commit intoml-explore:mainfrom
zcbenz:oom-throw

Conversation

@zcbenz
Copy link
Collaborator

@zcbenz zcbenz commented Dec 5, 2025

Allocator::malloc returned null buffer when allocation failed, which was designed to make malloc_or_wait API work. Since the API had been removed in #1976, this behavior is no longer needed and the code should just throw in case of allocation failure.

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

Looks great modulo the one comment about cudaMallocAsync. I'm not sure it will return an error if the allocation fails so we may need to check the data pointer.

@zcbenz zcbenz merged commit 6245824 into ml-explore:main Dec 5, 2025
12 checks passed
@zcbenz zcbenz deleted the oom-throw branch December 5, 2025 08:44
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