From 9a65de2a1088c1280e5bb980321b78783c1917b8 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 15 Nov 2023 12:40:58 -0600 Subject: [PATCH] Remove static checks for index size. --- .../neighbors/detail/cagra/cagra_serialize.cuh | 14 +------------- .../raft/neighbors/detail/ivf_flat_serialize.cuh | 13 +------------ .../raft/neighbors/detail/ivf_pq_serialize.cuh | 14 +------------- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh b/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh index 439d10cd5e..51c9475434 100644 --- a/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh +++ b/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh @@ -31,19 +31,7 @@ namespace raft::neighbors::cagra::detail { -constexpr int serialization_version = 4; - -// NB: we wrap this check in a struct, so that the updated RealSize is easy to see in the error -// message. -template -struct check_index_layout { - static_assert(RealSize == ExpectedSize, - "The size of the index struct has changed since the last update; " - "paste in the new size and consider updating the serialization logic"); -}; - -constexpr size_t expected_size = 216; -template struct check_index_layout), expected_size>; +constexpr int serialization_version = 3; /** * Save the index to file. diff --git a/cpp/include/raft/neighbors/detail/ivf_flat_serialize.cuh b/cpp/include/raft/neighbors/detail/ivf_flat_serialize.cuh index e6d47393fd..aaf48ae830 100644 --- a/cpp/include/raft/neighbors/detail/ivf_flat_serialize.cuh +++ b/cpp/include/raft/neighbors/detail/ivf_flat_serialize.cuh @@ -34,18 +34,7 @@ namespace raft::neighbors::ivf_flat::detail { // backward compatibility. // TODO(hcho3) Implement next-gen serializer for IVF that allows for expansion in a backward // compatible fashion. -constexpr int serialization_version = 5; - -// NB: we wrap this check in a struct, so that the updated RealSize is easy to see in the error -// message. -template -struct check_index_layout { - static_assert(RealSize == ExpectedSize, - "The size of the index struct has changed since the last update; " - "paste in the new size and consider updating the serialization logic"); -}; - -template struct check_index_layout), 368>; +constexpr int serialization_version = 4; /** * Save the index to file. diff --git a/cpp/include/raft/neighbors/detail/ivf_pq_serialize.cuh b/cpp/include/raft/neighbors/detail/ivf_pq_serialize.cuh index 34446a98e4..038bf8d7cc 100644 --- a/cpp/include/raft/neighbors/detail/ivf_pq_serialize.cuh +++ b/cpp/include/raft/neighbors/detail/ivf_pq_serialize.cuh @@ -36,19 +36,7 @@ namespace raft::neighbors::ivf_pq::detail { // backward compatibility. // TODO(hcho3) Implement next-gen serializer for IVF that allows for expansion in a backward // compatible fashion. -constexpr int kSerializationVersion = 4; - -// NB: we wrap this check in a struct, so that the updated RealSize is easy to see in the error -// message. -template -struct check_index_layout { - static_assert(RealSize == ExpectedSize, - "The size of the index struct has changed since the last update; " - "paste in the new size and consider updating the serialization logic"); -}; - -// TODO: Recompute this and come back to it. -template struct check_index_layout), 536>; +constexpr int kSerializationVersion = 3; /** * Write the index to an output stream