metal : cap threadgroups size of set_rows

This commit is contained in:
Georgi Gerganov 2025-11-10 16:17:09 +02:00
parent c27efd2bd1
commit e6dbc81569
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
1 changed files with 5 additions and 0 deletions

View File

@ -1036,6 +1036,11 @@ int ggml_metal_op_set_rows(ggml_metal_op_t ctx, int idx) {
nth = std::min(nth, nk0);
if (nth*nrptg > ggml_metal_pipeline_max_theads_per_threadgroup(pipeline)) {
nth = ggml_metal_pipeline_max_theads_per_threadgroup(pipeline);
nrptg = 1;
}
ggml_metal_kargs_set_rows args = {
/*.nk0 =*/ nk0,
/*.ne01 =*/ ne01,