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

[dy2static] Parameter Recorder Part 2: new parameter collection mechanism #50336

Merged

Conversation

2742195759
Copy link
Contributor

@2742195759 2742195759 commented Feb 8, 2023

PR types

Function optimization

PR changes

Others

Describe

Dy2static new parameter collection mechanism !!

  1. support global tensor used by function decorated by to_static.
  2. support self.xxx: tensor used by function decorated by to_static.
  3. support deepxde model.
    image

Limitation:

目前还不支持 set attribute ,所以不要有如下行为:

@to_static
g = paddle.to_tensor(1.0)
def func(x):
    global g
    g = 2 * g # 不支持,因为 2 * g 是一个 variable,所以这里导致全局的g被替换为了 varaible,影响下一次执行。

@paddle-bot
Copy link

paddle-bot bot commented Feb 8, 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.

@2742195759 2742195759 changed the title [dy2static] Parameter Recorder 2 [dy2static] Parameter Recorder Part 2: new parameter collection mechanism Feb 8, 2023
@0x45f 0x45f self-requested a review February 8, 2023 09:13
Copy link
Contributor

@0x45f 0x45f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@2742195759 2742195759 merged commit 2e07c8b into PaddlePaddle:develop Feb 20, 2023
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