Skip to content

[PIR] A-17 Adapt transpose test_errors - #61119

Merged
luotao1 merged 11 commits into
PaddlePaddle:developfrom
enkilee:Add-test_with_pir_api-in-error-test-17
Feb 19, 2024
Merged

luotao1 merged 11 commits into
PaddlePaddle:developfrom
enkilee:Add-test_with_pir_api-in-error-test-17

Conversation

@enkilee

@enkilee enkilee commented Jan 24, 2024

Copy link
Copy Markdown
Collaborator

PR types

Others

PR changes

Others

Description

@paddle-bot

paddle-bot Bot commented Jan 24, 2024

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 Jan 24, 2024
@enkilee enkilee changed the title Add test_with_pir_api in error test A17 [PIR] A-17 Adapt transpose test_errors Jan 24, 2024
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jan 24, 2024
@zrr1999

zrr1999 commented Jan 26, 2024

Copy link
Copy Markdown
Member
            def test_x_dtype_check():
                # the Input(x)'s dtype must be one of [bool, float16, float32, float64, int32, int64]
                x1 = paddle.static.data(
                    name='x1', shape=[-1, 10, 5, 3], dtype='int8'
                )
                paddle.transpose(x1, perm=[1, 0, 2])
            self.assertRaises(TypeError, test_x_dtype_check)

这块可能静态图的类型检查又一些滞后,可以看下能不能改一下transpose里的api,参考#60488 这里面的 mean 处理方法

Comment thread test/legacy_test/test_transpose_op.py Outdated
x1 = paddle.static.data(
name='x1', shape=[-1, 10, 5, 3], dtype='int8'
)
paddle.transpose(x1, perm=[1, 0, 2])

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.

transpose 的 kernel是支持int8类型的,只是老静态图python端检查代码有些滞后,需要在python/paddle/tensor/linalg.py的transpose函数老静态图分支的check_variable_and_dtype加上int8类型。然后这个测试case就可以不用加not in_pir_mode 的判断了

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.

收到

Comment thread test/legacy_test/test_transpose_op.py Resolved
Comment thread test/legacy_test/test_transpose_op.py Outdated
# the Input(x)'s dtype must be one of [bool, float16, float32, float64, int32, int64]
x1 = paddle.static.data(
name='x1', shape=[-1, 10, 5, 3], dtype='int8'
if core.is_compiled_with_cuda():

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.

transpose的cpu kernel也注册了float16类型,参见paddle/phi/kernels/cpu/transpose_kernel.cc。所以把这个测试case删掉吧~

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.

收到

@0x45f

0x45f commented Feb 4, 2024

Copy link
Copy Markdown
Collaborator

CI有点问题没有触发,辛苦merger下develop然后再push一下,重新触发下CI~

@zrr1999 zrr1999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@zrr1999
zrr1999 requested a review from 0x45f February 16, 2024 06:38
@luotao1
luotao1 merged commit cb53825 into PaddlePaddle:develop Feb 19, 2024
@enkilee
enkilee deleted the Add-test_with_pir_api-in-error-test-17 branch January 8, 2025 08:12
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.

4 participants