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

如果我想跳过单元测试中,关于fp64的所有测试,应该如何做 #63857

Open
TimeYWL opened this issue Apr 25, 2024 · 6 comments
Assignees
Labels

Comments

@TimeYWL
Copy link
Contributor

TimeYWL commented Apr 25, 2024

请提出你的问题 Please ask your question

在特殊情况下,我们的设备在fp64下的精度等价于fp32,因此无法通过低阈值的fp64测试。
在paddle/test路径下进行测试,我发现大部分集成自OpTest的测试用例,都以fp64为默认数据类型,并会进行check_prim,check_prim_pir等多种测试。
我想在某个op中放宽fp64的相关测试条件,首先我将op加入了NEED_FIX_FP64_CHECK_GRAD_THRESHOLD_OP_LIST中,这能让op在更高的错误阈值下通过测试,如elementwise_add等。
但某些op,如elementwise_div,无法通过check_prim测试(不明白该测试的具体含义),因为该测试中的rtol=1e-15。
那么我该如何做,才能在尽量不修改测试用例的情况下,让op顺利通过包括fp64在内的所有测试呢?

@TimeYWL
Copy link
Contributor Author

TimeYWL commented Apr 25, 2024

check_prim等测试与check_grad中的测试过程有何区别呢?该测试的实际意义是什么?

@lijialin03
Copy link
Contributor

您好,请问这是在什么情况下进行的测试,是在提交PR时进行的CI测试吗?还是在您自己的机器上进行的测试,或是其他情况?

@TimeYWL
Copy link
Contributor Author

TimeYWL commented Apr 25, 2024

您好,请问这是在什么情况下进行的测试,是在提交PR时进行的CI测试吗?还是在您自己的机器上进行的测试,或是其他情况?

目前是在我自己的机器上进行的测试,想知道如何跳过某op在fp64类型下的测试

@TimeYWL
Copy link
Contributor Author

TimeYWL commented Apr 25, 2024

您好,请问这是在什么情况下进行的测试,是在提交PR时进行的CI测试吗?还是在您自己的机器上进行的测试,或是其他情况?

目前是在我自己的机器上进行的测试,想知道如何跳过某op在fp64类型下的测试

以及check_prim的测试意义是什么,可以跳过吗?

@paddle-bot paddle-bot bot added status/following-up 跟进中 and removed status/new-issue 新建 labels Apr 26, 2024
@lijialin03
Copy link
Contributor

您好,请问这是在什么情况下进行的测试,是在提交PR时进行的CI测试吗?还是在您自己的机器上进行的测试,或是其他情况?

目前是在我自己的机器上进行的测试,想知道如何跳过某op在fp64类型下的测试

以及check_prim的测试意义是什么,可以跳过吗?

check_prim是组合算子相关的测试,可以将check_prim改成False试试
以elementwise_add为例,需要设置这里第87行:

check_prim=self.check_prim,

@TimeYWL
Copy link
Contributor Author

TimeYWL commented Apr 28, 2024

好的,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants