[ggml-openc.cpp]: fix a bug in ggml_cl_pool_malloc() for ggml_cl_mul_…#2955
Merged
ggerganov merged 1 commit intoggml-org:masterfrom Sep 3, 2023
rchardx:wentai/fix_opencl_mat_mul
Merged
[ggml-openc.cpp]: fix a bug in ggml_cl_pool_malloc() for ggml_cl_mul_…#2955ggerganov merged 1 commit intoggml-org:masterfrom rchardx:wentai/fix_opencl_mat_mul
ggerganov merged 1 commit intoggml-org:masterfrom
rchardx:wentai/fix_opencl_mat_mul
Conversation
ggerganov
reviewed
Sep 2, 2023
| d_X = (cl_mem) src0->data; | ||
| } else { | ||
| d_X = ggml_cl_pool_malloc(sizeof(ggml_fp16_t) * x_ne, &x_size); | ||
| d_X = ggml_cl_pool_malloc(sizeof(float) * x_ne, &x_size); |
Member
There was a problem hiding this comment.
Isn't it better to choose the size based on src0 type?
Contributor
Author
There was a problem hiding this comment.
In ggml_cl_mul_mat(), the function calls of both ggml_cl_mul_mat_f32() and ggml_cl_mul_mat_f16() indicate the src0 type as f32 or f16 already.
I think it is a coding style issue, and in this commit, there is no need to modify other parts of the code for now.
ggerganov
approved these changes
Sep 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a very simple fix.
ggml_cl_pool_malloc() in previous version did not have enough space for the later ggml_cl_h2d_tensor_2d().