[CINN Zero-Dim] CINN supports 0D-Tensor with trick temporarily#53382
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
thisjiang
reviewed
Apr 27, 2023
|
|
||
| void CinnZeroTensorTrickPass::ApplyImpl(ir::Graph* graph) const { | ||
| // fix shape attr of these ops | ||
| const std::unordered_set<std::string> op_cases_fix_attr{"fill_constant", |
Contributor
There was a problem hiding this comment.
目前是只有这些算子可能会引入0D-tensor么?
Contributor
Author
There was a problem hiding this comment.
这个算子集合可能不是完备的,本 PR 只是暂时提供了绕过的机制,拉取受影响 PR 经本地测试是可以全部绕过的:
后续如果有 op 引入 0D-Tensor,可以往这个集合里面添加。
zyfncg
reviewed
Apr 27, 2023
| @@ -0,0 +1,56 @@ | |||
| /* Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. | |||
zhwesky2010
approved these changes
Apr 27, 2023
zhwesky2010
pushed a commit
to zhwesky2010/Paddle
that referenced
this pull request
May 8, 2023
…ly (PaddlePaddle#53382) * [CINN Support 0D-Tensor] CINN supports 0D-Tensor with trick temporarily * Add unittest
XiaoguangHu01
pushed a commit
that referenced
this pull request
May 9, 2023
#53601) * [Zero-Dim] fix functool.reduce more safe with intial value, to support empty list (#53182) * [Zero-Dim] support 0d tensor for shape and squeeze onednn kernel (#52832) * support 0d tensor for shape and squeeze onednn kernel * set python api for shape op ut * [Zero-Dim] distributed scatter/all_to_all support input 0D tensor (#53186) * [Zero-Dim] Support paddle.sum/mean/loss api output 0D,test=allcase (#52739) * [CINN Support 0D-Tensor] CINN supports 0D-Tensor with trick temporarily (#53382) * [CINN Support 0D-Tensor] CINN supports 0D-Tensor with trick temporarily * Add unittest * [CINN Support 0D-Tensor] CINN hack squeeze2 with trick temporarily (#53454) * fix test_autograd_dynamic (#53473) Co-authored-by: zhwesky2010 <[email protected]> --------- Co-authored-by: YangQun <[email protected]> Co-authored-by: HongyuJia <[email protected]> Co-authored-by: HydrogenSulfate <[email protected]>
This was referenced Jul 19, 2023
This was referenced Jul 18, 2023
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.
PR types
New features
PR changes
Others
Description
Pcard-66989
Paddle 0D-Tensor 机制需要合入 2.5 分支,目前该机制依赖于 CINN 提供 0D-Tensor 支持。由于开发时间较紧张,本 PR 提供了一种低成本快速适配 CINN 0D-Tensor 的机制,在 build_cinn_pass 前新增 cinn_zero_tensor_trick_pass,将 CINN 的所有 0D-Tensor 输入转换为 1D-Tensor。
本 PR 只是一种临时方案,待 CINN 全面原生支持 0D-Tensor 后,会将本 PR 中的 pass 移除,本 pass 的移除也标志着 CINN 全面支持 0D-Tensor 子项的完结。
Paddle's 0D-Tensor mechanism must be merged in the release/2.5 branch, but this mechanism requires CINN to provide corresponding support. This PR adds
cinn_zero_tensor_trick_passbeforebuild_cinn_passto convert all CINN's 0D-Tensor inputs into 1D-Tensor, which can support Paddle's 0D-Tensor with low costs.Note that this PR only provides a temporary trick, the
cinn_zero_tensor_trick_passin this PR will be removed after CINN fully supports 0D-Tensor.