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

[Prim][NewIR] change decomposition to return new vars in New IR #56391

Merged
merged 5 commits into from Aug 21, 2023

Conversation

cyber-pioneer
Copy link
Contributor

@cyber-pioneer cyber-pioneer commented Aug 17, 2023

PR types

Others

PR changes

Others

Description

Pcard-66975
In new ir program, once some operator is decomposed, its vars will be replaced by new ones. If some vars will be used later, corresponding vars will be returned for later usage.

Example:

def fn(x):
    var1 = op1(x)
    var2 = op2(var1)
    var3 = op3(var2)
    return var1, var3

# src_vars = [var1, var3]
src_vars = fn(x) 

# dst_vars = [var1', var3']
dst_vars = decompose(program_fn)

# src_vars is released and replaced by dst_vars.
res = fn_n(*src_vars) # bad
res = fn_n(*dst_vars) # ok

@paddle-bot
Copy link

paddle-bot bot commented Aug 17, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@cyber-pioneer cyber-pioneer changed the title [Prim][NewIR] change prim forward in New IR [Prim][NewIR] change decomposition to return new vars in New IR Aug 17, 2023
@cyber-pioneer cyber-pioneer merged commit 5a3de29 into PaddlePaddle:develop Aug 21, 2023
26 checks passed
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
…lePaddle#56391)

* change prim forward in New IR

* polish code

* polish code

* test case
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.

None yet

2 participants