Commit Graph

48 Commits

Author SHA1 Message Date
xzfc
a0d62330c7 Use fs-err (#7319) 2025-09-29 12:47:10 +00:00
Arnaud Gourlay
360d7bc26d Clippy 1.90 (#7253)
* Fix Clippy 1.90

* fmt
2025-09-15 20:12:11 +02:00
Ivan Pleshkov
2d1b92c16b Create and load for an appendable quantization (#7193)
* Create and load for an appendable quantization

remove feature flag

more todo

review remarks

review remarks

* fix after rebase

* Rename is_appendable to supports_appendable

---------

Co-authored-by: timvisee <tim@visee.me>
2025-09-01 15:49:09 +02:00
Ivan Pleshkov
b03853c33e Quantization storage builder for chunked mmap (#7174)
* Quantization storage builder for chunked mmap

* fix after rebase

* Update lib/segment/src/vector_storage/quantized/quantized_chunked_mmap_storage.rs

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-08-29 16:10:30 +02:00
Ivan Pleshkov
879da486af Remove quantization load from trait (#7113)
* remove quantization load

* refactor load

* fix fmt error

* fix clippy
2025-08-22 14:37:32 +02:00
Ivan Pleshkov
f3b61bbf4a Retrieve files list from quantization storage (#7095)
* Get files list from quantization

* fix ci
2025-08-20 14:15:09 +02:00
Ivan Pleshkov
3f75fae516 EncodedStorage upsert vector (#7048)
* EncodedStorage upsert vector
2025-08-18 17:39:23 +02:00
xzfc
acfdf02da8 Optional scorer methods via TBool (#6989)
* Add common::typelevel module

* Use common::typelevel for score_bytes

* Revert "Split FilteredScorer into FilteredScorer and FilteredQuantizedScorer"

This reverts commit ff3a93ee95.

* FilteredQuantizedScorer

* Extract `struct Filters` from `FilteredScorer` and `FilteredQuantizedScorer`

* Revert "QuantizedVectors::query_scorer_bytes"

This reverts commit 9dee824afd.

* Partial revert "Add QueryScorerBytes::score_bytes"

This reverts commit d80af4f698, but keeps
the QueryScorerBytes trait while removing implementations.

* Partial revert "Add EncodedVectorsBytes::score_point_vs_bytes"

This partially reverts commit c741e42f9a.
- trait `EncodedVectorsBytes` and its implementations: reverted/removed
- calls to `EncodedVectorsBytes::score_point_vs_bytes`: replaced with
  calls to `EncodedVectors::score_bytes`

* Remove unused method FilteredScorer::new_from_raw
2025-08-18 14:40:12 +00:00
Ivan Pleshkov
8961eeaf0a Remove quantization save functions (#7043)
* remove quantization save

* revert convert_binary_encoding fn

* review remarks

* review remark

* review remarks
2025-08-18 13:55:07 +02:00
Ivan Pleshkov
0d1b0ead53 Use PointOffsetType in quantization (#7058)
* Use PointOffsetType in quantization

* review remarks

* review remarks
2025-08-14 16:16:08 +02:00
Ivan Pleshkov
7eb562e891 Quantization flusher (#7046)
* quantization flusher

* review remarks
2025-08-13 12:57:16 +02:00
Ivan Pleshkov
1616806b8f BQ features without vector stats (#7009)
* bq all features without vector stats

* fix tests

* review suggestions

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-08-12 14:58:43 +02:00
Ivan Pleshkov
a3e457d387 Wrap quantization Vec<u8> in a separate structure (#7013)
* separate struct for vec u8 quantization storage

* cgf testing for test storage
2025-08-12 13:20:48 +02:00
xzfc
079ef6fb13 Implement GraphLinksFormat::CompressedWithVectors (#6982)
* Simplify graph_links tests

* Rstest-ify hnsw_index::tests::test_save_load

* Rename EncodedVectorsU8::{get_quantized_vector => get_quantized_vector_offset_and_code}

Reason: it was inconsistent with other implementations of
get_quantized_vector().

* Add QuantizedVectors::{get_quantized_vectors, get_quantized_vector_layout}

* Rename `links_map` to `for_each_link`

* pack_links: expose the updated `raw_links` order

* TestRawScorerProducer: support quantization

* Make GraphLinksSerializer::new return Result

* Rename links/compressed_links into `neighbors`

* Implement GraphLinksFormat::CompressedWithVectors

* GraphLayersWithVectors

* bitpacking: add packed_links_size

* Reorder neighbors: N__VVVVVVVcccccccccc -> Ncccccccccc__VVVVVVV
2025-08-11 17:28:43 +00:00
Tim Visée
1bba3891ec Fix clippy warnings for Rust 1.89 (#6997) 2025-08-07 14:34:52 +02:00
Ivan Pleshkov
766b527ac8 Appendable quantization storage (#6935)
* appendable qunatization storage

fmt

deprecate count in quantization config

fix arm tests build

qunatized storage vectors count

fix ci

are you happy clippy

fix compat tests

undo rename to `deprecated_count`

remove flusher

remove obsolete functions, don't use hardware counter in ram storage

are you happy clippy

fix gpu build

check ci when revert option

revert last commit

* debug ci

* log offsets

* log offsets

* fix compatibility tests

* deprecate count

* fix arm tests

* fix benches

* Update lib/quantization/src/encoded_vectors_binary.rs

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>

---------

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>
2025-08-06 13:51:01 +02:00
xzfc
83005cd2db QueryScorerBytes (#6945)
* Add EncodedVectorsBytes::score_point_vs_bytes

* Add QueryScorerBytes::score_bytes

* QuantizedVectors::query_scorer_bytes

* Split FilteredScorer into FilteredScorer and FilteredQuantizedScorer
2025-07-31 03:05:10 +00:00
Ivan Pleshkov
6521b0df7d bq scalar query benches (#6831)
* bq scalar query benches

* review remarks
2025-07-14 19:28:07 +02:00
Ivan Pleshkov
bac28164ed use vector statistics for scalar bq query (#6835)
* use vector statistics for scalar bq query

* fix minor error

* remove test_binary_scalar_internal test

* do NOT use special file for storing vector stats

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-11 10:15:28 +02:00
Arnaud Gourlay
b606c1be8c Fix HW vector io for scalar quantization (#6848) 2025-07-11 07:56:20 +02:00
Ivan Pleshkov
a38fd0a1e5 simplify 2bit encoding method (#6824) 2025-07-08 12:19:04 +02:00
Ivan Pleshkov
b414a402bb Merge pull request #6728
* # This is a combination of 7 commits.

* SameAsStorage default value

* fix coderabbit warnings

* neon for u8 bq

* sse for u8 bq

* fix windows build

* rename function

* add comments

* fmt

* fix arm build

* review remarks
2025-07-03 14:09:12 +02:00
Ivan Pleshkov
5895877577 Fix sq internal vector encoding (#6763)
* Fix SQ internal vector encoding

* add test

* clippy warning
2025-06-26 15:08:50 +02:00
Ivan Pleshkov
de54049e55 Don't encode quantization query while hnsw build (#6729)
* dont encode quantization query while hnsw build

* add comments

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-06-23 10:34:00 +02:00
Ivan Pleshkov
fe5becdadd Merge pull request #6663
* bq encodings

* are you happy clippy

* are you happy clippy

* are you happy clippy

* are you happy clippy

* gpu tests

* update models

* are you happy fmt

* move additional bits to the end

* fix tests

* Welford's Algorithm

* review remarks

* are you happy clippy

* remove debug println in test

* coderabit nitpicks

* remove unnecessary clone and partialeq

* Use f64 for Welford's Algorithm

* try fix ci

* revert cargo-nextest

* add debug assertions
2025-06-19 18:21:00 +02:00
xzfc
6717d38cc4 Replace some generic parameters with associated types (#6711)
* Make EncodedVectors::EncodedQuery associated type

* Make EncodedStorageBuilder::Storage associated type

* Make QueryScorer::TVector associated type

* Remove TVector from RawScorerImpl generic parameters
2025-06-17 07:32:22 +00:00
Arnaud Gourlay
1fb02a693c Fix vector_io_read for multivector recommendation (#6622)
* Fix vector_io_read for multivector recommendation

* fix

* cleanup

* single disposable

* do not use disposable hardware counter for quantized multivectors
2025-06-05 19:32:57 +02:00
Arnaud Gourlay
1e3017b304 Clippy 1.87 autofix (#6516)
* Clippy 1.87 autofix

* fmt
2025-05-12 15:51:34 +02:00
xzfc
9fedc65bc4 Clear disk cache after read (#6396)
* Move clear_disk_cache to memory::fadvise

* Add memory::fadvise::OneshotFile

* Use OneshotFile
2025-04-17 10:57:47 +02:00
Andrey Vasnetsov
0266508736 disk cache hygiene (#6323)
* wip: implement explicit populate and clear_cache functions for all components

* fmt

* implement clear and populate for vector storages

* fmt

* implement clear and populate for payload storage

* wip: implement explicit populate and clear_cache functions payload indexes

* implement explicit populate and clear_cache functions payload indexes

* fix clippy on CI

* only compile posix_fadvise on linux

* only compile posix_fadvise on linux

* implement explicit populate and clear_cache functions for quantized vectors

* fmt

* remove post-load prefault

* fix typo

* implement is-on-disk for payload indexes, implement clear on drop for segment, implement clear after segment build

* fmt

* also evict quantized vectors after optimization

* re-use and replace advise_dontneed
2025-04-09 10:54:30 +02:00
Arnaud Gourlay
33d062a3a7 Minor cleanups (#6291) 2025-04-01 13:01:10 +02:00
Andrey Vasnetsov
82af7aa481 vector-io-read measurement on query (#6197)
* remove mut getters from HardwareCounterCell, as mutability is not useful

* introduce vector-io multiplier

* remove RealCpuMeasurement structure

* set vector-io reads multipliers

* account vector reads in dense scorers

* fmt

* fix tests

* propagate hw_counter into posting list iterator

* fmt

* fix test

* wip: measure of sparse iterator

* fmt

* optimize skip_to

* minor refactoring

* keep current PointOffset in iterator to prevent unnecessary reads from memory

* adjust sparse search cpu cost - account for datatype

* fix test

* refactor search_context tests

* move tests into a module

* introduce more tests

* grammar

* review fixes

* fix clippy

* fix clippy again

* change disposable -> new
2025-03-24 13:15:04 +01:00
Jojii
e957d6f44a Cardinality estimation IO measurements (#6117)
* Cardinality estimation measurements

* Apply hw measurements to latest changes from dev

* Clippy

* Also measure cardinality estimation for geo index

* Make measured units 'bytes'

* Use PointOffsetType instead of u32 for size calculation

* fix memory cost for check_values_any in mmap index

* fix double counting for value reading in mmap, remove hw_counter from mmap hashmap

* fmt

* fix hw measurement for text index

* Remove non necessary lifetime annotations

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-14 11:05:38 +01:00
Arnaud Gourlay
423a39f301 Remove duplicated mmap utils (#6129) 2025-03-10 12:20:22 +01:00
Tim Visée
3e536347e1 Bump Rust edition to 2024 (#6042)
* Bump Rust edition to 2024

* gen is a reserved keyword now

* Remove ref mut on references

* Mark extern C as unsafe

* Wrap unsafe function bodies in unsafe block

* Geo hash implements Copy, don't reference but pass by value instead

* Replace secluded self import with parent

* Update execute_cluster_read_operation with new match semantics

* Fix lifetime issue

* Replace map_or with is_none_or

* set_var is unsafe now

* Reformat
2025-02-25 11:21:25 +01:00
Kumar Shivendu
38e1f4720b Quantization test improvements (#5976)
* minor change in test

* apply to other tests as well

* imporve var name

* add test for loading empty EncodedVectorsBin from disk

* fmt
2025-02-12 09:45:18 +01:00
Luis Cossío
af74d1b96a bump and migrate to rand 0.9.0 (#5892)
* bump and migrate to rand 0.9.0

also bump rand_distr to 0.5.0 to match it

* Migrate AVX2 and SSE implementations

* Remove unused thread_rng placeholders

* More random migrations

* Migrate GPU tests

* bump seed

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-01-28 16:19:11 +01:00
Arnaud Gourlay
51b574c9bd Fix missing common testing dep on blobstore (#5875)
* Fix missing common testing dep on blobstore

* also for quantization
2025-01-27 10:33:36 +01:00
Jojii
e0d0e233d8 Timeout aware hardware counter (#5555)
* Make hardware counting timeout aware

* improve test

* rebuild everything

* fmt

* post-rebase fixes

* upd tests

* fix tests

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-12-10 12:12:36 +01:00
Andrey Vasnetsov
2a5b46e780 use fsync instead of flush (#5629) 2024-12-10 00:13:03 +01:00
Ivan Pleshkov
1447d1efa8 atomic save quantization metadata (#5627) 2024-12-09 21:24:24 +01:00
xzfc
4548ebe4bf Reduce debug size (#5556)
* debug size: RawScorerImpl::peek_top_iter

* debug size: TypedMultiDenseVector::multi_vectors() uses

* debug size: stop_condition -> stopped
2024-12-02 14:33:35 +00:00
Ivan Pleshkov
a770a7f3a0 Gpu vectors (#5339)
* parent 33b2c176cb
author Ivan Pleshkov <pleshkov.ivan@gmail.com> 1729676438 +0200
committer Ivan Pleshkov <pleshkov.ivan@gmail.com> 1732012991 +0100

parent 33b2c176cb
author Ivan Pleshkov <pleshkov.ivan@gmail.com> 1729676438 +0200
committer Ivan Pleshkov <pleshkov.ivan@gmail.com> 1732012977 +0100

parent 33b2c176cb
author Ivan Pleshkov <pleshkov.ivan@gmail.com> 1729676438 +0200
committer Ivan Pleshkov <pleshkov.ivan@gmail.com> 1732012901 +0100

parent 33b2c176cb
author Ivan Pleshkov <pleshkov.ivan@gmail.com> 1729676438 +0200
committer Ivan Pleshkov <pleshkov.ivan@gmail.com> 1732012766 +0100

parent 33b2c176cb
author Ivan Pleshkov <pleshkov.ivan@gmail.com> 1729676438 +0200
committer Ivan Pleshkov <pleshkov.ivan@gmail.com> 1732012730 +0100

vulkan api wrapper crate

fmt

gpu is not a workspace member

exclude gpu from workspace

disable tests for gpu crate

ash version up

change collection for pipeline builder

gpu test

gpu is not optional

check device features

remove feature

make all fields private

more comments

are you happy fmt

qdrant team as authors

gpu vectors

move changes from magic branch

move storage updates

are you happy codespell

are you happy clippy

don't make storage_impl public

review remarks

are you happy clippy

are you happy fmt

* Update lib/segment/src/index/hnsw_index/gpu/gpu_vector_storage/tests.rs

Co-authored-by: Tim Visée <tim+github@visee.me>

* review remarks

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2024-11-27 09:50:10 +01:00
Arnaud Gourlay
5bce09a1ed Merge quantization integration tests (#5473) 2024-11-19 13:10:01 +01:00
Arnaud Gourlay
2a0f9e9212 Use references for less cloning when possible (#5409) 2024-11-11 10:26:17 +01:00
Jojii
7b677fb7fa Hardware counting for quantization (#5369)
* add cpu measurement for quantization

* clippy

* fix tests

* discard hardware counters in benchmarks

* Forwarding hardware counter in distributed setup (#5371)

* make hardware counter available in distributed setup

* clippy

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-06 16:23:02 +01:00
Arnaud Gourlay
6f1ef42907 Promote criterion to workspace (#5291) 2024-10-22 16:29:23 +02:00
Ivan Pleshkov
f27b6909bd Move quantization repo (#5096)
* move quantization repo

* are you happy fmt

* are you happy clippy

* remove dumping pq to image

* workspace deps

* are you happy clippy
2024-09-17 16:30:26 +02:00