-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
【AMP OP&Test】instance_norm fp16 and bf16 support. #52241
Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
da9fbbd
add fp16 and bf16 support for instance_norm
qizhaoaoe 2b7111c
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
qizhaoaoe 4b414d8
fix /= operator which not support bf16
qizhaoaoe e491361
fix instance_norm_grad kernel and unittests.
qizhaoaoe 134fbcc
fix fp32 unittests.
qizhaoaoe ecd7ae1
fix instance_norm_kernel and unittests.
qizhaoaoe 0006187
fix instance_norm_grad_kernel and unittest threshold.
qizhaoaoe e0af6d2
add fp16/bf16 for instance_norm_grad_grad op.
qizhaoaoe f62fd45
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
qizhaoaoe a48f6a0
add bf16 dtype check.
qizhaoaoe 9f5a3a9
fix conflicts.
qizhaoaoe db1703d
fix cpu support for fp32 op and fix type in instance_norm_grad_kernel.
qizhaoaoe 0e25977
fix type in instance_norm_kernel.
qizhaoaoe 40ccc84
fix bf16 outputs in unittests and refine codes.
qizhaoaoe 89947c1
fix dx computation.
qizhaoaoe fdb4f4a
delete unuseful params and head including.
qizhaoaoe 248e9c3
add fp16/bf16 for static graph.
qizhaoaoe b012cd6
fix device condiction for instance_norm op.
qizhaoaoe 6d9dd8d
fix instance_norm_grad_grad and bf16 op tests.
qizhaoaoe 1a674b5
fix op_test to support grad of bf16 can be compared with fp32.
qizhaoaoe ae01635
Merge branch 'develop' into instance_norm_amp
qizhaoaoe a4d9453
remove updates.
qizhaoaoe c62e9b6
add self-defined grad.
qizhaoaoe c497cac
Merge remote-tracking branch 'upstream/develop' into instance_norm_amp
qizhaoaoe 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
fix instance_norm_grad_kernel and unittest threshold.
- Loading branch information
commit 0006187fe7f91687fe2350a83dcde2b5a1e71b28
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 |
---|---|---|
|
@@ -167,7 +167,9 @@ def test_check_output(self): | |
self.check_output_with_place(place, atol=self.atol) | ||
|
||
def test_check_grad(self): | ||
self.check_grad( | ||
place = core.CUDAPlace(0) | ||
self.check_grad_with_place( | ||
place, | ||
['X', 'Scale', 'Bias'], | ||
'Y', | ||
max_relative_error=self.max_relative_error, | ||
|
@@ -201,7 +203,7 @@ def init_dtype(self): | |
|
||
def set_err_thre(self): | ||
self.atol = 0.03125 | ||
self.max_relative_error = 5e-3 | ||
self.max_relative_error = 8e-3 | ||
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. 是的 |
||
|
||
|
||
@unittest.skipIf( | ||
|
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.
可以看下BatchNormParamType的定义,这里不需要再使用AccT,直接用T就可以,BatchNormParamType(T==fp16orbf16)就是float了
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.
fix it.