Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

【Fix PIR Unittest No.38 BUAA】fix TruncatedNormalInitializer according to NormalInitializer and fix test_cuda_random_seed #66413

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

BHmingyang
Copy link
Contributor

@BHmingyang BHmingyang commented Jul 23, 2024

PR Category

Others

PR Types

Others

Description

截屏2024-07-23 18 27 09 首先遇到的是assertion value问题,仿照NormalInitializer类进行修改:

assert isinstance(var, (framework.Variable, paddle.pir.core.ParameterMeta))
assert isinstance(block, (framework.Block, pir.Block))
然后在forward中添加in_pir_mode分支进行pir适配

Copy link

paddle-bot bot commented Jul 23, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Jul 23, 2024
@BHmingyang BHmingyang changed the title 【Fix PIR Unittest No.462 BUAA】fix TruncatedNormalInitializer according to NormalInitializer and fix test_cuda_random_seed 【Fix PIR Unittest No.38 BUAA】fix TruncatedNormalInitializer according to NormalInitializer and fix test_cuda_random_seed Jul 23, 2024
Comment on lines 237 to 239
assert not (
isinstance(var, framework.EagerParamBase) and var.is_dist()
), "Currently, normal initializer not support lazy init for dist param."
Copy link
Contributor

Choose a reason for hiding this comment

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

为啥要写这段逻辑?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除

block = self._check_block(block)

assert isinstance(var, framework.Variable)
Copy link
Contributor

Choose a reason for hiding this comment

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

assert isinstance(var, (framework.Variable, paddle.pir.Value))
这个也应该加上。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

assert isinstance(var, (framework.Variable, paddle.pir.core.ParameterMeta))
我打印了一下type(var),发现它是paddle.pir.core.ParameterMeta。
使用assert isinstance(var, (framework.Variable, paddle.pir.Value))过不了

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jul 24, 2024
Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit e1b428a into PaddlePaddle:develop Jul 25, 2024
31 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Jul 25, 2024
… to NormalInitializer and fix test_cuda_random_seed (PaddlePaddle#66413)

* fix TruncatedNormalInitializer according to NormalInitializer

* change the assertion

* fix the code style
@BHmingyang BHmingyang deleted the 723_1 branch July 31, 2024 02:41
inaomIIsfarell pushed a commit to inaomIIsfarell/Paddle that referenced this pull request Jul 31, 2024
… to NormalInitializer and fix test_cuda_random_seed (PaddlePaddle#66413)

* fix TruncatedNormalInitializer according to NormalInitializer

* change the assertion

* fix the code style
lixcli pushed a commit to lixcli/Paddle that referenced this pull request Aug 5, 2024
… to NormalInitializer and fix test_cuda_random_seed (PaddlePaddle#66413)

* fix TruncatedNormalInitializer according to NormalInitializer

* change the assertion

* fix the code style
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants