Correct quantized HNSW validation to be in-line with HNSW (#13263)

When intra-merge parallelism was introduced, the validation that numWorkers must ==1 with a null executor service was removed from Lucene99HnswVectorsFormat. However, I forgot to remove that validation from Lucene99HnswScalarQuantizedVectorsFormat.

This corrects that mistake, allowing Lucene99HnswScalarQuantizedVectorsFormat and Lucene99HnswVectorsFormat to take advantage of the merge-schedulers intra-merge threading.
This commit is contained in:
Benjamin Trent 2024-04-04 12:05:25 -04:00 committed by GitHub
parent 2ee537ce16
commit 6104c86abc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 7 deletions

View File

@ -120,10 +120,6 @@ public final class Lucene99HnswScalarQuantizedVectorsFormat extends KnnVectorsFo
}
this.maxConn = maxConn;
this.beamWidth = beamWidth;
if (numMergeWorkers > 1 && mergeExec == null) {
throw new IllegalArgumentException(
"No executor service passed in when " + numMergeWorkers + " merge workers are requested");
}
if (numMergeWorkers == 1 && mergeExec != null) {
throw new IllegalArgumentException(
"No executor service is needed as we'll use single thread to merge");

View File

@ -217,9 +217,6 @@ public class TestLucene99HnswQuantizedVectorsFormat extends BaseKnnVectorsFormat
expectThrows(
IllegalArgumentException.class,
() -> new Lucene99HnswScalarQuantizedVectorsFormat(20, 100, 0, 7, false, 0.8f, null));
expectThrows(
IllegalArgumentException.class,
() -> new Lucene99HnswScalarQuantizedVectorsFormat(20, 100, 100, 7, false, null, null));
expectThrows(
IllegalArgumentException.class,
() ->