-
Notifications
You must be signed in to change notification settings - Fork 57
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
Update workflow for changes in benchmark tooling #54
Conversation
Google's Benchmark project has rearranged some of the files we need for the testing workflows. This commit points pip towards to correct requirements.txt for the latest versions of the framework.
First of all, unfortunately it seems we can't control whether the Github-hosted runners for tests will have AVX512 compatible CPUs. This shouldn't be a problem in general, but it is for reasons I detail below. By compiling and running the benchmarks using
As far as I can tell, this instruction would only occur for the x86-simd-sort/benchmarks/bench-qsort.hpp Line 70 in 348343e
Obviously since want the "reverse" tests to actually have a reversed array, I tried a custom comparator in
So, do you want me to make a new PR to fix this weird behaviour or put it in here? Workaround: diff --git a/benchmarks/bench-qsort.hpp b/benchmarks/bench-qsort.hpp
index ae02ac9..23c16ca 100644
--- a/benchmarks/bench-qsort.hpp
+++ b/benchmarks/bench-qsort.hpp
@@ -23,8 +23,7 @@ static void stdsort(benchmark::State &state, Args &&...args)
}
else if (arrtype == "reverse") {
arr = get_uniform_rand_array<T>(ARRSIZE);
- std::sort(arr.begin(), arr.end());
- std::reverse(arr.begin(), arr.end());
+ std::sort(arr.begin(), arr.end(), std::greater<T>());
}
arr_bkp = arr;
@@ -66,8 +65,7 @@ static void avx512qsort(benchmark::State &state, Args &&...args)
}
else if (arrtype == "reverse") {
arr = get_uniform_rand_array<T>(ARRSIZE);
- std::sort(arr.begin(), arr.end());
- std::reverse(arr.begin(), arr.end());
+ std::sort(arr.begin(), arr.end(), std::greater<T>());
}
arr_bkp = arr;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I think the benchmarks isn't compiled with the right attributes. We are compiling the entire file with I wouldn't worry about it. This particular CI isn't a "Required" one to pass to enabling merging a PR. I am considering just getting rid of it all together. |
I was thinking of zhoozhing this CI up a bit by having it run the benchmarks separately first and writing the results to JSON. This could then be split into qsort/qselect/partial_qsort comparisons using jq. Plus I could then have it exit when the CPU is not AVX512 compatible. Gets me worried for a moment when I see the little red x after a push, but I can let it go if it's not too important in the grand scheme of things 😄 |
Google's Benchmark project has rearranged some of the files we need for the testing workflows. This commit points pip towards to correct requirements.txt for the latest versions of the framework. Alternatively, we could use
-b <name>
to ensure we always use the same version of the benchmark dependency.