Skip to content

Commit

Permalink
ceildiv in layernorm
Browse files Browse the repository at this point in the history
  • Loading branch information
karpathy committed Apr 11, 2024
1 parent 089cd5f commit 00b9fda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev/cuda/layernorm_forward.cu
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void layernorm_forward3(float* out, float* mean, float* rstd,
const int block_size) {
assert(block_size % 32 == 0);
const int N = B * T;
const int grid_size = N * 32 / block_size;
const int grid_size = CEIL_DIV(N * 32, block_size);
layernorm_forward_kernel3<<<grid_size, block_size>>>(out, mean, rstd, inp, weight, bias, N, C);
cudaCheck(cudaGetLastError());
}
Expand Down

0 comments on commit 00b9fda

Please sign in to comment.