-
Couldn't load subscription status.
- Fork 25.6k
Test BBQ recall with different bit sizes #129729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Test BBQ recall with different bit sizes #129729
Conversation
…e-quantization-bits # Conflicts: # qa/vector/src/main/java/org/elasticsearch/test/knn/CmdLineArgs.java # server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java
| this.byteBuffer = ByteBuffer.allocate(dimension); | ||
| this.binaryValue = byteBuffer.array(); | ||
| this.binaryQuantizer = quantizer; | ||
| this.discretizedDimensions = BQVectorUtils.discretize(dimension, 64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem needed, you are just storing the raw bytes.
| OffHeapBinarizedQueryVectorValues(IndexInput data, int dimension, int size) { | ||
| this.slice = data; | ||
| this.dimension = dimension; | ||
| this.size = size; | ||
| // 4x the quantized binary dimensions | ||
| int binaryDimensions = (BQVectorUtils.discretize(dimension, 64) / 8) * BQSpaceUtils.B_QUERY; | ||
| this.byteBuffer = ByteBuffer.allocate(binaryDimensions); | ||
| this.binaryValue = byteBuffer.array(); | ||
| // + 1 for the quantized sum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is used, but its incorrect as you aren't packing the bits, binaryDimensions is just dimensions.
…e option combinations
…ntization-bits' into non-issue/bbq-multiple-quantization-bits
Related to #129421
Creates a new
ES910BinaryQuantizedVectorsFormatthat accepts variable bit sizes for indexing and querying.KnnIndexTester and related classes have been modified to allow testing with different bit sizes. Testing is possible via the following configuration file:
{ "doc_vectors" : "/path_to_vectors", "query_vectors" : "/path_to_queries", "num_docs" : 100000, "num_queries" : 1000, "index_type" : "flat", "over_sampling_factor" : 1, "search_threads" : 40, "index_threads" : 40, "reindex" : true, "force_merge" : true, "vector_space" : "cosine", "quantize_bits" : 1, "vector_encoding" : "float32", "dimensions" : 768, "use_new_flat_vectors_format": true, "quantize_query_bits" : 4 }Where:
quantize_bitsdetermine the quantization for vectors at index timequantize_query_bitsdetermine the quantization for queriesuse_new_flat_vectors_format: true to allow testing the variable bit sizes, false to fall back to the previous vector format (useful to compare quantize_bits:1 and quantize_query_bits: 4 to check the baseline)