-
Notifications
You must be signed in to change notification settings - Fork 6k
【CUDA Kernel No.74、75】lookup_table、lookup_table_grad算子Kernel修复 -part #75645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
138b2ce
Add lookup_table_kernel.h
Le-soleile 86a62f8
Merge branch '75' of https://github.com/Le-soleile/Paddle into 75
Le-soleile 0a8da13
Add lookup_table_grad_kernel.h
Le-soleile b8b1399
Merge branch '74' of https://github.com/Le-soleile/Paddle into 74
Le-soleile 3c31385
Bug fix
Le-soleile 71f2f18
Merge branch '75' of https://github.com/Le-soleile/Paddle into 74
Le-soleile 2c1dc04
Delete CPUKernel
Le-soleile 517a30a
Merge branch '75' of https://github.com/Le-soleile/Paddle into 75
Le-soleile e950a6a
修改路径、去除cpu声明
Le-soleile 15a456d
Update lookup_table_grad_kernel.cc
Le-soleile a98de5f
CI
Le-soleile 724390c
Merge branch '75' of https://github.com/Le-soleile/Paddle into 75
Le-soleile a24e9f9
Fix
Le-soleile cbba545
Fix codestyle
Le-soleile f7bf793
Fix ci
Le-soleile 644eacc
Fix ci
Le-soleile 7c9d1ef
save
Le-soleile a6f556e
Revert "Fix ci"
Le-soleile 37dc341
Revert "Fix ci"
Le-soleile 51d6e52
Revert "Fix codestyle"
Le-soleile 295307b
fix
Le-soleile cfd5ad5
忘记改了一个报错
Le-soleile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| #include "paddle/phi/core/dense_tensor.h" | ||
| #include "paddle/phi/core/enforce.h" | ||
|
|
||
| namespace phi { | ||
|
|
||
| template <typename T, typename Context> | ||
| void LookupTableCUDAKernel(const Context &dev_ctx, | ||
| const DenseTensor &w, | ||
| const DenseTensor &ids_in, | ||
| bool is_sparse, | ||
| bool is_distributed, | ||
| int64_t padding_idx, | ||
| bool remote_prefetch, | ||
| const std::string &entry_config, | ||
| bool is_test, | ||
| const std::string &entry, | ||
| const std::string &table_class, | ||
| const std::vector<std::string> &table_names, | ||
| int trainer_id, | ||
| bool grad_inplace, | ||
| const std::vector<std::string> &epmap, | ||
| const std::vector<int64_t> &height_sections, | ||
| DenseTensor *out); | ||
|
|
||
| } // namespace phi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| // Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| #include "paddle/phi/core/dense_tensor.h" | ||
| #include "paddle/phi/core/enforce.h" | ||
| #include "paddle/phi/core/selected_rows.h" | ||
|
|
||
| namespace phi { | ||
|
|
||
| constexpr int64_t kNoPadding = -1; | ||
|
|
||
| template <typename T, typename Context> | ||
| void LookupTableGradCUDAKernel(const Context &dev_ctx, | ||
| const DenseTensor &w, | ||
| const DenseTensor &ids_in, | ||
| const DenseTensor &out_grad, | ||
| bool is_sparse, | ||
| bool is_distributed, | ||
| int64_t padding_idx, | ||
| bool remote_prefetch, | ||
| const std::string &entry_config, | ||
| bool is_test, | ||
| const std::string &entry, | ||
| const std::string &table_class, | ||
| const std::vector<std::string> &table_names, | ||
| int trainer_id, | ||
| bool grad_inplace, | ||
| const std::vector<std::string> &epmap, | ||
| const std::vector<int64_t> &height_sections, | ||
| DenseTensor *w_grad); | ||
|
|
||
| template <typename T, typename Context> | ||
| void LookupTableSparseGradCUDAKernel( | ||
| const Context &dev_ctx, | ||
| const DenseTensor &w, | ||
| const DenseTensor &ids_in, | ||
| const DenseTensor &out_grad, | ||
| bool is_sparse, | ||
| bool is_distributed, | ||
| int64_t padding_idx, | ||
| bool remote_prefetch, | ||
| const std::string &entry_config, | ||
| bool is_test, | ||
| const std::string &entry, | ||
| const std::string &table_class, | ||
| const std::vector<std::string> &table_names, | ||
| int trainer_id, | ||
| bool grad_inplace, | ||
| const std::vector<std::string> &epmap, | ||
| const std::vector<int64_t> &height_sections, | ||
| SelectedRows *w_grad); | ||
|
|
||
| template <typename T, typename Context> | ||
| void LookupTableGradKernel(const Context &dev_ctx, | ||
|
||
| const DenseTensor &w, | ||
| const DenseTensor &ids_in, | ||
| const DenseTensor &out_grad, | ||
| bool is_sparse, | ||
| bool is_distributed, | ||
| int64_t padding_idx, | ||
| bool remote_prefetch, | ||
| const std::string &entry_config, | ||
| bool is_test, | ||
| const std::string &entry, | ||
| const std::string &table_class, | ||
| const std::vector<std::string> &table_names, | ||
| int trainer_id, | ||
| bool grad_inplace, | ||
| const std::vector<std::string> &epmap, | ||
| const std::vector<int64_t> &height_sections, | ||
| DenseTensor *w_grad); | ||
|
|
||
| template <typename T, typename Context> | ||
| void LookupTableSparseGradKernel(const Context &dev_ctx, | ||
| const DenseTensor &w, | ||
| const DenseTensor &ids_in, | ||
| const DenseTensor &out_grad, | ||
| bool is_sparse, | ||
| bool is_distributed, | ||
| int64_t padding_idx, | ||
| bool remote_prefetch, | ||
| const std::string &entry_config, | ||
| bool is_test, | ||
| const std::string &entry, | ||
| const std::string &table_class, | ||
| const std::vector<std::string> &table_names, | ||
| int trainer_id, | ||
| bool grad_inplace, | ||
| const std::vector<std::string> &epmap, | ||
| const std::vector<int64_t> &height_sections, | ||
| SelectedRows *w_grad); | ||
|
|
||
| } // namespace phi | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要此头文件