Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: daquexian <daquexian566@gmail.com>
  • Loading branch information
daquexian committed Oct 20, 2023
1 parent be19206 commit 6f65056
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernels/cuda/ffn.cu
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Tensor _FFN(const Tensor &x, const Tensor &sx, const Tensor &ln_w,
element_wise(InplaceReLUAndSquare{vx}, kw.size(1));
gemm_cublas(vx, vw.data_ptr<half>(), x_plus_out.data_ptr<half>(), 1, 1,
vw.size(1), vw.size(0));
Tensor r_t = Tensor::FromPtr(r, x.sizes(), DType::kFloat16, x.device());
// hfma loses precision
x_plus_out = x_plus_out * r_t + x;
return xx;
}
Expand Down

0 comments on commit 6f65056

Please sign in to comment.