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

【PIR API adaptor No.188】 Migrate paddle.regularizer.L2Decay into pir #59313

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

xiaoyewww
Copy link
Contributor

@xiaoyewww xiaoyewww commented Nov 23, 2023

PR types

Others

PR changes

APIs

Description

PIR API 推全升级

#58067
No.187 将 paddle.regularizer.L2Decay 迁移升级至 pir,并更新单测,单测覆盖率:1/2。

bow_net中paddle.static.nn.sequence_lod.sequence_pool没有对应的pir实现op:

1869: ERROR: test_l2 (test_regularizer_api.TestRegularizer)
1869: ----------------------------------------------------------------------
1869: Traceback (most recent call last):
1869:   File "/wuzp/Paddle/build/python/paddle/pir_utils.py", line 113, in impl
1869:     func(*args, **kwargs)
1869:   File "/wuzp/Paddle/build/test/legacy_test/test_regularizer_api.py", line 167, in test_l2
1869:     framework_l2 = self.check_l2decay_regularizer(place, model)
1869:   File "/wuzp/Paddle/build/python/paddle/pir_utils.py", line 115, in impl
1869:     func(*args, **kwargs)
1869:   File "/wuzp/Paddle/build/test/legacy_test/test_regularizer_api.py", line 120, in check_l2decay_regularizer
1869:     avg_cost = model(data, label, self.word_len)
1869:   File "/wuzp/Paddle/build/test/legacy_test/test_regularizer_api.py", line 47, in bow_net
1869:     bow = paddle.static.nn.sequence_lod.sequence_pool(
1869:   File "/wuzp/Paddle/build/python/paddle/static/nn/sequence_lod.py", line 348, in sequence_pool
1869:     pool_out = helper.create_variable_for_type_inference(dtype)
1869:   File "/wuzp/Paddle/build/python/paddle/base/layer_helper_base.py", line 468, in create_variable_for_type_inference
1869:     return self.main_program.current_block().create_var(
1869:   File "/wuzp/Paddle/build/python/paddle/base/framework.py", line 4207, in create_var
1869:     var = Variable(block=self, *args, **kwargs)
1869:   File "/wuzp/Paddle/build/python/paddle/base/framework.py", line 1455, in __init__
1869:     dtype = convert_np_dtype_to_dtype_(dtype)
1869:   File "/wuzp/Paddle/build/python/paddle/base/framework.py", line 1157, in convert_np_dtype_to_dtype_
1869:     return pir.core.convert_np_dtype_to_dtype_(np_dtype)
1869:   File "/wuzp/Paddle/build/python/paddle/pir/core.py", line 75, in convert_np_dtype_to_dtype_
1869:     dtype = np.dtype(np_dtype)
1869: TypeError: Cannot interpret '<DataType.FLOAT32: 10>' as a data type
1869: 
1869: ----------------------------------------------------------------------

Copy link

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

@paddle-bot paddle-bot bot added the contributor External developers label Nov 23, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 24, 2023
Copy link
Contributor

@MarioLulab MarioLulab left a comment

Choose a reason for hiding this comment

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

LGTM

x = paddle.uniform([2, 2, 3])
out = paddle.static.nn.fc(x, 5, weight_attr=fc_param_attr)
linear = paddle.nn.Linear(1, 5, weight_attr=fc_param_attr)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
linear = paddle.nn.Linear(1, 5, weight_attr=fc_param_attr)
linear = paddle.nn.Linear(3, 5, weight_attr=fc_param_attr)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

感谢,已修改,麻烦重新review~

@0x45f 0x45f merged commit bb190f1 into PaddlePaddle:develop Nov 28, 2023
28 checks passed
@0x45f 0x45f changed the title 【PIR API adaptor No.187】 Migrate paddle.regularizer.L2Decay into pir 【PIR API adaptor No.188】 Migrate paddle.regularizer.L2Decay into pir Jan 9, 2024
@xiaoyewww xiaoyewww deleted the new-ir/L2Decay branch May 10, 2024 15:10
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