Skip to content

Commit 476b0c2

Browse files
weiwchfacebook-github-bot
authored andcommitted
fix bug: IVFPQ of raft/cuvs does not require redundant check (facebookresearch#4241)
Summary: The IVFPQ of raft/cuvs does not require pq length check for Faiss' original implementation. This check make IVFPQ support limited parameters than raft/cuvs in vain. The check of supported PQ code length here https://github.com/facebookresearch/faiss/blob/ede2c99137efed18150839c07796e0856faec383/faiss/gpu/impl/IVFPQ.cu#L80-L102 is for Faiss' original CUDA implementation. Raft/cuvs support more choices. The wiki of faiss also describe the limitation (https://github.com/facebookresearch/faiss/wiki/Faiss-on-the-GPU#limitations), which needs to be update, too. Raft/cuvs is not limited to those choices. Pull Request resolved: facebookresearch#4241 Reviewed By: bshethmeta, gtwang01 Differential Revision: D72200376 Pulled By: mnorris11 fbshipit-source-id: 2b81e822a397f3ab4a7c691e38be0186535d129d
1 parent 545ca58 commit 476b0c2

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

faiss/gpu/GpuIndexIVFPQ.cu

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -566,17 +566,13 @@ void GpuIndexIVFPQ::verifyPQSettings_() const {
566566
"Bits per code must be 8 (passed %d)",
567567
bitsPerCode_);
568568
}
569-
}
570-
571-
// The number of bytes per encoded vector must be one we support
572-
FAISS_THROW_IF_NOT_FMT(
573-
ivfpqConfig_.interleavedLayout ||
574-
IVFPQ::isSupportedPQCodeLength(subQuantizers_),
575-
"Number of bytes per encoded vector / sub-quantizers (%d) "
576-
"is not supported",
577-
subQuantizers_);
578-
579-
if (!should_use_cuvs(config_)) {
569+
// The number of bytes per encoded vector must be one we support
570+
FAISS_THROW_IF_NOT_FMT(
571+
ivfpqConfig_.interleavedLayout ||
572+
IVFPQ::isSupportedPQCodeLength(subQuantizers_),
573+
"Number of bytes per encoded vector / sub-quantizers (%d) "
574+
"is not supported",
575+
subQuantizers_);
580576
// Sub-quantizers must evenly divide dimensions available
581577
FAISS_THROW_IF_NOT_FMT(
582578
this->d % subQuantizers_ == 0,

0 commit comments

Comments
 (0)