Modify the DataType directly when the Operand of whileOp is FakeFull. #69939
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 Category
Performance Optimization
PR Types
Performance
Description
while op会创建一个fake的full op,如下所示:
(%2678) = "pd_op.full" [id:743] () {dtype:(pd_op.DataType)float16,persistable:[false],place:(pd_op.Place)Place(undefined:0),shape:(pd_op.IntArray)[],stop_gradient:[false],sym_shape_str:"shape[], data[0]",value:(Float)0} : () -> builtin.tensor<-1x501x4xf16>
其中属性shape和输出tensor的dims信息对不上。while op不支持低精度计算,AMP会将fakle full op后插入cast将其从fp16转为fp32,而CINN会将full和cast OP组成cinn_op.group。由于CINN不支持fake full op的处理,因此不期望在fake op后插cast,而是直接修改full op的数据类型。
Pcard-67164