Commit Graph
100 Commits
Author SHA1 Message Date
Jojii eb0ef2a9d8 [TQDT] TurboMultiVectorStorage (#9414)
* TurboQuant Datatype for Multivectors

* Fix update_from and add non-appendable open()

* Fix unnecessary allocations + wrap chunk boundaries

* Congruence tests TurboVectorStorage <-> TurboMultiVectorStorage(vecs=1)

* Only use appendable backend for turbo4-multivectors

* Simplify update_from

* Never place multivectors across chunk boundaries (skip tail, reject oversized)

* Review remarks
2026-06-12 12:03:17 +02:00
Jojii fd04db2b14 Fix inverted delete_vector return in appendable mmap storages (#9410) 2026-06-10 12:54:05 +02:00
Jojii ff4d24cbd0 [TQDT] Integration into VectorStorageEnum (#9399)
* Integrate TurboVectorStorage into VectorStorageEnum

# Conflicts:
#	lib/segment/src/segment_constructor/batched_reader.rs
#	lib/segment/src/vector_storage/vector_storage_base.rs

* Review remarks

* Allow Turbo4 datatype as inlined HNSW vector
2026-06-10 11:06:41 +02:00
Jojii 617d44bde8 [TQDT] TurboVectorStorage Implementation (#9331)
* Partial function impls for TurboVectorStorage

* create/load functionality + tests

# Conflicts:
#	lib/segment/src/vector_storage/turbo/mod.rs
#	lib/segment/src/vector_storage/turbo/turbo_encoded_vectors.rs

* Fix vectors are not rotated back

* update_from impl

* Rebase fixes

* Proper update_from for ChunkedMmap + better tests

* Improve test coverage

* Move update_from to new DenseTQVectorStorage trait

* Review remark quantization::DistanceType

* Add populate and clear_cache to TurboVectorStorage and TurboEncodedVectorStorage
2026-06-09 13:53:32 +02:00
Jojii 5970faf59e Fix CI (caused by indirectly related merge-conflicts) (#9360) 2026-06-08 12:22:12 +02:00
Jojii 3cfd7e4f36 [TQDT] Basic structure for TurboVectorStorage (#9326)
* Basic structure for TurboVectorStorage

* use UIO BitvecFlags
2026-06-08 11:46:41 +02:00
Jojii 2d2a20d8e4 is_on_disk fix for Quantized Chunked Mmap Storage (#9328)
* is_on_disk fix for quantized_chunked_mmap_storage

* Don't needlessly pin the storage type
2026-06-05 13:38:31 +02:00
Jojii 0fa7be669c Revert "[TQDT] Asymmetric query support in scorer (#9177)" (#9293)
This reverts commit 98270150c8.
2026-06-03 16:39:25 +02:00
Jojii b96daf67cc Attempt to fix flaky test_hw_metrics_cancellation test (#9233)
* Fix flaky test_hw_metrics_cancellation test

* Speedup test duration
2026-06-01 13:48:24 +02:00
Jojii 7a8703f166 [TQDT] API (#9172)
* [ai] TQDT in the API

* [ai] unify new sparse error for TQDT

* Rename to `turbo4`

* Add `Turbo4` to comments and doc strings.

* Also validate named sparse vector creation
2026-05-29 15:26:39 +02:00
Jojii ac6b04a69e [TQDT] Static Rotations (#9106)
* static rotations

* Review remarks
2026-05-29 03:19:44 +02:00
Jojii e7d63ed8a4 Refactor TurboQuantizer (#9095)
* Refactor TurboQuant into common/

# Conflicts:
#	lib/common/turboquant/src/math.rs
#	lib/quantization/src/encoded_vectors_tq.rs
#	lib/quantization/tests/integration/test_tq.rs

* [ai] fix docs

* [ai] tighten function visibilities

* Review remark

* include turboquant in amalgamate

* Rebase

* Move common/turboqunat back (but keep the refactor)

* Move vector_stats.rs back
2026-05-28 00:32:08 +02:00
Jojii 76834eccdd fix: Make HNSW discover test deterministic (#9203) 2026-05-27 19:12:42 +02:00
Jojii 9f76cb20ab Determinism for TQ Bits2 HNSW tests (#9036) 2026-05-14 11:07:51 +02:00
Jojii 2861c6118c Fix flaky oversampling assertion in HNSW quantization tests (#9029) 2026-05-13 12:55:03 +02:00
Jojii d3ad1ac988 API Adjustments for TQ (#8914)
* API Adjustments for TQ

* Clippy
2026-05-05 22:57:11 +02:00
Jojii 8765e33515 TQ Hadamard SIMD (#8883)
* [ai+manual] hadamard SIMD

* [ai] Neon

* Minor refactor

* fix import
2026-05-04 21:31:27 +02:00
Jojii 5aeae58efd [ai] Test gpu falls back to half-precision float for Turboquant (#8844) 2026-04-30 12:00:10 +02:00
Jojii e108a11ae3 [ai] OpenApi tests for TurboQuant (#8845) 2026-04-30 11:01:05 +02:00
Jojii 6c7442d210 [ai + manual] Add renorm (#8837) 2026-04-29 16:16:23 +02:00
Jojii 3e7432e62c [ai] Implement lazy evaluation of TqVectorExtras (#8823) 2026-04-29 14:13:42 +02:00
Jojii 9bd24411c3 TurboQuant E2E segment-level HNSW tests (#8799)
* [ai + manual] HNSW Quantization tests for TQ + better error calculation

* Compare TQ 1/1.5 bits to binary quantization
2026-04-28 11:16:08 +02:00
Jojii f821735b8e [ai] e2e tests in quantization/tests (#8788) 2026-04-27 09:20:22 +02:00
JojiiandIvan Pleshkov 4f35b72f0a TQ Scoring (#8753)
* [AI + Manual] Cosine scoring

* [ai + manual] Add support for dot product

* [ai] re-implement tests including covering both distances (dot+cosine)

* Clarify Cosine/Dot equivalence behavior for pre-TQ quantization storages

* review remarks

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2026-04-23 12:01:53 +02:00
Jojii e1a4af771d TurboQuant basic Quantization + Encoding (#8692)
* [AI + Manual] TurboQuant quantization

* Code spell

* [Ai + Manual] Integrate TurboQuantizer

* [Ai + Manual] Review tests

* Add Todos for unimplemented parts

* Fix bench

* [manual + ai] Add TqVectorExtras for additional metadata in quantized vectors

* Direct get_centroids implementation
2026-04-21 10:13:58 +02:00
Jojii f51c334554 Fix grpc stop words (#8728)
* Fix stopwords always being lowered in grpc path only

* [ai] add integration test, stopwords grpc vs rest
2026-04-20 11:27:32 +02:00
Jojii 1346cc56d9 TurboQuant Lloyd Max Codebook (#8672)
* [AI] Add lloyd_max calculation test and constants

* [AI] use closed-form formula

* Review remarks
2026-04-16 12:17:35 +02:00
8c72d3b12f API Changes for TurboQuant (#8686)
* [ai + manual] API changes for TQ

* CI

* Add TurboQuant types to Python type stubs

Made-with: Cursor

* Revert "Add TurboQuant types to Python type stubs"

This reverts commit 6543af3244.

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2026-04-16 12:12:33 +02:00
Jojii 8bd160071c TurboQuant hadamard Rotation (#8657)
* [ai + manual] Implement Hadamard rotation

# Conflicts:
#	lib/quantization/src/turboquant/mod.rs

* [ai + manual] Defer normalization and reduce iterations

* Test improvements + Clippy

* [AI] Don't use fixed-size chunks

* [AI + Manual] Extract permutations and add more tests

* Add normalization + Remove signs2

* Remove signs2 too and improve chunk size function

* [ai] Improve code

* [ai] use reversible LCG for O(1) memory shuffle

* Bench fixes + Remove constant in seed

* [ai] Review Remarks

* [ai] Review remarks

* [ai + manual] In-Place rotations
2026-04-16 11:46:43 +02:00
Jojii 6fc6bcc5b3 Don't insert deferred points into sparse index (#8435)
* Don't insert deferred points into sparse index

# Conflicts:
#	lib/segment/src/segment/tests.rs
#	lib/segment/src/segment_constructor/segment_constructor_base.rs

# Conflicts:
#	lib/segment/src/segment_constructor/segment_constructor_base.rs

* Clippy

* Assert consistency of deferred_internal_id var

* Return before SparseVector conversion in case of deferred point

* Use debug_assert instead
2026-03-25 15:37:32 +01:00
Jojii 1a2406dacb Fix deferred point count across multiple shards (#8496)
* Fix deferred point count across multiple shards

* Count def-points correctly if first shard has no def-points
2026-03-24 13:50:02 +01:00
Jojii 6425323d3f Deferred point count in metrics (#8415) 2026-03-20 12:57:24 +01:00
Jojii c015b86515 Add deferred point count to UpdateQueueInfo (#8414)
* Add deferred point count to UpdateQueueInfo

* Hide if prevent_unoptimized is false

* Clippy

* Openapi

* Iterate over appendable segments only

* Only calculate deferred point count if prevent_unoptimized is true

* Rebase fixes

* Codespell
2026-03-19 15:27:23 +01:00
JojiiandAndrey Vasnetsov 356040312b Correct calculation of deferred point counts (#8366)
* Don't account for deferred points in some places

# Conflicts:
#	lib/collection/src/shards/local_shard/scroll.rs

* Add in QueryContext

* Cover more places

* Coderabbit review remarks

* Properly count amount of deleted deferred points (#8386)

* Properly count amount of deleted deferred points

* Prevent double-counting of the same point

* Remove hints to estimations

* Properly handle counts in ProxySegment

* Add tests and fix deleted point count issue

* Adjusts tests + fix issues

* Separte fields for deferred points in telemetry (SegmentInfo)

* Remove deferred_points_count()

* openapi

* Fix test by manually calculating visible points

* Adjust ProxySegment test to revertion of SegmentInfo

* Throw error if collection was not found in telemetry (e2e Test)

* Update lib/segment/src/segment/segment_ops.rs

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>

* Make new fields in API optional

* Don't take range if no deferred point exist

* Review remarks

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2026-03-19 11:33:09 +01:00
Jojii 59d5e069cf Use dedup() instead of unique() (#8376)
* Use dedup() instead of unique()

* Assert iterator to be ordered
2026-03-13 11:38:55 +01:00
Jojii e7e5f4cc4f Filter deferred points: facets (#8313)
* Filter deferred: facets

* Add test (facet)

* Review remark

* Review remarks

* Fix unique_values returning values even if occurring only in deferred
points

* Clippy

* Rename Filter=>Exclude
2026-03-11 17:31:53 +01:00
f91e2179d5 Disable deferred point filtering in resharding (#8310)
* Add ignore_deferred flag for internal scroll API

* Ignore deferred points in ProxyShard::update

* Use enum instead of bool as type in function parameters

* Use consistent parameter name

* fmt

* Apply suggestions from code review

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

* More explicit naming

* Add DeferredBehavior to `count()` and disable filtering in stream_records

* Don't filter `retrieve()` everywhere

* Use consistent filter behavior in read operations

* Add TODO for ignored parameter in remote_shard

* Rebase fixes

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2026-03-11 16:13:26 +01:00
Jojii 4c10365c2d Filter deferred points: retrieve (#8315)
* Filter deferred points: Retrieve

* Add tests
2026-03-11 11:35:50 +01:00
Jojii e38d3d6662 Filter deferred points sparse search (#8299)
* Implement filtering deferred: Sparse search

* Add tests for deferred sparse vectors

* Clippy

* Review remark
2026-03-11 10:09:13 +01:00
JojiiandIvan Pleshkov 6c2e5ada2c Filter deferred points in read operations Part 1 (Search, Scroll, Count) (#8283)
* Implement filtering: Search

* Add tests for search and read_filtered

* Implement filtering: read_ordered_filtered + Tests

* Codespell + Clippy

* Reduce code duplication in tests

* Use helper methods of Id tracker

* Implement filtering: Random Scroll

* fixes after rebase

* [Unittest] Only set deferred ID if deferred points exist

* [Unit test] Reduce combinations in segment creation test

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2026-03-11 09:18:57 +01:00
Jojiiandtimvisee 3b1496537a Use spawn_blocking for segment locking (#8069)
* Use spawn_blocking for segment locking

* Wrap blocking task in AbortOnDropHandle

* Use single blocking thread for fetching all segment size information

---------

Co-authored-by: timvisee <tim@visee.me>
2026-02-09 12:04:16 +01:00
Jojiiandgenerall cf4158094b Don't lock SegmentHolder for the entire duration of read operations (#8056)
* Don't lock SegmentHolder during read operations

* Add comment clarifying eager segment allocation

* review fixes

* Remove TODO

* Shorter locking of segment holder in calculate_local_shard_stats

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-02-06 11:32:09 +01:00
Jojii a24377d615 Fix test consistency in random memory id tracker (#8043) 2026-02-03 15:37:43 +01:00
Jojii 1e3f67cf47 Metrics incoming and outgoing shard transfers (#7701)
* Metrics incoming and outgoing shard transfers

* clippy

* Revert counting separately
2025-12-09 10:04:56 +01:00
Jojii 55e5702e9d Metrics cluster working state and last update (#7670)
* cluster working state and last update in metrics

* Rename metric

* Remove error string

* Use timestamp instead

* Fix prometheus help text

* Change metric type to counter
2025-12-05 15:47:37 +01:00
Jojii b4569d3555 Avoid panics on empty metric families (#7479) 2025-12-02 15:03:19 +01:00
Jojii 8da4c22cae Make indexed-only-excluded-points metric default to 0 (#7649)
* Make indexed_only_excluded in metrics default to 0

* Fix tests
2025-12-02 09:36:41 +01:00
Jojiiandtimvisee f6b715bd62 Metrics for snapshots (#7497)
* Add atomic counter for running snapshots

* Refactor collection telemetry + export prometheus metric

* Handle collection in ToC + current recovery measurements

* Fix openapi tests

* Fix tests

* Add snapshot metrics for streaming and partial snapshots.

* Fix typo in metrics name

* Adjust metrics names

---------

Co-authored-by: timvisee <tim@visee.me>
2025-11-11 15:00:11 +01:00
Jojii d21acf0e30 Fix panic on empty collections (#7478) 2025-10-30 14:48:18 +01:00
Jojii 5c0863ae8e Add global metrics prefix (#7438)
* Qdrant prefix for metrics

* Update metrics tests

* Update openapi docs

* Make prefix configurable

* don't enable metrics prefix by default

* Adjust tests and openapi specs

* Custom validation for metrics_prefix setting
2025-10-30 11:37:20 +01:00
Jojiiandtimvisee 9a69e02b1e Procfs metrics (#7451)
* Procfs metrics

* Clippy

* Fix compiling on non linux targets

* Move procfs up

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-29 17:27:25 +01:00
Jojii 48d61f1719 Metrics vectors by name per collection (#7441)
* Add vector count per vector-name to metrics API

* Add to metrics API

* Improve TinyMap::get_or_insert_default and add tests

* Minor improvements

* Update openapi

* Review remarks

* Remove `collection_vectors` since it can be calculated manually
2025-10-29 17:00:53 +01:00
JojiiandTim Visée c1e5b17dde Dead shards in /metrics (#7310)
* Dead shards in /metrics

* Update src/common/metrics.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-10-29 16:48:06 +01:00
Jojiiandtimvisee c890d3aaa9 Add unindexed vectors to telemetry and metrics API (#7307)
* New metric for excluded vectors in indexed_only requests

* Make metric name align with prometheus naming convention

* Fix nit

* Fix tests

* Fix openapi

* Rename index_only into indexed_only

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-29 16:44:02 +01:00
Jojii eff9107747 Add num points/vectors to metrics API (#7302) 2025-10-29 16:40:23 +01:00
Jojiiandtimvisee 36bbc3ab69 Add replica metrics (#7301)
* Add replica metrics

* Clippy

* Properly ignore shards with resharding status

* Include 0 as value in metrics

* Remove total_active_replicas and total_expected_replicas

* Improve minimum active replica count in case of resharding

* Reorder metrics calls min < max (to trigger CI)

* Fix metrics help

* Fix typo

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-29 15:59:49 +01:00
Jojii b3c6f40118 Add avx512vl and avx512vpopcntdq in telemetry (#7471) 2025-10-29 14:00:24 +01:00
Jojii f2c012732e Currently running optimizers in Metrics (#7316)
* Currently running optimizer count in metrics

* Clearly state the prerequisites of count_optimizers_running()

* Minor improvements

* improve metric naming
2025-10-23 10:45:59 +02:00
Jojiiandtimvisee 1e1d683391 Bump segment version on {delete,update,upsert}-by-filter requests (#7157)
* Bump segment versions on *-by-filter operations to acknowledge WAL

* Assert exactly one segment with the new operation version

* Review remarks

* Separate segment version number to not affect partial snapshots

* Adjust unit test

* Remove old bump_segment_version implementations

* Clarify max_persisted_segment_version_overwrite in flush_all

* Move trait implementations - Clippy

* Apply segment bumping to all *-by-filter functions

* Remove AtomicOptionU64

* Update function name and comments

* Remove max condition, start with overwrite value

* Add assertion, can never have zero segments

* Make max_persisted_segment_version_overwrite monotonic with fetch_max

---------

Co-authored-by: timvisee <tim@visee.me>
2025-09-05 14:29:14 +02:00
Jojiiandtimvisee 4012ea9e51 Mirgate from old shard key format on load (#7110)
* Migrate shard-key format

* Reduce visibility of was_old_format attribute

* Add debug message when we migrate persisted shard key format

---------

Co-authored-by: timvisee <tim@visee.me>
2025-08-22 10:47:28 +02:00
Jojii 290f9e2675 Always load InferenceService (#7050)
* Always load InferenceService

* Add BM25 openapi test

* Add warning to development.yaml config (#7051)
2025-08-13 16:59:42 +02:00
Jojii 152bc5ef10 Improve h-sum in dot_avx calculation (#7002)
* Reduce amount of h-sum calculations in dot_avx

* Improve HSUM calculation and apply 4way-hsum to other places
2025-08-13 12:21:27 +02:00
c2a9183f5f BM25 in the Core (#6891)
* Uncouple tokenizer and TextIndexParams

* Refactor token processing in `TokenizerConfig` (#6912)

* Refactor token processing in TokenizerConfig

* fix max length checking

* [Bm25] Execution implementation (#6939)

* Add Bm25

* Execute BM25 if config available

* cargo format

* Add mocked tests for inference and bm25

* Properly apply InferenceType

* Fix tests

* Review remarks

* Review remarks

* Add overwritten model name fix again

* use enum instead of multiple constants

* ensure handling all fields of InferenceInput in infer_local

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>

* review fixes

* fmt

* spell-check

* deduplicate code

---------

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-08-03 20:43:20 -06:00
Jojii 4b6806bdc6 Fix config path & Webui Assets in Debian package (#6958)
* Fix debian config location & WebUI assets

* remove config overwrite env variable again
2025-07-31 10:02:17 +02:00
Jojii 073d75eabf Minor inference code improvements (#6890) 2025-07-18 08:46:14 +02:00
Jojii 16688a6a1b Replace Box with Either (#6887) 2025-07-17 11:04:43 +02:00
JojiiandLuis Cossío d9a83cda4d [MMR] Optimize SymmetricMatrix (#6813)
* Add DiagonalMatrix for mmr

* Add column OOB checking in debug mode

* Fix Clippy; Reduce allocations in scorers loop

* rename to symmetric matrix

* extra test

* Don't call 'resize' in each iteration

* Clippy

* review nits

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-07-11 17:44:24 -04:00
58c70d2846 Store index type in payload index config (#6812)
* Store payload index type in config

* Fix CI

* Use new function

* Review remarks

* Fix Ci

* Update lib/segment/src/index/struct_payload_index.rs

* Add is_appendable function to storage type

* Fix storage: store index type in payload index config (#6852)

* Restructure payload index config for backwards compatibility

See: <https://github.com/qdrant/qdrant/pull/6812#issuecomment-3057928785>

* Use mapping of combined schema and type, use storage type for serde

* Replace common functions with defer

* Minor adjustments

* Don't deserialize skip_rocksdb field in payload config if not set

* Rename all payload index types to snake_case format when serializing

* Fix clippy warnings when building without RocksDB

* Change type of FullPayloadIndexType from enum to struct

* Remove both from mutability, assume mutable there

* Also rename the payload index type to snake case

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2025-07-11 16:12:25 +02:00
Jojii 2a29432983 Fix duplicates in hardware counter metrics (#6803)
* Fix duplicates in hardware counter metrics

* Minor cleanup
2025-07-03 17:04:13 +02:00
Jojiiandgenerall b00a9081ba Implement stemming (#6770)
* Implement stemming

* minor fix

* Add openapi specs

* Fix import

* Fix Test, rename API type

* update openapi

* fix rest models

* Review remarks

* Minor code cleanup

* make grpc naming aligned with Rest + use master branch for dependencies

* grpc docs

* use tagged version

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-02 15:29:27 +02:00
JojiiandAndrey Vasnetsov bfc5706450 Implement new multilingual tokenizer (#6762)
* Implement new multilingual tokenizer

* Remove unnecessary clones

* Codespell

* filter stopwords before stemmer

* Fix Chinese stopwords (#6765)

* Fix Chinese stopwords

* remove todo

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-06-26 15:49:32 +02:00
Jojii 2e0cfeb1fa Add Japanese stopwords (#6683)
* Add Japanese stopwords

* Adjust list to be more close to source & update openapi
2025-06-25 15:06:46 +02:00
4959debadf Add new multilingual tokenizer (#6678)
* Add new tokenizer for multilingual

* Make codespell happy

* improve handling of when to apply stemming

* Fix stemming implementation

* Fix Japanese language detection. Add tests for MultilingualV2

* Update lib/segment/src/index/field_index/full_text_index/tokenizers/japanese.rs

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* Update lib/segment/src/index/field_index/full_text_index/tokenizers/japanese.rs

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* Update lib/segment/src/index/field_index/full_text_index/tokenizers/multilingual.rs

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* Make init() private

* move model into segment, filter non-alphanumeric tokens

* fmt

* exclude punctuation from tokenizer result

* fm

---------

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2025-06-25 11:39:46 +02:00
Jojii 8eb1e6198d Fix broken CI on Dev (RocksDB test) (#6680)
* Attempt to fix CI

* Remove unused imports
2025-06-12 13:13:53 -04:00
Jojii 64364f37b3 Fix enormous memory usage in Distance Matrix API on high sample size (#6640)
* Fix memory leak in distance API

* Add tests
2025-06-05 17:46:26 +02:00
Jojii ebdd6b9dc2 Remove option from immutable_inverted_index (#6636) 2025-06-04 11:52:43 -04:00
37a586726e Make gridstore Advise::Random and add function for sequential read (#6510)
* Make gridstore Advise::Random and add function for sequential read

* Reduce duplicate code in gridstore

* use sequential implementation in iterator

* actually use the sequential read

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-05-14 15:09:37 +02:00
Jojii fa9d0ec406 HardwareCounterCell::disposable() Performance Improvement (#6511)
* Improve performance of HardwareCounterCell::disposable() by 72x

* Fix ci
2025-05-09 11:11:22 +02:00
Jojii 4275d336dc Fix some wrong vector-read IO measurements (#6365)
* Fix some wrong vector_storage io measurements

* Review remarks
2025-04-14 10:17:48 +02:00
Jojii 90d89ca203 Fix measuring in memory inverted index (#6316)
* Fix measuring in memory inverted index

* Reduce overhead of get_token_id

* Remove not used function
2025-04-03 21:43:58 +02:00
Jojii bd9a657f07 Don't measure in memory geo, map and numeric indices (#6311) 2025-04-03 20:57:03 +02:00
JojiiandTim Visée 2ef9612432 Writeback counter cell (#6190)
* Add WritebackCounterCell

* Replace custom counting with WritebackCounterCell

* Update lib/common/common/src/counter/counter_cell.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-04-03 20:09:29 +02:00
Jojii bf706c21bc Don't measure in-memory hw for full text indices (#6309)
* Don't measure in-memory full text index

* Clippy

* Fix mmap_postings conditioned counting
2025-04-03 19:43:32 +02:00
Jojii 821aa0a33d Only measure HW if on disk for bool index (#6296)
* Only measure HW if on disk for bool index

* Remove missed measurement
2025-04-03 19:04:33 +02:00
Jojii fe42d41c16 Add ConditionedCounter (#6295) 2025-04-03 10:13:28 +02:00
Jojii abbb56f651 Measure Payload IO reads on index creation (#6252) 2025-03-25 17:38:36 +01:00
Jojiiandgenerall ae64690c7a 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-24 19:39:17 +01:00
3248140815 Payload Index Io measurements with Iterator (#6132)
* IteratorExt helper functions for Hw Measurements + Some impls

* More index impls; Performance improvements; Use new iterator

* Add missing measurement in hnsw search. Use disposable flag in HwCounterCell too

* use precomputed counts more

* Review nits

* Fix measurement of map_index iter_values_map

* Review remarks

* fix OnFinalCount

* remove comment

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-03-19 10:37:32 +01:00
Jojiiandgenerall 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
Jojii eeca054e22 Payload fulltext index IO read measurements (#5954)
* FullTextIndex filter measurements

* Clippy

* Add test for `new_accumulator`
2025-03-13 09:32:24 +01:00
Jojii faeba71849 IO read measurements for most Payload indices (#5951)
* Add payload index filtering IO measurements for some indices

* Add payload index metric to api and telemetry

* Also account for index access overhead

* Review remarks

* Anonymize new HardwareUsage field

* Fix tests
2025-03-12 14:31:48 +01:00
Jojii c9a6a96bcb 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-12 09:59:43 +01:00
Jojii bf47c97257 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-10 15:27:06 +01:00
JojiiandTim Visée 1fded093b7 Measure hardware IO for update operations (#5922)
* Measure update operations hardware IO

* Add support for distributed setups

* also measure update_local

* Add consensus tests for HW metrics of update operations

* add test for upserting without waiting

* Disable HW usage reporting when not waiting for update API

* Review remarks

* Fix resharding collecting hw measurements

* Fix metric type

* New struct HardwareData for better accumulation

* Ensure we always apply CPU multiplier

* Apply suggestions from code review

* Update src/actix/api/update_api.rs

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

* Fix assert_with_upper_bound_error threshold calculation.

* Clarifying why we don't measure shard cleanup

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-06 15:03:23 +01:00
Jojii bae4c08a2a Measure IO reads for vectors (#5912) 2025-02-03 11:56:43 +01:00
Jojii 5a321d6f09 HwCounter rename IO metrics (#5898)
* Rename io metrics and add vector_io_write

* Chore: Cleanup obsolete TODOs and simplify retrieving HardwareCounterCells (#5899)
2025-01-30 10:23:35 +01:00
Jojii a57af177ea Propagate hardware counter for more functions (#5844)
* Propagate hardware counter for more functions

* Minor improvements

* use vector_query_contexts hardware_counter
2025-01-24 16:33:44 +01:00
Jojii 1e7b149fe7 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 12:23:47 +01:00
Jojii d1c9b16398 Io measurement rename functions (#5816)
* replace _measured functions with original name

* Rename more functions
2025-01-23 10:58:25 +01:00
Jojii 1e52e03767 Fix set_by_key not persisted between reload (#5819) 2025-01-17 12:12:30 +01:00