-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
【complex op No.33】abs_coo/abs_csr(sparse) #62237
Merged
Merged
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4235a2d
除了to_dense bug没修改
bapijun 406eaef
修改了to_dense的bug
bapijun 6ca3e9a
gpu
bapijun 21ca039
grad
bapijun 7627757
单元测试
bapijun 952630e
添加修改
bapijun 669eb76
bug修改
bapijun f418c49
pre_commit
bapijun 4de8ffa
添加注释的更改
bapijun 08e43fb
merge into test_sparse_uanry
bapijun 285e5c3
add devices check
bapijun 0eabfcd
bug fix
bapijun ff00fe7
macro definition for abs
bapijun 0f982fd
Add tests for float16
bapijun 6d99580
rabit hole
bapijun 52d33d2
Add a new EmptyLikeCXXKernel function to the absKernel for sparse ten…
bapijun 765251b
Remove irrelevant comments.
bapijun bd029e2
add new infermeta
bapijun 2868f59
Temporary changes
bapijun cc62200
remove EmptyLikeCXXRealComplexKernel
bapijun d11cb5b
Remove unrelated header files
bapijun e589c98
change the device setting in test op
bapijun de638a6
sparse_utiles_grad for complex
bapijun 602d5a9
bug fix
bapijun a4c0aaa
Merge branch 'develop' into abs_sparse
bapijun 9f2ddda
add support for float16 in sparse_coo_grad
bapijun 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 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
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 |
---|---|---|
|
@@ -51,12 +51,35 @@ PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(sqrt, Sqrt) | |
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(square, Square) | ||
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(log1p, Log1p) | ||
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(relu, Relu) | ||
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(abs, Abs) | ||
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(pow, Pow) | ||
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(expm1, Expm1) | ||
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(relu6, Relu6) | ||
PD_REGISTER_SPARSE_UNARY_GPU_GRAD_KERNEL(leaky_relu, LeakyRelu) | ||
|
||
PD_REGISTER_KERNEL(abs_coo_grad, | ||
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. 注册的形式是一样的,这里是不是也写一个带复数注册的宏会更好一点,也更方便后面稀疏方法的注册, 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.
事实上我在后面的复数修改就重新写了新的宏,我晚上有时间就去把那边pr的代码移动过来 |
||
GPU, | ||
ALL_LAYOUT, | ||
phi::sparse::AbsCooGradKernel, | ||
phi::dtype::float16, | ||
float, | ||
double, | ||
phi::dtype::complex<float>, | ||
phi::dtype::complex<double>) { | ||
kernel->InputAt(0).SetDataLayout(phi::DataLayout::SPARSE_COO); | ||
} | ||
|
||
PD_REGISTER_KERNEL(abs_csr_grad, | ||
GPU, | ||
ALL_LAYOUT, | ||
phi::sparse::AbsCsrGradKernel, | ||
phi::dtype::float16, | ||
float, | ||
double, | ||
phi::dtype::complex<float>, | ||
phi::dtype::complex<double>) { | ||
kernel->InputAt(0).SetDataLayout(phi::DataLayout::SPARSE_CSR); | ||
} | ||
|
||
PD_REGISTER_KERNEL(cast_coo_grad, | ||
GPU, | ||
ALL_LAYOUT, | ||
|
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.
这些kernel 对应的grad kernel 也注册上复数吧
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.
这一次提交里面,在对应的sparse_backward.yaml下面能找到的后向我改掉了,但是对应的to_dense和value的梯度,涉及到
mask_kernel下面的两个kernel
另外还有之前提到的,稀疏格式在backward的时候涉及到的meta丢失的问题,在修改to_dense的梯度的时候也出现了,这一次也改掉了