Skip to content

Commit 73a41f1

Browse files
mengdilinfacebook-github-bot
authored andcommitted
simplify and refactor create_servicelab_experiment utility (facebookresearch#3867)
Summary: Pull Request resolved: facebookresearch#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
1 parent 83d0599 commit 73a41f1

4 files changed

+4
-20
lines changed

faiss/perf_tests/bench_scalar_quantizer_accuracy.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
#include <faiss/perf_tests/utils.h>
9-
#include <fmt/format.h>
109
#include <gflags/gflags.h>
1110
#include <cstdio>
1211
#include <map>
@@ -76,7 +75,7 @@ int main(int argc, char** argv) {
7675

7776
for (auto& [bench_name, quantizer_type] : benchs) {
7877
benchmark::RegisterBenchmark(
79-
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
78+
bench_name.c_str(),
8079
bench_reconstruction_error,
8180
quantizer_type,
8281
d,

faiss/perf_tests/bench_scalar_quantizer_decode.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
#include <faiss/perf_tests/utils.h>
9-
#include <fmt/format.h>
109
#include <gflags/gflags.h>
1110
#include <omp.h>
1211
#include <cstdio>
@@ -63,11 +62,7 @@ int main(int argc, char** argv) {
6362

6463
for (auto& [bench_name, quantizer_type] : benchs) {
6564
benchmark::RegisterBenchmark(
66-
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
67-
bench_decode,
68-
quantizer_type,
69-
d,
70-
n)
65+
bench_name.c_str(), bench_decode, quantizer_type, d, n)
7166
->Iterations(iterations);
7267
}
7368

faiss/perf_tests/bench_scalar_quantizer_distance.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#include <fmt/format.h>
98
#include <gflags/gflags.h>
109
#include <omp.h>
1110
#include <cstdio>
@@ -72,11 +71,7 @@ int main(int argc, char** argv) {
7271

7372
for (auto& [bench_name, quantizer_type] : benchs) {
7473
benchmark::RegisterBenchmark(
75-
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
76-
bench_distance,
77-
quantizer_type,
78-
d,
79-
n)
74+
bench_name.c_str(), bench_distance, quantizer_type, d, n)
8075
->Iterations(iterations);
8176
}
8277
benchmark::RunSpecifiedBenchmarks();

faiss/perf_tests/bench_scalar_quantizer_encode.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#include <fmt/format.h>
98
#include <gflags/gflags.h>
109
#include <omp.h>
1110
#include <cstdio>
@@ -57,11 +56,7 @@ int main(int argc, char** argv) {
5756

5857
for (auto& [bench_name, quantizer_type] : benchs) {
5958
benchmark::RegisterBenchmark(
60-
fmt::format("{}_{}d_{}n", bench_name, d, n).c_str(),
61-
bench_encode,
62-
quantizer_type,
63-
d,
64-
n)
59+
bench_name.c_str(), bench_encode, quantizer_type, d, n)
6560
->Iterations(iterations);
6661
}
6762

0 commit comments

Comments
 (0)