Skip to content

Commit

Permalink
Use FP32 compute type for FP16 convolutions (#1115)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumekln authored Mar 6, 2023
1 parent a21e4f4 commit 6e0f757
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ops/conv1d_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ namespace ctranslate2 {
/*stride_h=*/1, /*stride_w=*/_stride,
/*dilation_h=*/1, /*dilation_w=*/_dilation,
CUDNN_CROSS_CORRELATION,
data_type));
CUDNN_DATA_FLOAT));

CUDNN_CHECK(cudnnSetConvolutionMathType(conv_desc, CUDNN_DEFAULT_MATH));
if (data_type == CUDNN_DATA_HALF)
CUDNN_CHECK(cudnnSetConvolutionMathType(conv_desc, CUDNN_TENSOR_OP_MATH));

cudnnHandle_t handle = cuda::get_cudnn_handle();

Expand Down

0 comments on commit 6e0f757

Please sign in to comment.