Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/branch-23.12' into fea-2312-be…
Browse files Browse the repository at this point in the history
…nch-ann-conf
  • Loading branch information
divyegala committed Oct 30, 2023
2 parents 4d764f0 + 9ad76fa commit c7f9af3
Show file tree
Hide file tree
Showing 11 changed files with 299 additions and 150 deletions.
6 changes: 2 additions & 4 deletions cpp/bench/ann/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ if(RAFT_ANN_BENCH_USE_GGNN)
endif()

if(RAFT_ANN_BENCH_USE_FAISS)
# We need to ensure that faiss has all the conda
# information. So we currently use the very ugly
# hammer of `link_libraries` to ensure that all
# targets in this directory and the faiss directory
# We need to ensure that faiss has all the conda information. So we currently use the very ugly
# hammer of `link_libraries` to ensure that all targets in this directory and the faiss directory
# will have the conda includes/link dirs
link_libraries($<TARGET_NAME_IF_EXISTS:conda_env>)
include(cmake/thirdparty/get_faiss.cmake)
Expand Down
17 changes: 15 additions & 2 deletions cpp/bench/ann/src/common/ann_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@

namespace raft::bench::ann {

enum Objective {
THROUGHPUT, // See how many vectors we can push through
LATENCY // See how fast we can push a vector through
};

enum class MemoryType {
Host,
HostMmap,
Expand Down Expand Up @@ -59,10 +64,17 @@ inline auto parse_memory_type(const std::string& memory_type) -> MemoryType
}
}

struct AlgoProperty {
class AlgoProperty {
public:
inline AlgoProperty() {}
inline AlgoProperty(MemoryType dataset_memory_type_, MemoryType query_memory_type_)
: dataset_memory_type(dataset_memory_type_), query_memory_type(query_memory_type_)
{
}
MemoryType dataset_memory_type;
// neighbors/distances should have same memory type as queries
MemoryType query_memory_type;
virtual ~AlgoProperty() = default;
};

class AnnBase {
Expand All @@ -79,7 +91,8 @@ template <typename T>
class ANN : public AnnBase {
public:
struct AnnSearchParam {
virtual ~AnnSearchParam() = default;
Objective metric_objective = Objective::LATENCY;
virtual ~AnnSearchParam() = default;
[[nodiscard]] virtual auto needs_dataset() const -> bool { return false; };
};

Expand Down
Loading

0 comments on commit c7f9af3

Please sign in to comment.