Skip to content

Commit

Permalink
CUDA: fixed row rounding for 0 tensor splits (#4594)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesGaessler authored Dec 23, 2023
1 parent 7082d24 commit e0a4002
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7937,12 +7937,16 @@ static void ggml_cuda_op_mul_mat(

if (id != 0) {
row_low[id] = ne01*g_tensor_split[id];
row_low[id] -= row_low[id] % rounding;
if (row_low[id] < ne01) {
row_low[id] -= row_low[id] % rounding;
}
}

if (id != g_device_count - 1) {
row_high[id] = ne01*g_tensor_split[id + 1];
row_high[id] -= row_high[id] % rounding;
if (row_high[id] < ne01) {
row_high[id] -= row_high[id] % rounding;
}
}
}
}
Expand Down

0 comments on commit e0a4002

Please sign in to comment.