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

fp32 gemm存在微小误差 #16

Open
anaivebird opened this issue Sep 28, 2022 · 2 comments
Open

fp32 gemm存在微小误差 #16

anaivebird opened this issue Sep 28, 2022 · 2 comments

Comments

@anaivebird
Copy link

A(i, j) = (2.0 * (float)drand48() - 1.0)
误差为
4.577637e-05

如果数字更大,误差更大

@tpoisonooo
Copy link
Owner

这是正常的...原因是数值的表达方式。计算机并不是严格的数学,计算的先后顺序会导致最终结果的不同。

严格意义上, a+b+c != c+b+a

@tpoisonooo tpoisonooo pinned this issue Oct 2, 2022
@tpoisonooo
Copy link
Owner

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

No branches or pull requests

2 participants