Skip to content

【PIR API adaptor No.31】Migrate paddle.distribution.Normal into pir - #59910

Merged
luotao1 merged 9 commits into
PaddlePaddle:developfrom
ooooo-create:ooooo/pir31
Jan 16, 2024
Merged

luotao1 merged 9 commits into
PaddlePaddle:developfrom
ooooo-create:ooooo/pir31

Conversation

@ooooo-create

Copy link
Copy Markdown
Collaborator

PR types

Others

PR changes

APIs

Description

link #58067
PIR API 推全升级
将 paddle.distribution.Normal 迁移升级至 pir,并更新单测
单测覆盖率: 13/13

@paddle-bot

paddle-bot Bot commented Dec 11, 2023

Copy link
Copy Markdown

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

@paddle-bot paddle-bot Bot added the contributor External developers label Dec 11, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Dec 12, 2023

@MarioLulab MarioLulab left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice work ,希望下面的 comment 能帮助你解决现在碰到的问题

  1. 关于 paddle.distribution.Normal 的迁移,需要同时适配 class Distribution 和 class Normal。可以参考 #59922
  2. test/distribution/test_distribution_normal.py 文件里 NormalTest 单测及其派生单测,也可以参考 #59922 来进行适配。我的方法是新建了一个上下文管理器 InitDataContextManager,可以根据当前所处模式,指定在哪个 program 里构图。在 NormalTest 派生类的 init_static_data 方法里调用 InitDataContextManager. 这个方法仅供参考,如果大佬有更好的方法,欢迎提出~ 😄
  3. 关于 TestNormalSampleStaic 和 TestNormalRSampleStaic 单测,旧 ir 和 pir 不好作统一。建议重新写一份 pir 模式下的单测

@MarioLulab MarioLulab left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

great work~

Comment thread python/paddle/distribution/normal.py Resolved
Comment thread python/paddle/distribution/normal.py Resolved
Comment thread python/paddle/distribution/normal.py Resolved

@MarioLulab MarioLulab left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

type(arg)
)
)
if isinstance(arg, paddle.base.libpaddle.pir.Value):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这里为什么要对Value特殊处理呢?老静态图的Variable是怎么处理的呢?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

不处理会这样子~
image
这我看的陆师傅的,我不清楚😂 @MarioLulab


dtype = tmp.dtype
for arg in numpy_args:
if isinstance(arg, paddle.base.libpaddle.pir.Value):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

同上

@paddle-ci-bot

paddle-ci-bot Bot commented Jan 8, 2024

Copy link
Copy Markdown

Sorry to inform you that ddaadc9's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants