Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/patricxu/llm.c into patri…
Browse files Browse the repository at this point in the history
…cxu-master
  • Loading branch information
karpathy committed Apr 22, 2024
2 parents fe85da4 + 41c3cc1 commit 9ed0f10
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dev/cuda/matmul_forward.cu
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ __global__ void matmul_forward_kernel1(float* out,
int bt = blockIdx.x * blockDim.x + threadIdx.x;
int oc = blockIdx.y * blockDim.y + threadIdx.y;
if (bt < BT && oc < OC) {
int b = bt / BT;
int t = bt % BT;
float val = (bias != NULL) ? bias[oc] : 0.0f;
const float* wrow = weight + oc*C;
const float* inp_bt = inp + b * BT * C + t * C;
const float* wrow = weight + oc * C;
const float* inp_bt = inp + bt * C;
for (int i = 0; i < C; i++) {
val += inp_bt[i] * wrow[i];
}
Expand Down

0 comments on commit 9ed0f10

Please sign in to comment.