Skip to content

Commit

Permalink
Remove static checks for serialization size (#1997)
Browse files Browse the repository at this point in the history
This PR removes static checks for serialization size. Upstream changes like rapidsai/rmm#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: #1997
  • Loading branch information
cjnolet committed Nov 15, 2023
1 parent 77bc461 commit 31fcbf1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 36 deletions.
12 changes: 0 additions & 12 deletions cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <size_t RealSize, size_t ExpectedSize>
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<sizeof(index<double, std::uint64_t>), expected_size>;

/**
* Save the index to file.
*
Expand Down
13 changes: 1 addition & 12 deletions cpp/include/raft/neighbors/detail/ivf_flat_serialize.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <size_t RealSize, size_t ExpectedSize>
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<sizeof(index<double, std::uint64_t>), 328>;

/**
* Save the index to file.
*
Expand Down
12 changes: 0 additions & 12 deletions cpp/include/raft/neighbors/detail/ivf_pq_serialize.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <size_t RealSize, size_t ExpectedSize>
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<sizeof(index<std::uint64_t>), 480>;

/**
* Write the index to an output stream
*
Expand Down

0 comments on commit 31fcbf1

Please sign in to comment.