From 5b814fd517e19139f52bd84764917dc271b57434 Mon Sep 17 00:00:00 2001 From: wenbin Date: Mon, 23 Aug 2021 17:00:48 +0800 Subject: [PATCH] remove old data check (#35077) --- .../tensorrt/plugin/emb_eltwise_layernorm_plugin.cu | 12 +++--------- .../tensorrt/plugin/emb_eltwise_layernorm_plugin.h | 1 - 2 files changed, 3 insertions(+), 10 deletions(-) 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 a8e9a94955f..313d58ce97e 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 f44391310cc..4c9dfeef5e0 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}; }; -- GitLab