Skip to content
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

[Dy2St] Filter out non-Value vars in while loop #61355

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Jan 30, 2024

PR types

Bug fixes

PR changes

Others

Description

cf_yield 之前先过滤下 next_vars,仅仅保留 Value,非 Value 的位置使用原来的 Fake 的 Value,这个 Fake 的 Value 对应的变量会在之后 optimize_update 时优化掉,用下面的示例描述现在的行为

                <build_while_op><获取局部 args 组网><loop_body>     <过滤 non-Value>       <传入 cf_yield> <重组织输出>
Value_in1      ---> Value_in1   ---> arg1        --- 组网 ---> Value_out1  ---> Value_out1   --->    Value_out1
UndefinedVar   ---> FakeValue_2 ---> arg2        --- 组网 ---> obj2        ---> arg2         --->    obj2
UndefinedVar   ---> FakeValue_3 ---> arg3        --- 组网 ---> Value_out3  ---> Value_out3   --->    Value_out3

FakeValue_2 并未参与组网会后续修剪掉,arg2 是在 optimize_update 时优化掉

PCard-66972

winter-wang
winter-wang previously approved these changes Jan 30, 2024
@SigureMo SigureMo merged commit 89c3af5 into PaddlePaddle:develop Jan 31, 2024
29 of 30 checks passed
@SigureMo SigureMo deleted the dy2st/filter-out-constant-var-in-while-loop branch January 31, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants