Skip to content

Commit

Permalink
remove old data check (#35077)
Browse files Browse the repository at this point in the history
  • Loading branch information
b3602sss authored Aug 23, 2021
1 parent 673bf71 commit 5b814fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,9 @@ int EmbEltwiseLayernormPluginDynamicImpl<T>::enqueue(
auto emb_ptr_gpu_d =
emb_ptr_tensor_.mutable_data<int64_t>(platform::CUDAPlace(device_id_));

auto new_input_ptr = reinterpret_cast<uintptr_t>(inputs[0]);

if (old_input_ptr_ != new_input_ptr) {
old_input_ptr_ = new_input_ptr;

cudaMemcpyAsync(in_ptr_gpu_d, reinterpret_cast<const void *>(inputs),
sizeof(uintptr_t) * input_num, cudaMemcpyHostToDevice,
stream);
}
cudaMemcpyAsync(in_ptr_gpu_d, reinterpret_cast<const void *>(inputs),
sizeof(uintptr_t) * input_num, cudaMemcpyHostToDevice,
stream);

auto out_type = output_desc[0].type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
};

Expand Down

0 comments on commit 5b814fd

Please sign in to comment.