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

[Auto Parallel] fix adapt_stale_fwd_patch for to_static mode #9372

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

zhangyuqin1998
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

PaddlePaddle/Paddle#68850 的修改导致动转静时,转出来的函数类名称可能变为WeakMethod,因此需要在 adapt_stale_fwd_patch 这个方法里做对应的适配。

Copy link

paddle-bot bot commented Nov 5, 2024

Thanks for your contribution!

@@ -167,6 +167,8 @@ def adapt_stale_fwd_patch(self, name, value):
"StaticFunction"
):
return value
if type(value).__name__.endswith("WeakMethod") or self.forward.__class__.__name__.endswith("WeakMethod"):
return value
Copy link
Collaborator

Choose a reason for hiding this comment

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

对于比较老的paddle版本,这里的修改看起来不兼容?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

对于比较老的paddle版本,这里的修改看起来不兼容?

动转静时,老版本的函数类名叫做 StaticFunction,新版本更新后,这个名字可能是[StaticFunction,WeakMethod]之一。这里的修改其实是兼容老版本的。

Copy link
Collaborator

@wawltor wawltor left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor merged commit 19a2e1f into PaddlePaddle:develop Nov 6, 2024
9 of 12 checks passed
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