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

Add fusedL2NN benchmark #936

Merged
merged 3 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove former fusedL2NN benchmark under cpp/bench/neighbors, add cust…
…om counters, remove invalid but unused kernel policies
  • Loading branch information
Nyrio committed Oct 25, 2022
commit 44ec5e1e58d280958c0ddc94765472d914ca10cd
1 change: 0 additions & 1 deletion cpp/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ if(BUILD_BENCH)

ConfigureBench(NAME NEIGHBORS_BENCH
PATH
bench/neighbors/fused_l2_nn.cu
bench/neighbors/knn/brute_force_float_int64_t.cu
bench/neighbors/knn/brute_force_float_uint32_t.cu
bench/neighbors/knn/ivf_flat_float_int64_t.cu
Expand Down
19 changes: 17 additions & 2 deletions cpp/bench/distance/fused_l2_nn.cu
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ struct fusedl2nn : public fixture {
true,
stream);
});

int64_t num_flops = 2 * params.m * params.n * params.k;

int64_t read_elts = params.n * params.k + params.m * params.k;
int64_t write_elts = params.m;

state.counters["FLOP/s"] = benchmark::Counter(
num_flops, benchmark::Counter::kIsIterationInvariantRate, benchmark::Counter::OneK::kIs1000);

state.counters["BW Wr"] = benchmark::Counter(write_elts * sizeof(OutT),
benchmark::Counter::kIsIterationInvariantRate,
benchmark::Counter::OneK::kIs1000);
state.counters["BW Rd"] = benchmark::Counter(read_elts * sizeof(DataT),
benchmark::Counter::kIsIterationInvariantRate,
benchmark::Counter::OneK::kIs1000);
}

private:
Expand Down Expand Up @@ -129,10 +144,10 @@ std::vector<fusedl2nn_inputs> getFusedL2NNInputs()
FUSEDL2NN_BENCH(float, int, float);
FUSEDL2NN_BENCH(double, int, double);
FUSEDL2NN_BENCH(float, int, (raft::KeyValuePair<int, float>));
FUSEDL2NN_BENCH(float, int, (raft::KeyValuePair<int, float>));
FUSEDL2NN_BENCH(double, int, (raft::KeyValuePair<int, double>));
FUSEDL2NN_BENCH(float, int64_t, float);
FUSEDL2NN_BENCH(double, int64_t, double);
FUSEDL2NN_BENCH(float, int64_t, (raft::KeyValuePair<int64_t, float>));
FUSEDL2NN_BENCH(float, int64_t, (raft::KeyValuePair<int64_t, float>));
FUSEDL2NN_BENCH(double, int64_t, (raft::KeyValuePair<int64_t, double>));

} // namespace raft::bench::distance
123 changes: 0 additions & 123 deletions cpp/bench/neighbors/fused_l2_nn.cu

This file was deleted.

2 changes: 0 additions & 2 deletions cpp/include/raft/linalg/contractions.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,12 @@ struct Policy2x8 {
template <int _veclen>
struct Policy2x8<float, _veclen> {
typedef KernelPolicy<float, _veclen, 16, 2, 8, 8, 32> Policy;
typedef ColKernelPolicy<float, _veclen, 16, 2, 8, 8, 32> ColPolicy;
};

template <int _veclen>
struct Policy2x8<double, _veclen> {
// this is not used just for keeping compiler happy.
typedef KernelPolicy<double, _veclen, 32, 1, 2, 8, 32> Policy;
typedef ColKernelPolicy<double, _veclen, 32, 1, 2, 8, 32> ColPolicy;
};
/** @} */

Expand Down