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

Integrate Google benchmarks into SLEEF #589

Merged

Conversation

joanaxcruz
Copy link
Contributor

What is the purpose of this pull request?

  • Improve code quality
  • Documentation update

What changes did you make?

Added new benchmark tool to SLEEF project using googlebench framework.
In theory this tool can benchmark any unary and binary function in SLEEF.
Benchmark is enabled in all functions listed in benchsleef.cpp. This list uses macros in benchmark_callers.cpp, so that we can enable benchmarking in multiple precisions using single lines of code. It is also possible to list the exact function we want, as each of the macros in benchmark_callers.cpp can be called independently and connected like building blocks.
The tool is integrated with SLEEF via CMake, meaning it can be built automatically when SLEEF is built. To enable that, pass CMake argument -DSLEEF_BUILD_BENCH=ON.

This tool depends on C++17 standard.
Tested on aarch64 for scalar, vector and SVE routines Tested on x86 for different vector length extensions. Tested for llvm-17, gcc-11 and gcc-14.

Does this PR relate to any existing issue?

This PR relates to #9.
This PR does not fully close this issue but works towards that effort, by creating a new benchmark tool using googlebench while making sure all functionality from current microbenchmark system is migrated to this new tool.

Added new benchmark tool to SLEEF project using googlebench
framework.
In theory this tool can benchmark any unary and binary function
in SLEEF.
Benchmark is enabled in all functions listed in benchsleef.cpp.
This list uses macros in benchmark_callers.cpp, so that we can
enable benchmarking in multiple precisions using single lines
of code. It is also possible to list the exact function we want,
as each of the macros in benchmark_callers.cpp can be called
independently and connected like building blocks.
The tool is integrated with SLEEF via CMake, meaning it can
be built automatically when SLEEF is built. To enable that,
pass CMake argument -DSLEEF_BUILD_BENCH=ON.

This tool depends on C++17 standard.
Tested on aarch64 for scalar, vector and SVE routines
Tested on x86 for different vector length extensions.
Tested for llvm-17, gcc-11 and gcc-14.
@blapie
Copy link
Collaborator

blapie commented Oct 10, 2024

The new runners are subject to rare random failures, so it is worth retriggering.
Go here and select retrigger failed jobs.

@blapie
Copy link
Collaborator

blapie commented Oct 10, 2024

Go here and select retrigger failed jobs.

My bad you need specific permissions to do that. Doing it now.

@blapie
Copy link
Collaborator

blapie commented Oct 14, 2024

I will merge that unless there are some more comments.

This will make it easier to test and maintain, not to mention the extra benchmarking features. Looking forward to seeing new figures.

@shibatch Are we ok to go on with this solution and remove the pre-existing benchmarking suite?

@shibatch
Copy link
Owner

I think it is okay, though I have not tested.

@blapie blapie merged commit bbdf0e2 into shibatch:master Oct 15, 2024
37 checks passed
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.

3 participants