add all_kernels_must_compute_runtime_shape example for speedup infershape#16154
Merged
luotao1 merged 5 commits intoPaddlePaddle:developfrom Mar 13, 2019
luotao1:infershape_example
Merged
add all_kernels_must_compute_runtime_shape example for speedup infershape#16154luotao1 merged 5 commits intoPaddlePaddle:developfrom luotao1:infershape_example
luotao1 merged 5 commits intoPaddlePaddle:developfrom
luotao1:infershape_example
Conversation
…hape test=develop
panyx0718
reviewed
Mar 12, 2019
paddle/fluid/framework/operator.cc
Outdated
| // and skip infershape in runtime for speedup. | ||
| // TODO(luotao): Note that it is a temporal attribute, after all ops | ||
| // implement computing runtime shape, this attribute would be deleted. | ||
| if (!HasAttr("all_kernels_must_compute_runtime_shape")) { |
Contributor
There was a problem hiding this comment.
use a constant for the string?
| "(boolean, default true) " | ||
| "An attribute to speed up OperatorWithKernel::RunImpl." | ||
| "If true, all the kernels of this Op would compute runtime " | ||
| "shape, but skip infershape in runtime. Note that it is a temporal " |
Contributor
Author
There was a problem hiding this comment.
Done. Reorganize the sentences.
test=develop
Contributor
Author
|
panyx0718
approved these changes
Mar 13, 2019
| }); | ||
| AddAttr<int>("pad_value", "(int) The enumerate sequence padding value.") | ||
| .SetDefault(0); | ||
| AddAttr<bool>(framework::kAllKernelsMustComputeRuntimeShape, "") |
Contributor
Author
There was a problem hiding this comment.
Since doc of kAllKernelsMustComputeRuntimeShape is so long and the same for all the ops, do you think we should put the doc in each op?
Currently, the doc is in operator.h: https://github.com/PaddlePaddle/Paddle/pull/16154/files#diff-f93a864675e978ec63f28873aa308a5cR71
This was referenced Mar 15, 2019
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We plan to implement computing runtime shape for all ops, in order to skip runtime infershape for speedup.
This PR add
all_kernels_must_compute_runtime_shapeattributes and make an example of three ops:fused_embedding_seq_pool_op,hash_opandsequence_enumerate_op.Related #15959