NEP: Re-wrote loops_unary_fp using Google Highway.#31534
Open
Manufra05 wants to merge 1 commit into
Open
Conversation
loops_unary_fp.dispatch.c.src (5.000.000 elements) absolute: - 0,669 GE/s square: - 0,652 GE/s sqrt: - 0,617 GE/s floor: - 0,659 GE/s ceil: - 0,670 GE/s loops_unary_fp.dispatch.cpp (5.000.000 elements) absolute: - 0,681 GE/s square: - 0,675 GE/s sqrt: - 0,631 GE/s floor: - 0,671 GE/s ceil: - 0,678 GE/s Co-authored-by: Tomás Sousa <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
This PR migrates the core floating-point unary ufuncs (absolute, square, reciprocal, sqrt, floor, ceil, trunc, and rint), present in numpy/_core/src/umath/loops_unary_fp.dispatch.c.src to use Google Highway for cross-platform SIMD vectorization, which is part of the NEP54 present in Numpy's roadmap.We wrote tests and benchmarked the performance of the new file, compared to the currrent file presnet in Numpy.
Context
We have both contributed in the last month, both suggesting bug fixes (issues #30342 and #28450 ).AI Disclosure
Used AI to help debug and write the tests + benchmarking files.