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 a8e9a94955f70..313d58ce97ece 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 f44391310cc21..4c9dfeef5e0dc 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}; };