Skip to content

NEP: Re-wrote loops_unary_fp using Google Highway.#31534

Open
Manufra05 wants to merge 1 commit into
numpy:mainfrom
Manufra05:feat/NEP54_loops_unary_fp
Open

NEP: Re-wrote loops_unary_fp using Google Highway.#31534
Manufra05 wants to merge 1 commit into
numpy:mainfrom
Manufra05:feat/NEP54_loops_unary_fp

Conversation

@Manufra05

Copy link
Copy Markdown

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.

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]>
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

Successfully merging this pull request may close these issues.

1 participant