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

【Hackathon4】No58. empty #52388

Merged
merged 5 commits into from
Apr 7, 2023

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Mar 31, 2023

PR types

Others

PR changes

Others

Describe

Hackathon4 No.58 part2
add empty fp16 and bp16 test case

@paddle-bot
Copy link

paddle-bot bot commented Mar 31, 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.

self.outputs = {'Out': convert_float_to_uint16(output)}

def test_check_output(self):
self.check_output_customized(self.verify_output)
Copy link
Contributor

Choose a reason for hiding this comment

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

请先使用check_output函数做下对比

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2023-03-31 12:25:37 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 2082, in check_output
2023-03-31 12:25:37 res = self.check_output_with_place(
2023-03-31 12:25:37 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1951, in check_output_with_place
2023-03-31 12:25:37 static_checker.check()
2023-03-31 12:25:37 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1716, in check
2023-03-31 12:25:37 self.compare_outputs_with_expects()
2023-03-31 12:25:37 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1706, in compare_outputs_with_expects
2023-03-31 12:25:37 self.compare_single_output_with_expect(out_name, expect)
2023-03-31 12:25:37 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1684, in compare_single_output_with_expect
2023-03-31 12:25:37 self._compare_numpy(name, actual_np, expect_np)
2023-03-31 12:25:37 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1630, in _compare_numpy
2023-03-31 12:25:37 np.testing.assert_allclose(
2023-03-31 12:25:37 File "C:\home\workspace\cache\python_venv\lib\site-packages\numpy\testing_private\utils.py", line 1527, in assert_allclose
2023-03-31 12:25:37 assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
2023-03-31 12:25:37 File "C:\home\workspace\cache\python_venv\lib\site-packages\numpy\testing_private\utils.py", line 844, in assert_array_compare
2023-03-31 12:25:37 raise AssertionError(msg)
2023-03-31 12:25:37 AssertionError:
2023-03-31 12:25:37 Not equal to tolerance rtol=0.01, atol=0.03
2023-03-31 12:25:37 Output (Out) has diff at Place(cpu) in static checker
2023-03-31 12:25:37 Mismatched elements: 115 / 600 (19.2%)
2023-03-31 12:25:37 Max absolute difference: 1.0299661e+30
2023-03-31 12:25:37 Max relative difference: inf
2023-03-31 12:25:37 x: array([[-6.713867e-04, 1.954214e-23, 7.420308e-38],
2023-03-31 12:25:37 [ 0.000000e+00, -9.765625e-04, 1.954214e-23],
2023-03-31 12:25:37 [ 7.420308e-38, 0.000000e+00, -1.586914e-03],...
2023-03-31 12:25:37 y: array([[0., 0., 0.],
2023-03-31 12:25:37 [0., 0., 0.],
2023-03-31 12:25:37 [0., 0., 0.],...

报错,看来是不能用默认的check_output()

@@ -279,6 +280,48 @@ def test_static_graph(self):
self.__check_out__(res_6, dtype)


class TestEmptyFP16Op(TestEmptyOp):
Copy link
Contributor

Choose a reason for hiding this comment

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

请先使用check_output函数做下对比

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2023-03-31 12:23:06 static_checker.check()
2023-03-31 12:23:06 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1716, in check
2023-03-31 12:23:06 self.compare_outputs_with_expects()
2023-03-31 12:23:06 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1706, in compare_outputs_with_expects
2023-03-31 12:23:06 self.compare_single_output_with_expect(out_name, expect)
2023-03-31 12:23:06 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1684, in compare_single_output_with_expect
2023-03-31 12:23:06 self._compare_numpy(name, actual_np, expect_np)
2023-03-31 12:23:06 File "C:\home\workspace\Paddle\build\python\paddle\fluid\tests\unittests\eager_op_test.py", line 1642, in _compare_numpy
2023-03-31 12:23:06 + self.checker_name
2023-03-31 12:23:06 File "C:\home\workspace\cache\python_venv\lib\site-packages\numpy\testing_private\utils.py", line 1531, in assert_allclose
2023-03-31 12:23:06 verbose=verbose, header=header, equal_nan=equal_nan)
2023-03-31 12:23:06 File "C:\home\workspace\cache\python_venv\lib\site-packages\numpy\testing_private\utils.py", line 844, in assert_array_compare
2023-03-31 12:23:06 raise AssertionError(msg)
2023-03-31 12:23:06 AssertionError:
2023-03-31 12:23:06 Not equal to tolerance rtol=0.001, atol=0.001
2023-03-31 12:23:06 Output (Out) has diff at Place(cpu) in static checker
2023-03-31 12:23:06 Mismatched elements: 153 / 1500 (10.2%)
2023-03-31 12:23:06 Max absolute difference: nan
2023-03-31 12:23:06 Max relative difference: nan
2023-03-31 12:23:06 x: array([[6.437e-06, 0.000e+00, 0.000e+00],
2023-03-31 12:23:06 [0.000e+00, 2.845e+04, 2.805e-02],
2023-03-31 12:23:06 [3.040e-06, 0.000e+00, nan],...
2023-03-31 12:23:06 y: array([[6.437e-06, 0.000e+00, 0.000e+00],
2023-03-31 12:23:06 [0.000e+00, 2.845e+04, 2.805e-02],
2023-03-31 12:23:06 [3.040e-06, 0.000e+00, nan],...

报错。

@enkilee enkilee changed the title add fp16 bp16 test case 【Hackathon4】No58. empty Mar 31, 2023
@enkilee
Copy link
Contributor Author

enkilee commented Apr 7, 2023

@Vvsmile 大佬,有空审下喽

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 47c740e into PaddlePaddle:develop Apr 7, 2023
@enkilee enkilee deleted the Hackathon_no58_empty0331 branch July 6, 2023 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants