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

【Fix PIR Unittest No.527 BUAA】Fix some test case in PIR #66194

Merged
merged 6 commits into from
Jul 26, 2024

Conversation

uanu2002
Copy link
Contributor

@uanu2002 uanu2002 commented Jul 18, 2024

PR Category

Others

PR Types

Others

Description

截屏2024-07-18 15 19 36

pir模式下并没有进行类型检查,仿照静态图补全类型检查,抛出对应异常。
为避免检查对动态图速度的影响,拆分判断。修改后代码如下:

    if in_dynamic_mode():
        return _C_ops.tril(x, diagonal)
    elif in_pir_mode():
        op_type = 'tril'
        assert x is not None, f'x cannot be None in {op_type}'
        check_variable_and_dtype(
            x,
            'x',
            [
                'float16',
                'uint16',
                'float32',
                'float64',
                'int32',
                'int64',
                'bool',
                'complex64',
                'complex128',
            ],
            op_type,
        )
        if len(x.shape) < 2:
            raise ValueError(f"x shape in {op_type} must be at least 2-D")
        if not isinstance(diagonal, (int,)):
            raise TypeError(f"diagonal in {op_type} must be a python Int")
        return _C_ops.tril(x, diagonal)

Copy link

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

@CLAassistant
Copy link

CLAassistant commented Jul 18, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Wujianyu03 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@paddle-bot paddle-bot bot added the contributor External developers label Jul 18, 2024
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jul 19, 2024
@uanu2002 uanu2002 changed the title 【Fix PIR Unittest No.474 527】Fix some test case in PIR 【Fix PIR Unittest No.474 527 BUAA】Fix some test case in PIR Jul 19, 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.

不是所有单测崩溃了就那with paddle.pir_utils.OldIrGuard():包一下就行了。
只有:明确不需要测试PIR的才做with paddle.pir_utils.OldIrGuard():包裹。
绝大多数是要修问题,而不是通过with paddle.pir_utils.OldIrGuard():规避问题。

@uanu2002 uanu2002 changed the title 【Fix PIR Unittest No.474 527 BUAA】Fix some test case in PIR 【Fix PIR Unittest No.527 BUAA】Fix some test case in PIR Jul 23, 2024
@uanu2002 uanu2002 requested a review from wanghuancoder July 23, 2024 09:27
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
但PR描述下次最好详细一些,截图太少了,还应介绍你的问题、修复思路。

@uanu2002
Copy link
Contributor Author

LGTM 但PR描述下次最好详细一些,截图太少了,还应介绍你的问题、修复思路。

已补全~

@luotao1 luotao1 merged commit d84e247 into PaddlePaddle:develop Jul 26, 2024
31 checks passed
Dale1314 pushed a commit to Dale1314/Paddle that referenced this pull request Jul 28, 2024
…#66194)

* fix test_tril_triu_op

* fix test_where_op

* fix cmake

* fix codestyle

* fix

* restore test_where_op.py
inaomIIsfarell pushed a commit to inaomIIsfarell/Paddle that referenced this pull request Jul 31, 2024
…#66194)

* fix test_tril_triu_op

* fix test_where_op

* fix cmake

* fix codestyle

* fix

* restore test_where_op.py
@uanu2002 uanu2002 deleted the develop3 branch August 1, 2024 10:10
lixcli pushed a commit to lixcli/Paddle that referenced this pull request Aug 5, 2024
…#66194)

* fix test_tril_triu_op

* fix test_where_op

* fix cmake

* fix codestyle

* fix

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

Successfully merging this pull request may close these issues.

4 participants