Commit Graph

291 Commits

Author SHA1 Message Date
dependabot[bot]
f230629fa0 build(deps): bump log from 0.4.26 to 0.4.27 (#6247)
* build(deps): bump log from 0.4.26 to 0.4.27

Bumps [log](https://github.com/rust-lang/log) from 0.4.26 to 0.4.27.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.26...0.4.27)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* put variables inside the strings for log macros

* also for pyroscope

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-03-31 16:19:55 +02:00
Jojii
5cd7239b61 Measure Payload Index IO Writes (#6137)
* Prepare measurement of index creation + Remove vector deletion
measurement

* add hw_counter to add_point functions

* Adjust add_point(..) function signatures

* Add new measurement type: payload index IO write

* Measure payload index IO writes

* Some Hw measurement performance improvements

* Review remarks

* Fix measurements in distributed setups

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-31 16:19:19 +02:00
Andrey Vasnetsov
ad4743a85f 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-31 16:19:02 +02:00
Andrey Vasnetsov
13f0a87c80 Mmap in-ram payload indexes without RocksDB (#6148)
* refactor IndexSelector to support mmap with populate

* specify populate flag DynamicMmapFlags

* replace db+flag with enum StorageType

* fix flag

* disable by default

* clippy

* remove outdated comment

* remove comment

* Update lib/segment/src/index/field_index/bool_index/mmap_bool_index.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-21 11:45:04 +01:00
Jojii
56a7cfdb20 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-21 11:44:55 +01:00
xzfc
724b45f182 Add BitSliceExt::get_bit (#6162) 2025-03-21 11:43:57 +01:00
Jojii
9676f9a2c6 Io measurement cleanup and tests (#5949)
* HW measurement cleanup and more tests

* Fix wrong measurements

* Use new assertion function

* Fix Payload Measurement bug. Fix tests
2025-03-21 11:43:31 +01:00
Jojii
a2d7947917 Measure io writes for vector upsertions (#5944)
* Add counter to vector storage API

* Measuring IO write for dense vectors

* Tests, GPU and sparse

* Measure multi vectors too

* Fix comment
2025-03-21 11:42:40 +01:00
Andrey Vasnetsov
706b1a3166 IsEmpty/IsNull index (#6088)
* create initial strucutres

* clippy

* start field-query refactoring

* start field-query refactoring (2/N)

* start field-query refactoring (3/N): duplicate is_empty/null condiftions as field condition

* start field-query refactoring (4/N): re-instate is_empty fallback in case new index is not built yet

* filter for is_empty/is_null

* implement add/remove point

* upd schema

* open and create of null-index

* create null-index

* fix test

* Update lib/segment/src/index/query_optimization/condition_converter.rs

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

* unit test for null-index

* more unit tests

* add openapi tests

* fmt

* fix for integartion tests

* rabbit review fix

* make [null] non-empty

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-21 11:41:12 +01:00
Tim Visée
8ad2b34265 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-03-21 11:38:56 +01:00
Roman Titov
4a26134bec Prototype partial segment snapshots and SegmentManifest format (#5928)
Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-21 11:36:39 +01:00
Luis Cossío
b4328bb7c5 [mmap sparse vector storage] return cancelled error if stopped (#5938)
* return cancelled error if stopped

* add doc comment and renames
2025-02-11 14:40:25 +01:00
Luis Cossío
315a35fe73 Rename blob_store as gridstore (#5918)
* rename blob_store into gridstore

Article is incoming and I feel like gridstore is a better fit to the
architecture

* fmt

* remove outdated TODO
2025-02-11 14:38:05 +01:00
Arnaud Gourlay
57fa169168 Fix flushing of RocksDB sparse vector storage (#5908) 2025-02-11 14:37:36 +01:00
Jojii
77f65ef95f HwCounter rename IO metrics (#5898)
* Rename io metrics and add vector_io_write

* Chore: Cleanup obsolete TODOs and simplify retrieving HardwareCounterCells (#5899)
2025-02-11 14:37:24 +01:00
Luis Cossío
f110328296 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-02-11 14:36:20 +01:00
Arnaud Gourlay
3b13e5ad58 Fix flush of deleted flags for mmap payload storage (#5861)
* Fix flush of deleted flags for mmap payload storage

* no filtering
2025-01-23 14:29:43 +01:00
Jojii
c815a1bd43 Implement more IO measurements for PayloadStorage (#5822)
* Finish io measurement for payload storage

* Remove done TODOs

* review remarks

* make signature of `wipe()` consistent

* Remove hardware_counter from tracker.rs and make interfaces consistent

* Add hw_counter to payloads update_storage function from dev
2025-01-23 14:29:39 +01:00
Jojii
b0eb8d3431 Io measurement rename functions (#5816)
* replace _measured functions with original name

* Rename more functions
2025-01-23 14:29:32 +01:00
xzfc
eaaa31e34d Fix cargo doc warnings (#5854) 2025-01-23 14:29:19 +01:00
xzfc
012e293e04 FixedLengthPriorityQueue: explicit sorted/unsorted methods (#5837) 2025-01-23 14:28:59 +01:00
Luis Cossío
7cb7b18a06 Remove setting OpenOptions flags to false (#5840) 2025-01-23 14:28:37 +01:00
Roman Titov
1a4cc22589 Cleanup #[allow(dead_code)] annotations (#5818) 2025-01-23 14:27:56 +01:00
Andrey Vasnetsov
472f8e0a71 use 64-bit dim-id for storing sparse vectors (#5687)
* use 64-bit dim-id for storing sparse vectors

* allow to disable compression in blob storage

* use bitpack compression instead of lz4

* add basic bench for mmap sparse vector storage

* misc

* bump storage compat pre-release

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-01-08 14:11:43 +01:00
Luis Cossío
f2b142620f Fast loading of mmap sparse storage (#5533)
* use mmap bitslice and a metadata file to avoid loading

* fix and test reported files

* add new files to flusher

* update rocksdb+blob_store compatibility test

* switch to DynamicMmapFlags

* fix setting deleted to `false` on short bitslice

* remove `MmapBitSlice::extend`

* add some more tests to mmap sparse vector storage

* calculate deleted_count and next_point_offset on load

* get rid of metadata file

* cleanup

* fix test

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-01-08 14:07:46 +01:00
Luis Cossío
3725c7c723 Prefer vector index for size_of_available_vectors_in_bytes (#5587)
* get total sparse size from inverted index

* populate on load if not present

* use debug assertion

* correct size calculation

* r u happy clippy

* fix total sparse size in immutable ram

* don't use options. move size_of_available_vectors to other traits

* adjust test

* fix rebase
2025-01-08 14:07:43 +01:00
Luis Cossío
681506cea7 Integrate mmap bool index (#5571)
* add on_disk option for bool index

* test that all files are covered

* generate openapi and docs

* clippy

* remove `populate` changes

* use `walkdir` crate

* Apply clippy suggestions

---------

Co-authored-by: timvisee <tim@visee.me>
2025-01-08 14:04:24 +01:00
Jojii
5aee24cc08 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>
2025-01-08 14:03:52 +01:00
Andrey Vasnetsov
4abd77158a use fsync instead of flush (#5629) 2025-01-08 14:01:25 +01:00
Ivan Pleshkov
33f237e151 Atomic save chunked mmap config (#5628)
* atomic save chunked mmap config

* are you happy clippy

* log error

* review remarks
2025-01-08 14:01:05 +01:00
Arnaud Gourlay
c6a964ecfa Enforce clippy needless_pass_by_ref_mut (#5561) 2024-12-09 11:17:33 +01:00
xzfc
8bbe66c0fb Reduce debug size (#5556)
* debug size: RawScorerImpl::peek_top_iter

* debug size: TypedMultiDenseVector::multi_vectors() uses

* debug size: stop_condition -> stopped
2024-12-09 11:16:38 +01:00
Luis Cossío
443358dbe7 restructure sparse storages module (#5532) 2024-12-09 11:07:04 +01:00
Luis Cossío
c10c145a75 Compatibility for mmap sparse vectors (#5454)
* implement mmap sparse vector storage

* add to VectorStorageEnum

* clippy

* add tests, fix both simple and mmap storages

* smol correction on total_vector_count

* add sparse storage type to config

* fix reading config without storage type

* generate openapi

* use blob_store by path

* hidden setting to enable new storage

* validate existing path in `BlobStore::open()`

* use new dir for each sparse vector name

* fix and rename `max_point_offset`

Plus some extra refactors

* add storage compat test, to always check both storages work

* fix opening of storage + other misc fixes

* FIX!!!

`Unset` operations in the Tracker weren't updating the
`next_pointer_id`. So, when reopening the storage, those points wouldn't
get marked as deleted in the bitslice, thus creating the illusion that
they should exist, when they did not.

* refactor naming from `iter_*` to `for_each_*`

* fix checking for BlobStore existance

* fix typo

* fix error message

* better docs for open_or_create

* fix after rebase
2024-12-09 11:07:01 +01:00
Arnaud Gourlay
f416f2b98f Clippy 1.83 (#5513)
* Clippy 1.83

* there is more
2024-12-09 11:06:24 +01:00
Ivan Pleshkov
5327a322a6 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-12-09 11:06:20 +01:00
Luis Cossío
4e6673966c [vector storages] Don't skip marking as deleted (#5510)
* don't skip marking as deleted

* edit test, which fails in dev

* better description
2024-12-09 10:52:31 +01:00
Arnaud Gourlay
d15ef49719 Optimize mmap sequential access for large scoring (#5440)
* Optimize mmap sequential access for large scoring

* use it

* make windows happy

* add missing CPU counters

* Will not need

* more unix build

* add benchmark

* fix and bench cmp

* larger batch size

* start appendable mmap implem

* reenable debug for bench

* remove old impl for comparison

* impl for chunk mmap

* fix windows

* debug assert

* errare human est

* windows cfg

* generalize peek_top_iter

* remove blanket implementation to force explicit decision

* less TODO

* account for size of T

* fmr

* simplify chunk impl

* relax constraint on contiguous ids

* remove madvice WILLNEED and clean batching infra

* some premature optimizations

* extra sequential mmap for MMapVectorStorage

* add read-only typed mmap

* add read-only typed mmap

* fix comments

* implement batch reads for chuncked mmap

* fix is_read_with_prefetch_efficient

* cleanup

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-18 11:18:38 +01:00
Andrey Vasnetsov
28a89060d1 use more stable computation of vectors_size_bytes + refactoring (#5437)
* use more stable computation of vectors_size_bytes + refactoring

* sync openapi
2024-11-18 11:16:57 +01:00
Arnaud Gourlay
98633cbd3f Use references for less cloning when possible (#5409) 2024-11-12 14:39:13 +01:00
Arnaud Gourlay
28dfb3ef74 Remove redundant clones (#5402)
* Remove redundant clones

* fmt
2024-11-08 14:49:24 +01:00
Jojii
faf645ec2e 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-08 11:26:39 +01:00
Andrey Vasnetsov
bf75ceef57 detailed is_on_disk (#5373) 2024-11-08 11:26:07 +01:00
Kumar Shivendu
390d4c4503 Track vector storage usage in bytes for each of the segments (#5292)
* Track disk usage for each of the vectors and segments

* Dont extend vector_data field

* Remove comment and improve var name

* Introduce vectors_size_bytes and rename available_size_in_bytes

* Introduce vectors_size_bytes and rename available_size_in_bytes

* fix linter

* Avoid converting to u64

* calculate vectors_size_bytes for proxy segments

* Fix OpenAPI spec

* fix typo
2024-11-08 11:16:04 +01:00
Jojii
cd8efa8f17 Hw counter utilization checks (#5288)
* Enforce usage of hardware counter values

* improve comments

* log a warning in release mode

* some minor improvements

* avoid cloning for hardware counter

* fmt

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-08 11:15:41 +01:00
Jojii
49eba0930f Cpu measurements for dense vector + custom sparse scorer (#5261)
* add measurements for dense vector and custom sparse scorer

* adjust sparse vector scoring cpu measurement

* review suggestions

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-08 11:11:46 +01:00
Jojii
4c9cda4ad8 Add CPU measurement for multivectors (#5241)
* Add CPU measurement for multivectors

* add further test sparse vector search

* make updating vector_query_context consistent

* review fix + take element type into consideration

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-08 11:09:27 +01:00
Arnaud Gourlay
8736f8ed66 [perf] Do not capture backtrace on get_sparse_vector_opt (#5219)
* Do not capture backtrace on get_sparse_vector_opt

* clean import
2024-11-08 11:05:08 +01:00
Arnaud Gourlay
d4716da8e7 fix lints for Clippy 1.82 (#5229)
* fix lints for Clippy 1.82

* regen openapi
2024-11-08 10:59:36 +01:00
Andrey Vasnetsov
1d0ee7ea32 Inference interface in REST and gRPC (#5165)
* include document & image objects into grpc API

* introduce image and object to rest api

* minor refactoring

* rename Vector -> VectorInternal

* decompose vector data structures

* add schema

* fmt

* grpc docs

* fix conversion

* fix clippy

* fix another conversion

* rename VectorInput -> VectorInputInternal

* replace grpc TryFrom with async functions

* fmt

* replace rest TryFrom with async functions

* add image and object into query rest

* separate inference related conversions

* move json-related conversions into a separate file

* move vector-related transformations into a separate file

* move more vector related-conversions into dedicated module
2024-11-08 10:55:15 +01:00