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

Detect Overflows #206

Open
3 tasks done
ashvardanian opened this issue Oct 7, 2024 · 0 comments
Open
3 tasks done

Detect Overflows #206

ashvardanian opened this issue Oct 7, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ashvardanian
Copy link
Owner

Describe what you are looking for

Most of the numerical packages don't have well defined policies for reporting numerical errors, especially in Python. SciPy and NumPy and the standard math library report different error types in identical cases. Even the hardware vendors don't provide documentation for the error bounds of their most commonly used instructions, so those have to be reverse-engineered.

It would be great if SimSIMD could be more consistent in that regard, and use signaling NaN floating-point numbers to report overflow. In that case, the *_accurate functions can be subsequently called on the same inputs avoiding overflows in most cases.

Screenshot 2024-10-07 at 11 17 17

The issue is further complicated by the lack of saturated arithmetic intrinsics for many of the common types, like the lack of 32-bit and 64-bit saturated addition in AVX-512. This is a pretty big refactoring undertaking, that I can definitely initiate with a better testing suite, but would love to see more participation from the community.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ashvardanian ashvardanian added enhancement New feature or request help wanted Extra attention is needed labels Oct 7, 2024
ashvardanian added a commit that referenced this issue Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant