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

[Typing][C-50] Add type annotations for python/paddle/distributed/fleet/utils/ps_util.py #66770

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

megemini
Copy link
Contributor

PR Category

User Experience

PR Types

Improvements

Description

类型标注:

  • python/paddle/distributed/fleet/utils/ps_util.py

Related links

@SigureMo @megemini

Copy link

paddle-bot bot commented Jul 30, 2024

你的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.

from paddle import Tensor
from paddle.base import Executor
from paddle.distributed.fleet.base.role_maker import RoleMakerBase
from paddle.framework import Program
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from paddle.framework import Program
from paddle.static import Program

paddle.framework.Program 不是公开 API,而且运行时有点细微差异,比如说 PIR 模式下并没有给 paddle.framework.Program patch 成 PIR 的 Program,虽然 patch 这种行为本身类型检查工具也不可能检查出来就是了……


import paddle

if TYPE_CHECKING:
from paddle import Tensor
from paddle.base import Executor
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from paddle.base import Executor
from paddle.static import Executor

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

@SigureMo SigureMo merged commit 2b32c1d into PaddlePaddle:develop Jul 31, 2024
31 checks passed
Lans1ot pushed a commit to Lans1ot/Paddle that referenced this pull request Aug 5, 2024
…eet/utils/ps_util.py` (PaddlePaddle#66770)

---------

Co-authored-by: SigureMo <sigure.qaq@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants