Skip to content

Commit

Permalink
simplify and refactor create_servicelab_experiment utility (#3867)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #3867

`create_servicelab_experiment`'s metrics' key calculation and benchmarks were specific to scalar quantizer. Refactor it so we can reuse the same utility for RCQ. Fix the previous naming suggestion for the position of `_profile` in the experiment name as well

Reviewed By: junjieqi

Differential Revision: D62770846

fbshipit-source-id: 52422138df6f32ca8f2319369cb9f6675e8b3bdf
  • Loading branch information
mengdilin authored and facebook-github-bot committed Sep 17, 2024
1 parent 83d0599 commit 73a41f1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
3 changes: 1 addition & 2 deletions faiss/perf_tests/bench_scalar_quantizer_accuracy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include <faiss/perf_tests/utils.h>
#include <fmt/format.h>
#include <gflags/gflags.h>
#include <cstdio>
#include <map>
Expand Down Expand Up @@ -76,7 +75,7 @@ int main(int argc, char** argv) {

for (auto& [bench_name, quantizer_type] : benchs) {
benchmark::RegisterBenchmark(
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
bench_name.c_str(),
bench_reconstruction_error,
quantizer_type,
d,
Expand Down
7 changes: 1 addition & 6 deletions faiss/perf_tests/bench_scalar_quantizer_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include <faiss/perf_tests/utils.h>
#include <fmt/format.h>
#include <gflags/gflags.h>
#include <omp.h>
#include <cstdio>
Expand Down Expand Up @@ -63,11 +62,7 @@ int main(int argc, char** argv) {

for (auto& [bench_name, quantizer_type] : benchs) {
benchmark::RegisterBenchmark(
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
bench_decode,
quantizer_type,
d,
n)
bench_name.c_str(), bench_decode, quantizer_type, d, n)
->Iterations(iterations);
}

Expand Down
7 changes: 1 addition & 6 deletions faiss/perf_tests/bench_scalar_quantizer_distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

#include <fmt/format.h>
#include <gflags/gflags.h>
#include <omp.h>
#include <cstdio>
Expand Down Expand Up @@ -72,11 +71,7 @@ int main(int argc, char** argv) {

for (auto& [bench_name, quantizer_type] : benchs) {
benchmark::RegisterBenchmark(
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
bench_distance,
quantizer_type,
d,
n)
bench_name.c_str(), bench_distance, quantizer_type, d, n)
->Iterations(iterations);
}
benchmark::RunSpecifiedBenchmarks();
Expand Down
7 changes: 1 addition & 6 deletions faiss/perf_tests/bench_scalar_quantizer_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

#include <fmt/format.h>
#include <gflags/gflags.h>
#include <omp.h>
#include <cstdio>
Expand Down Expand Up @@ -57,11 +56,7 @@ int main(int argc, char** argv) {

for (auto& [bench_name, quantizer_type] : benchs) {
benchmark::RegisterBenchmark(
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
bench_encode,
quantizer_type,
d,
n)
bench_name.c_str(), bench_encode, quantizer_type, d, n)
->Iterations(iterations);
}

Expand Down

0 comments on commit 73a41f1

Please sign in to comment.