Skip to content

Commit

Permalink
remove old data check
Browse files Browse the repository at this point in the history
  • Loading branch information
b3602sss committed Aug 23, 2021
1 parent b346c78 commit aa8d4db
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

1 comment on commit aa8d4db

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.