From 612d5da08cf4375d7f22fcdc298a0524ce74b03b Mon Sep 17 00:00:00 2001 From: zhoutianzi666 <39978853+zhoutianzi666@users.noreply.github.com> Date: Fri, 24 Feb 2023 10:53:16 +0800 Subject: [PATCH] [Paddle-TRT] Fix QkvToContextPluginDynamic bug (#50715) * fix multihead * fix multihead --- paddle/fluid/inference/tensorrt/plugin/qkv_to_context_plugin.cu | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddle/fluid/inference/tensorrt/plugin/qkv_to_context_plugin.cu b/paddle/fluid/inference/tensorrt/plugin/qkv_to_context_plugin.cu index 731441463df..fb2b60a2de5 100644 --- a/paddle/fluid/inference/tensorrt/plugin/qkv_to_context_plugin.cu +++ b/paddle/fluid/inference/tensorrt/plugin/qkv_to_context_plugin.cu @@ -479,6 +479,8 @@ int QkvToContextPluginDynamic::enqueue( const half *input1_data = static_cast(qk_bias); // BxSx3xNxH => tptr: 3xBxNxSxH. if (need_padding) { + PADDLE_ENFORCE_GPU_SUCCESS( + cudaMemsetAsync(tptr, 0, sizeof(half) * input_num, stream)); TransposePadding(input0_data, tptr, batch, -- GitLab