-
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
[ Make FLAGS_einsum_opt as default ] Einsum memory optimization #43397
Merged
2742195759
merged 18 commits into
PaddlePaddle:develop
from
2742195759:einsum_memory_opt
Jun 14, 2022
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1ed6d14
change logic for optimize
2742195759 e687edd
modifty
2742195759 6d8bb1a
optimize the backward speed of EinsumOp
2742195759 0ae8108
merge
2742195759 97b3b4a
add cache optimizer for einsum op
2742195759 ce8c42e
merge
2742195759 9058ad5
EinsumOp: fix new dygraph mode error
2742195759 3d3f4b0
fix bug
2742195759 a94fd80
merge
2742195759 d114254
change Cache->InnerCache
2742195759 a13da4f
fix code
2742195759 8454b93
fix
2742195759 74fa7d0
Merge remote-tracking branch 'upstream/develop' into einsum_opt
2742195759 26e10a5
add nan inf utils for einsum op
2742195759 94621c6
add as_extra
2742195759 49f82c3
memory optimizer for einsum
2742195759 aa6d2a3
merge and compat for v2.3.0
2742195759 f2d8f23
update code
2742195759 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
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
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 |
---|---|---|
@@ -1,3 +1,14 @@ | ||
#- backward_api : einsum_grad | ||
|
||
#forward : einsum (Tensor[] x, str equation) -> Tensor(out), Tensor[](inner_cache) | ||
#args : (Tensor[] x, Tensor[] inner_cache, Tensor out_grad, str equation) | ||
#output : Tensor[](x_grad){x.size()} | ||
#infer_meta : | ||
#func : UnchangedMultiInferMeta | ||
#param : [x] | ||
#kernel : | ||
#func : einsum_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. 这部分注释代码删掉吧 |
||
|
||
- backward_api : abs_double_grad | ||
forward : abs_grad (Tensor x, Tensor grad_out) -> Tensor(grad_x) | ||
args : (Tensor x, Tensor grad_x_grad) | ||
|
@@ -611,12 +622,12 @@ | |
skip_transform : out_w, out_w_grad | ||
|
||
- backward_api : einsum_grad | ||
forward : einsum (Tensor[] x, str equation) -> Tensor(out), Tensor[](inner_cache) | ||
args : (Tensor[] x, Tensor[] inner_cache, Tensor out_grad, str equation) | ||
forward : einsum (Tensor[] x, str equation) -> Tensor(out), Tensor[](inner_cache), Tensor[](x_shape) | ||
args : (Tensor[] x_shape, Tensor[] inner_cache, Tensor out_grad, str equation) | ||
output : Tensor[](x_grad){x.size()} | ||
infer_meta : | ||
func : UnchangedMultiInferMeta | ||
param : [x] | ||
param : [x_shape] | ||
kernel : | ||
func : einsum_grad | ||
|
||
|
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.
这里为什么不直接用 x_name 了?