From 31fcbf17b45bdd40235056eae3b81dafa7a0d6a8 Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Wed, 15 Nov 2023 18:28:52 -0500 Subject: [PATCH] Remove static checks for serialization size (#1997) This PR removes static checks for serialization size. Upstream changes like https://github.com/rapidsai/rmm/pull/1370 have altered these sizes and break RAFT CI. An alternative approach to verifying serialization will be developed. Authors: - Corey J. Nolet (https://github.com/cjnolet) - Bradley Dice (https://github.com/bdice) Approvers: - Divye Gala (https://github.com/divyegala) - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/raft/pull/1997 --- .../raft/neighbors/detail/cagra/cagra_serialize.cuh | 12 ------------ .../raft/neighbors/detail/ivf_flat_serialize.cuh | 13 +------------ .../raft/neighbors/detail/ivf_pq_serialize.cuh | 12 ------------ 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh b/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh index eb21b75d3a..51c9475434 100644 --- a/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh +++ b/cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh @@ -33,18 +33,6 @@ namespace raft::neighbors::cagra::detail { constexpr int serialization_version = 3; -// 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 = 200; -template struct check_index_layout), expected_size>; - /** * 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 61a6046273..aaf48ae830 100644 --- a/cpp/include/raft/neighbors/detail/ivf_flat_serialize.cuh +++ b/cpp/include/raft/neighbors/detail/ivf_flat_serialize.cuh @@ -29,24 +29,13 @@ namespace raft::neighbors::ivf_flat::detail { -// Serialization version 3 +// Serialization version // No backward compatibility yet; that is, can't add additional fields without breaking // backward compatibility. // TODO(hcho3) Implement next-gen serializer for IVF that allows for expansion in a backward // compatible fashion. 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"); -}; - -template struct check_index_layout), 328>; - /** * 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 f01035cad3..038bf8d7cc 100644 --- a/cpp/include/raft/neighbors/detail/ivf_pq_serialize.cuh +++ b/cpp/include/raft/neighbors/detail/ivf_pq_serialize.cuh @@ -38,18 +38,6 @@ namespace raft::neighbors::ivf_pq::detail { // compatible fashion. constexpr int kSerializationVersion = 3; -// 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), 480>; - /** * Write the index to an output stream *