-
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
[hybrid] seed and dropout op support force-cpu #35820
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
382b18f
[HIP] fix op not support AMD GPU bug, the flag PADDLE_WITH_ROCM is in…
xymyeah 2c56ee1
[HIP] fix op not support AMD GPU bug, the flag PADDLE_WITH_ROCM is in…
xymyeah c0a90b6
[HIP] fix op not support AMD GPU bug
xymyeah 6d633eb
Merge branch 'develop' of https://github.com/xymyeah/Paddle into develop
xymyeah 64aa034
[hybrid] seed and dropout op support force-cpu
xymyeah 3f88bb7
[hybrid] seed and dropout op support force-cpu
xymyeah f9b31b8
[hybrid] seed and dropout op support force-cpu
xymyeah 3d1c0c2
[hybrid] seed and dropout op support force-cpu
xymyeah 91a0b92
[hybrid] seed and dropout op support force-cpu
xymyeah d23b1c4
[hybrid] fix seed ci failed issue
xymyeah 62c7b11
add AsExtra for force_cpu of seed op
xymyeah 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 |
---|---|---|
|
@@ -197,13 +197,18 @@ def modify_forward_desc_for_recompute(self): | |
if op.desc.has_attr(op_device_attr_name): | ||
op_device = op.desc.attr(op_device_attr_name) | ||
|
||
# Setting the force_cpu of seed to true will make the output of seed in cpu memory, | ||
# reduce the synchronous copy from GPU to CPU in dropout, and reduce the communication hang | ||
added_op = self.block._insert_op( | ||
index=op.idx, | ||
type='seed', | ||
inputs={}, | ||
outputs={'Out': [added_var]}, | ||
attrs={'seed': seed, | ||
'op_device': op_device}) | ||
attrs={ | ||
'seed': seed, | ||
'op_device': op_device, | ||
'force_cpu': True | ||
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. 加一点点注释,为啥设置为True 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. 已加注释 |
||
}) | ||
self.ops.insert(op_idx, added_op) | ||
# modify dropout op desc so that it accept a seed var as input | ||
op.desc.set_input("Seed", [var_unique_name]) | ||
|
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
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.
看下这个op预测会不会用,可能需要加上 AddCheckpoint 保证预测的兼容性
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.
已加上AddCheckpoint
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.
如果预测不需要是不是还得加AsExtra(),新出的规范
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.
已经确认,并已加上AsExtra()