PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.24k stars 5.58k forks source link

Multiple discrepancies in paddle==2.6.1 vs numpy in python 3.10 #67180

Open arogozhnikov opened 3 months ago

arogozhnikov commented 3 months ago

bug描述 Describe the Bug

Values computed by simple operations in paddle deviate too much from expected result, see einops CI tests:

https://github.com/arogozhnikov/einops/actions/runs/10293928146/job/28491790703?pr=325

these are multiple tests running on CPU and checking behavior of simple operations like .sum() between numpy and other packages (including paddle)

tests fail for python=3.10 and paddle=2.6.1 tests pass for python=3.8 and paddle=2.6.1

Testing for paddle was thus switched off in einops.

其他补充信息 Additional Supplementary Information

No response

ZhangHandi commented 3 months ago

Thank you for your information, we will check it out and reply soon.

DDDivano commented 2 months ago

Could you provide the reproduction code for the issue?

jzhang533 commented 2 months ago

The main reason for the test failures is that paddle.to_tensor breaks when converting a NumPy array to a Paddle Tensor in paddlepaddle 2.6.1, Python 3.10, NumPy 2.1.0 setup.

This has been solved in nightly build, i.e., when using https://github.com/arogozhnikov/einops/blob/master/test.py#L44, all of the tests passed, except test_functional, on case https://github.com/arogozhnikov/einops/blob/master/tests/test_einsum.py#L150. PR #67588 will fix this case.