[xpu] support fp16 data pricision#9080
Merged
zhupengyang merged 34 commits intoPaddlePaddle:developfrom Jun 28, 2022
xiuxin121:develop
Merged
[xpu] support fp16 data pricision#9080zhupengyang merged 34 commits intoPaddlePaddle:developfrom xiuxin121:develop
zhupengyang merged 34 commits intoPaddlePaddle:developfrom
xiuxin121:develop
Conversation
|
Thanks for your contribution! |
shentanyue
reviewed
May 30, 2022
| } | ||
| } | ||
|
|
||
| void XPUStaticKernelPickPass::GetScore(PrecisionType precision, |
Collaborator
There was a problem hiding this comment.
是否要单独考虑下数据类型为LOD_TENSOR_ARRAY时的场景?
当为LOD_TENSOR_ARRAY时,precision是为kUnk的,但注册的kernel是有具体的类型的。
Contributor
Author
There was a problem hiding this comment.
考虑到当前修改的pick算法主要是针对FP16,而数据类型为LOD_TENSOR_ARRAY时的场景,也需要在FP32下考虑,此外,数据类型为LOD_TENSOR_ARRAY的OP reverse目前lite还没有合入,将在后续中加入,本次不做添加。
shentanyue
reviewed
May 30, 2022
| size_t score_tmp = 0; | ||
| if (kernel.GetInputDeclType(tmp)->precision() == PrecisionType::kAny) { | ||
| GetScore(PrecisionType::kAny, &score_tmp); | ||
| VLOG(6) << "match input data presion:kAny"; |
shentanyue
reviewed
May 30, 2022
| kernel.GetInputDeclType(tmp)->precision() || | ||
| xpu_output_type_[in_names[i]] == PrecisionType::kAny) { | ||
| GetScore(xpu_output_type_[in_names[i]], &score_tmp); | ||
| VLOG(6) << "match input data presion"; |
shentanyue
reviewed
Jun 21, 2022
lite/api/paddle_use_passes.h
Outdated
| USE_MIR_PASS(__xpu__dynamic_lstm_fuse_pass); | ||
| USE_MIR_PASS(__xpu__multi_softmax_fuse_pass); | ||
| USE_MIR_PASS(__xpu__max_pooling_pad_zero_detect_fuse_pass); | ||
| #ifdef LITE_WITH_XPU |
Collaborator
There was a problem hiding this comment.
__xpu__static_kernel_pick_pass.cc本身已经用宏隔离了,这里应该不需要加宏隔离
shentanyue
reviewed
Jun 21, 2022
lite/core/optimizer/mir/ssa_graph.h
Outdated
| std::string dump(); | ||
|
|
||
| #ifdef LITE_WITH_XPU | ||
| void CopyScope(const Scope *scope) { scope_ = scope; } |
Contributor
Author
There was a problem hiding this comment.
只做scope拷贝,不涉及scope设置。
Collaborator
There was a problem hiding this comment.
graph 可以通过类似方法获得scope ,不建议增加接口,原则上做最小改动
lite/core/optimizer/mir/ssa_graph.h
Outdated
| std::string dump(); | ||
|
|
||
| #ifdef LITE_WITH_XPU | ||
| void CopyScope(const Scope *scope) { scope_ = scope; } |
Collaborator
There was a problem hiding this comment.
graph 可以通过类似方法获得scope ,不建议增加接口,原则上做最小改动
lite/api/paddle_use_passes.h
Outdated
| USE_MIR_PASS(__xpu__dynamic_lstm_fuse_pass); | ||
| USE_MIR_PASS(__xpu__multi_softmax_fuse_pass); | ||
| USE_MIR_PASS(__xpu__max_pooling_pad_zero_detect_fuse_pass); | ||
| #ifdef LITE_WITH_XPU |
lite/core/optimizer/optimizer.cc
Outdated
| graph->Build(program, valid_places_, block_idx); | ||
| graph->SetValidPlaces(valid_places_); | ||
|
|
||
| #ifdef LITE_WITH_XPU |
zealoct
approved these changes
Jun 27, 2022
newway
pushed a commit
to newway/Paddle-Lite
that referenced
this pull request
Aug 23, 2022
newway
added a commit
that referenced
this pull request
Aug 29, 2022
* [XPU] fixed the bug of tile op in large input and add XPU implementation. (#9102) * [XPU] Fixed the bug of reuse of reshape2's output in xpu_memory_optimize_pass (#9178) * [x86][XPU] Add the support tensorarray of slice on x86 and xpu (#9134) * [XPU] Fixed the error on stack op binding on float. (#9204) * [XPU] Stop supporting xpu conv autotune config with paddlelite c api. (#9316) * [XPU] Support pre-LN encoder (#9159) * [xpu] support fp16 data pricision (#9080) * [xpu] delete kernel.precision()==float (#9189) * [XPU] support fp16 data pression (#9228) * [XPU] support fc per channel quant (#9323) Co-authored-by: wbn <[email protected]> Co-authored-by: Jinchen Han <[email protected]> Co-authored-by: TingShenXD <[email protected]> Co-authored-by: quwei03 <[email protected]>
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.
No description provided.