-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
ggml-opencl, llama: using reserve() if count already known #7272
Conversation
llama.cpp
Outdated
@@ -6116,6 +6116,7 @@ static bool llm_load_tensors( | |||
mlock_buf->init (ggml_backend_buffer_get_base(buf)); | |||
mlock_buf->grow_to(ggml_backend_buffer_get_size(buf)); | |||
} | |||
bufs.reserve(ml.files.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already reserved on line 6060
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it 4ee29e5
ggml-opencl.cpp
Outdated
int64_t i12 = i02 * r2; | ||
int64_t e12 = i12 + r2; | ||
events.reserve(e12 - i12); | ||
while (i12 < e12) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to keep the for
loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it 4ee29e5
It affects a lot
ggml_cl_mul_mat_q_f32
function.