Commit Graph

27 Commits

Author SHA1 Message Date
Tim Visée
e59d395d80 Use ahash for maps/sets holding point IDs, offsets or similar (#6388) 2025-04-21 00:10:22 +02:00
xzfc
1f805b618e Clear disk cache after read (#6396)
* Move clear_disk_cache to memory::fadvise

* Add memory::fadvise::OneshotFile

* Use OneshotFile
2025-04-21 00:08:52 +02:00
Luis Cossío
156c79ebdc [query api] don't propagate offset into prefetches (#6357)
* don't propagate offset into prefetches

* I want to see CI with that change

* Move import into platform specific scope

* edit test to make sure offset is not propagated

* fix planned query test

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: timvisee <tim@visee.me>
2025-04-20 23:59:01 +02:00
Andrey Vasnetsov
6e0ddbafa9 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-20 23:54:40 +02:00
Arnaud Gourlay
33e7aa0b98 Fixes for Clippy 1.86 (#6290) 2025-04-20 23:42:07 +02: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
xzfc
c482351738 gpu: zerocopy instead of transmute (#6039) 2025-03-21 11:38:16 +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
xzfc
eaaa31e34d Fix cargo doc warnings (#5854) 2025-01-23 14:29:19 +01:00
Luis Cossío
6b47b7e1b4 Avoid flushing a zero-sized mmapped file (#5842) 2025-01-23 14:28:47 +01:00
Luis Cossío
7cb7b18a06 Remove setting OpenOptions flags to false (#5840) 2025-01-23 14:28:37 +01:00
Ivan Pleshkov
33441df49d Vulkan api wrapper crate (#5297)
* vulkan api wrapper crate

* fmt

* gpu is not a workspace member

* are you happy codespell

* try to fix CI

* exclude gpu from workspace

* fix build for macos

* disable tests for gpu crate

* fix codespell

* provide gpu feature into gpu trait

* ash version up

* change collection for pipeline builder

* gpu test

* gpu is not optional

* check extensions and layers presense

* check device features

* remove feature

* make all fields private

* more comments

* shader compilation options

* are you happy clippy

* are you happy fmt

* Update lib/gpu/Cargo.toml

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

* qdrant team as authors

* merge more changes from magic branch

* are you happy clippy

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2024-11-18 11:24:45 +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
xzfc
1b4996dca0 Do not return error if madvise(PopulateRead) fails (#5123) 2024-09-23 17:09:10 +02:00
Andrey Vasnetsov
c388b8e8a3 mmap_to_type_unbounded -> mmap_prefix_to_type_unbounded (#5088) 2024-09-17 15:30:08 +02:00
Andrey Vasnetsov
b3b2279376 Allow explicit populate of mmap (#4923)
* expose mmap populate

* expose mmap populate in open_read_mmap

* FOR TEST, REVERSE IT: make InRamChunkedMmap default

* enable populate advise on unix

* fix clippy

* unix -> linux

* Update lib/collection/src/config.rs

* clippy fixes

* resolve conflicts

* fmt

* Runtime check for PopulateRead

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-09-17 15:29:32 +02:00
Andrey Vasnetsov
9821368fce initial structures for reading mmap text index (#5029)
* initial structures for reading mmap text index

* creation of text index mmap

* WIP create mmap inverted index

* use same file writing technique as in MmapHashmap

* Save points_to_tokens_count in two files

* clippy

* fill slice with iterator

* review fixes

* fix after review

* implement loading of MmapInvertedIndex

* WIP: prepare for converting ChunkReader into trait

* fmt

* WIP: prepare ChunkReader to be a trai

* WIP: replace ChunkReaderImpl with trait

* implement chunk reader for mmap view

* rollback ChunkReader trait and remove CompressedMmapPostingListView

* move ImmutableInvertedIndex and MutableInvertedIndex into separate files

* impl ops for MmapInvertedIndex

* make mmap hashmap value param generic (#5042)

* make mmap hashmap value param generic

* test + fixes

* Update lib/common/common/src/mmap_hashmap.rs

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

* Update lib/common/common/src/mmap_hashmap.rs

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

* fixups

---------

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

* test and fix immutable to mmap conversion

* fix case 4 and refactor MmapBitSlice::create

* more tests

* fmt

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-09-17 15:27:56 +02:00
Andrey Vasnetsov
7c5b8a0e16 Refactor chunked mmaps (#4888)
* remove dependency on segment in chunked mmap

* move chunked utils to memory subcrate
2024-08-27 00:57:55 +02:00
xzfc
59a372b131 InRamChunkedMmap: optimize using madvise (#4881)
* refactor: introduce AdviceSetting for open_read_mmap/open_write_mmap

* perf: use Advice::Normal in a few places

* perf: use MADV_DONTNEED after reading

* perf: use POSIX_FADV_DONTNEED after reading
2024-08-27 00:57:29 +02:00
Andrey Vasnetsov
3be87b11eb Mmap subcrate refactoring (#4886)
* make mmap_type independent from segment structures

* make bitvec and thiserror workspace dependencies

* move mmap_type into common/memory subcrate

* fmt
2024-08-27 00:57:20 +02:00
xzfc
07c278ad51 Enable some of the pedantic clippy lints (#4715)
* Use workspace lints

* Enable lint: manual_let_else

* Enable lint: enum_glob_use

* Enable lint: filter_map_next

* Enable lint: ref_as_ptr

* Enable lint: ref_option_ref

* Enable lint: manual_is_variant_and

* Enable lint: flat_map_option

* Enable lint: inefficient_to_string

* Enable lint: implicit_clone

* Enable lint: inconsistent_struct_constructor

* Enable lint: unnecessary_wraps

* Enable lint: needless_continue

* Enable lint: unused_self

* Enable lint: from_iter_instead_of_collect

* Enable lint: uninlined_format_args

* Enable lint: doc_link_with_quotes

* Enable lint: needless_raw_string_hashes

* Enable lint: used_underscore_binding

* Enable lint: ptr_as_ptr

* Enable lint: explicit_into_iter_loop

* Enable lint: cast_lossless
2024-08-09 18:10:10 +02:00
Ivan Pleshkov
260376207b Atomic create_and_ensure_length (#4583)
* atomic create_and_ensure_length

* fix tests; review remarks

* review remarks

* create false flag
2024-06-29 23:03:26 +02:00
xzfc
3b778fec2b Compressed posting lists (#4253) 2024-05-26 12:50:35 +02:00
Roman Titov
cdf6eaab69 Fix GraphLinksConverter::serialize_to data alignment issues (#3806)
* Assert data alignment in `transmute_from_u8*` functions

* WIP: Switch `transmute_from_u8*` alignment asserts from `debug_assert` to `assert`...

...to make sure *all* tests running on CI will enforce the alignment

* Add descriptive message to alignment assertions

* Fix alignment in graph links file (#3807)

* fix alignment in graph links file

* fix alignment while reading

* Revert "fix alignment while reading"

This reverts commit e2d1cee890.

* Revert "Revert "fix alignment while reading""

This reverts commit 7a4fdc9aea.

* small refactor

* Switch `transmute_from_u8*` alignment asserts back to `debug_assert`

Additionally:
- Remove extra `0x` from slice address in assert messages

* Trim offsets padding bytes from the end of `links_mmap` slice

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2024-03-15 18:43:31 +01:00
Luis Cossío
7d0e4e76ff Fix clippy 1.77 lints: explicitly set truncate flag on file creation (#3561)
* add `truncate(true)` where unspecified

* remove unused `WriteGuard` wrapper

* Don't truncate if we explicitly set the size later

---------

Co-authored-by: timvisee <tim@visee.me>
2024-03-05 17:03:56 +01:00
Arnaud Gourlay
c00e496e47 Sparse index persistence (#2718)
* Sparse index persistence

* code review

* remove pub visibility
2023-10-06 12:44:01 +02:00
Arnaud Gourlay
abd0d57d5d Introduce Memory common module (#2712)
* Introduce Memory common module

* fix Windaube build

* move mmap_ops as well
2023-10-06 12:39:37 +02:00