Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL]add check malloc result on device #9346

Merged
merged 2 commits into from
Sep 8, 2024

Conversation

NeoZhangJianyu
Copy link
Collaborator

In the case that free memory on device is less than requirement, the malloc_device() will return NULL.
But SYCL backend doesn't check it.
It will lead to crash in other code.

Improve it to throw error when malloc memory on device.
Maybe user be easy to know the root cause.

@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels Sep 7, 2024
@slaren
Copy link
Collaborator

slaren commented Sep 7, 2024

The alloc_buffer function cannot throw an exception on failure, it must return nullptr.

@NeoZhangJianyu
Copy link
Collaborator Author

The alloc_buffer function cannot throw an exception on failure, it must return nullptr.

Yes, update it as the comment.

Thank you!

@airMeng airMeng merged commit 2a358fb into ggerganov:master Sep 8, 2024
52 checks passed
dsx1986 pushed a commit to dsx1986/llama.cpp that referenced this pull request Oct 29, 2024
* add check malloc result on device

* update for review comments, check all malloc_device() result

---------

Co-authored-by: arthw <[email protected]>
arthw added a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
* add check malloc result on device

* update for review comments, check all malloc_device() result

---------

Co-authored-by: arthw <[email protected]>
arthw added a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
* add check malloc result on device

* update for review comments, check all malloc_device() result

---------

Co-authored-by: arthw <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants