Skip to content
Closed
Changes from all commits
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
18 changes: 7 additions & 11 deletions faiss/gpu/GpuIndexIVFPQ.cu
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,13 @@ void GpuIndexIVFPQ::verifyPQSettings_() const {
"Bits per code must be 8 (passed %d)",
bitsPerCode_);
}
}

// The number of bytes per encoded vector must be one we support
FAISS_THROW_IF_NOT_FMT(
ivfpqConfig_.interleavedLayout ||
IVFPQ::isSupportedPQCodeLength(subQuantizers_),
"Number of bytes per encoded vector / sub-quantizers (%d) "
"is not supported",
subQuantizers_);

if (!should_use_cuvs(config_)) {
// The number of bytes per encoded vector must be one we support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this whole block can be moved up into the block on line 557-567 right? now everything else in this function is !should_use_cuvs(config_)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right! I have changed the code to the right place to make the logic of the code clearer.

FAISS_THROW_IF_NOT_FMT(
ivfpqConfig_.interleavedLayout ||
IVFPQ::isSupportedPQCodeLength(subQuantizers_),
"Number of bytes per encoded vector / sub-quantizers (%d) "
"is not supported",
subQuantizers_);
// Sub-quantizers must evenly divide dimensions available
FAISS_THROW_IF_NOT_FMT(
this->d % subQuantizers_ == 0,
Expand Down