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
【Hackathon No.60】refactor unary sparse ops and add sparse sqrt, tanh, sin #41356
Merged
zkh2016
merged 36 commits into
PaddlePaddle:develop
from
tiancaishaonvjituizi:sparse_relu
May 12, 2022
Merged
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
97ac270
refactor unary sparse ops and add relu
tiancaishaonvjituizi 26f4662
add test
tiancaishaonvjituizi a7f3410
fix the bug in generated api code, tests are passed now
tiancaishaonvjituizi d4310af
Merge branch 'develop' into sparse_relu
tiancaishaonvjituizi 7e5f102
update relu for new sparse api
tiancaishaonvjituizi 71864fd
update test, implement api, fix sqrt grad
tiancaishaonvjituizi a99a5ba
manually register relu and relu_grad kernel to bypass the restriction
tiancaishaonvjituizi 95aa0b3
polish sqrt docs
tiancaishaonvjituizi f706dea
reformat
tiancaishaonvjituizi d898df7
polish docs
tiancaishaonvjituizi b770f41
remove csr backward api
tiancaishaonvjituizi f92e8cd
fix test compile error
tiancaishaonvjituizi 394ce5e
use allclose instead of array_equal
tiancaishaonvjituizi c577f46
move sqrt to math_kernel.cc, implement sin and tanh
tiancaishaonvjituizi 3ad6fba
polish header file
tiancaishaonvjituizi 56fc5da
reformat
tiancaishaonvjituizi 1f18c59
refine
tiancaishaonvjituizi c606825
fix typo
tiancaishaonvjituizi 5dd4507
fix typo
tiancaishaonvjituizi f59fa26
add test about error, reformat
tiancaishaonvjituizi dea61c7
fix test error
tiancaishaonvjituizi 60c7359
fix format
tiancaishaonvjituizi ad8ceda
fix false positive warning in gcc>=9
tiancaishaonvjituizi 178dd27
use more aggressive way
tiancaishaonvjituizi 1ace46f
Merge remote-tracking branch 'origin/develop' into sparse_relu
tiancaishaonvjituizi 7bb41d7
add api in paddle.sparse namespace
tiancaishaonvjituizi 790cb0d
Merge remote-tracking branch 'tiancaishaonv/variant_fix_gcc9_fp_warni…
tiancaishaonvjituizi c44ac74
address reviews
tiancaishaonvjituizi d35e923
Merge remote-tracking branch 'origin/develop' into sparse_relu
tiancaishaonvjituizi b04ab6c
fix ci error
tiancaishaonvjituizi fa93d7d
rename to unary_kernel, update name
tiancaishaonvjituizi a6d2cd0
Merge remote-tracking branch 'origin/develop' into sparse_relu
tiancaishaonvjituizi 67d14b4
remove unused files
tiancaishaonvjituizi 268ac34
rename python files
tiancaishaonvjituizi 39c9750
fix import path
tiancaishaonvjituizi 06787c0
reformat
tiancaishaonvjituizi File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -187,6 +187,7 @@ DECLARE_ACTIVATION_GRAD_KERNEL_DEPX(Log1p); | |
DECLARE_ACTIVATION_GRAD_KERNEL_DEPOUT(Relu); | ||
DECLARE_ACTIVATION_GRAD_KERNEL_DEPOUT(Tanh); | ||
DECLARE_ACTIVATION_GRAD_KERNEL_DEPOUT(Sigmoid); | ||
DECLARE_ACTIVATION_GRAD_KERNEL_DEPOUT(Sqrt); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 之前 dense tensor 的 SqrtGrad kernel 没有在头文件中声明 |
||
|
||
DECLARE_ACTIVATION_GRAD_KERNEL_NODEP(Round); | ||
DECLARE_ACTIVATION_GRAD_KERNEL_NODEP(Floor); | ||
|
This file contains 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 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 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 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
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.
这里 paddle 原本的代码是错误的,不知道是不是没有测试过。SparseCsrTensor 的构造函数内会检查 dims 的长度,只允许 2d 和 3d,这里 1d 的 dim 会导致 check 失败
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.
当前文件数超了最大限制了,要不把api_gen_utils.cc和sparse_csr_tensor.cc这两个修复的文件单独提一个PR?
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.
好的~