diff --git a/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu b/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu index a8e9a94955f702570b8635b448487b00a9b38405..313d58ce97ececdeb43bfc0d8cd850a1e4233cbc 100644 --- a/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu +++ b/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu @@ -139,15 +139,9 @@ int EmbEltwiseLayernormPluginDynamicImpl::enqueue( auto emb_ptr_gpu_d = emb_ptr_tensor_.mutable_data(platform::CUDAPlace(device_id_)); - auto new_input_ptr = reinterpret_cast(inputs[0]); - - if (old_input_ptr_ != new_input_ptr) { - old_input_ptr_ = new_input_ptr; - - cudaMemcpyAsync(in_ptr_gpu_d, reinterpret_cast(inputs), - sizeof(uintptr_t) * input_num, cudaMemcpyHostToDevice, - stream); - } + cudaMemcpyAsync(in_ptr_gpu_d, reinterpret_cast(inputs), + sizeof(uintptr_t) * input_num, cudaMemcpyHostToDevice, + stream); auto out_type = output_desc[0].type; diff --git a/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.h b/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.h index f44391310cc219a64a9eecde2a2672c279921645..4c9dfeef5e0dc613a403928291005572cc209d81 100644 --- a/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.h +++ b/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.h @@ -89,7 +89,6 @@ class EmbEltwiseLayernormPluginDynamicImpl framework::Tensor in_ptr_tensor_, emb_ptr_tensor_; int device_id_{0}; - uintptr_t old_input_ptr_{0}; bool is_initialized_{false}; };