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] A-17 Adapt transpose test_errors #61119

Merged

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Jan 24, 2024

PR types

Others

PR changes

Others

Description

Copy link

paddle-bot bot commented Jan 24, 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 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
Copy link
Member

zrr1999 commented Jan 26, 2024

            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 处理方法

x1 = paddle.static.data(
name='x1', shape=[-1, 10, 5, 3], dtype='int8'
)
paddle.transpose(x1, perm=[1, 0, 2])
Copy link
Contributor

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
Contributor Author

Choose a reason for hiding this comment

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

收到

# 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
Contributor

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
Contributor Author

Choose a reason for hiding this comment

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

收到

@0x45f
Copy link
Contributor

0x45f commented Feb 4, 2024

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

Copy link
Member

@zrr1999 zrr1999 left a comment

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
32 checks passed
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