Commit Graph
100 Commits
Author SHA1 Message Date
f42774b0d1 Remove UpdateSignal::Stop (#8050)
* remove UpdateSignal Stop

refactor wal truncation

restart workers even if wal truncation fails

* dont duplicate notification code in update worker

* send manually cancellation token to update worker

* revert stop_update_workers and keep as is

* refactor wal truncation

* are you happy clippy

* Inline breaks into single block

* Remove closure and call directly

* dont recreate channels in config update

* more comments

* debug assert

* fmt

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2026-02-10 00:02:22 +01:00
Ivan Pleshkov 78207079dd Update queue status in metrics and telemetry (#8060)
* update queue status in metrics and telemetry

* fix python tests

* update openapi
2026-02-10 00:01:27 +01:00
7758792ced Drop wal from api (#8000)
* Drop WAL from API

Flatten if statement

another approach

review remarks

switch flag back guard

unit test

* review remarks

* review remarks

* test missing records which are not truncated and not applied

* Drop wal from api: don't use applied seq number (#8030)

* Don't rely on applied seq num

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove unused

* Repurpose existing plunger, unset first_skipped in operation branch

* more complicated tests with empty wal

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>

* review remarks

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-09 23:56:09 +01:00
Ivan Pleshkov 7a529128c2 reduce update signal size by optimizing hw (#8003) 2026-02-09 23:38:37 +01:00
Ivan Pleshkov 0f385b1fd7 Update queue dont keep ops in ram (#7951)
* update queue dont keep ops in ram showcase

* always load operation from WAL

* revert operations buffering

cound only pending in update worker operations

fix typo

use channel size instead of wal index

* remove result expect

* decrease buffering const

* review remarks

* are you happy codespell
2026-02-09 23:36:37 +01:00
Ivan Pleshkov 717737c8c2 remove obsolete collection update lock (#7979) 2026-02-09 23:26:20 +01:00
Ivan Pleshkov 411011477d Remove ChunkedVectorStorage trait (#7977)
* Remove ChunkedVectorStorage trait

* fix rocksdb feature

* fix multidense rocksdb
2026-02-09 23:26:00 +01:00
Ivan Pleshkov 8dc1544916 Use p square to find ranges (#7733)
* use p square to find ranges

* use sample size

* add stopper checks

* review remarks

* review remarks
2026-02-09 23:04:25 +01:00
Ivan Pleshkovandtimvisee a6909aefc1 id tracker persisted mappings offset (#7877)
* id tracker persisted mappings offset

* remove obsolete check

* review remarks

* review remarks

* When persisting mappings, truncate file that is larger than we expect

* If persisting mappings fails, truncate file to what we had before

This isn't necessary, but it is nice to clean up partial mappings.

* Fix typos

* Fix typos

* Just truncate the file, we don't have to seek anymore

* Rename length variable to mappings_expected_len

---------

Co-authored-by: timvisee <tim@visee.me>
2026-02-09 22:53:35 +01:00
Ivan Pleshkov 75c6b0981d use enum for SQ query and meta (#7669)
fix CI

review remarks

review remarks

review remarks

review remarks

simplify encoding of internal vector

fix ci

fix ci

review remarks

review remarks
2025-12-18 17:29:18 +01:00
Ivan Pleshkov e1c6ec71a9 Scalar quantization encoding parameter (#7602)
* scalar quantization encoding parameter

fix ci

remove method

review remarks

fix ci

* uint8 - int8
2025-12-03 10:23:25 +01:00
Ivan Pleshkov 83bb3a3598 refactor sq score_bytes (#7613) 2025-12-03 10:19:10 +01:00
Ivan Pleshkovandxzfc 9ec813e0da P-Square one pass quantile estimation method (#7520)
* p square one pass method

* are you happy fmt

* fix n=9 case

* marker struct

* refactor

* proper tests

* add bench

* better namings

* are you happy clippy

* are you happy clippy

* fix additional markers order

* use ArrayVec instead of SmallVec

* use orderer float to sort f64

* Update lib/quantization/src/p_square.rs

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

* Update lib/quantization/src/p_square.rs

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

* mispelling

* review remarks

* fix typo

* change float checks order

---------

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>
2025-11-25 11:15:51 +01:00
Ivan Pleshkov f8b607c2ab Enable appendable quantization by default (#7508)
* enable appendable quantization by default

* update openapi
2025-11-14 12:31:04 +01:00
Ivan Pleshkov 1b0758461d avx512 for binary quantization (#7052)
* avx512 for binary quantization

fix build

* change checks order
2025-11-14 12:30:14 +01:00
Ivan Pleshkov a3d3da735d Enable BQ in appendable segments (#7145)
* Create and load for an appendable quantization

remove feature flag

more todo

review remarks

review remarks

* fix after rebase

* Enable BQ in appendable segments

* remove const placeholder

* fix after rebase

* fix after rebase

* fix config mismatch optimizer

* fix sq infinity loop

* add comment
2025-09-29 11:26:37 +02:00
Ivan Pleshkovandtimvisee 470c115334 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-29 11:26:01 +02:00
Ivan PleshkovandTim Visée de21202aa7 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-09-29 11:25:31 +02:00
Ivan Pleshkov 64515043a9 Populate multivector quantization offsets (#7173) 2025-09-29 11:25:31 +02:00
Ivan Pleshkov 7426d57531 Dont use quantization in exact plain search (#7179) 2025-09-29 11:25:31 +02:00
Ivan Pleshkov 9436e5456f chunked mmap as a quantization storage (#7116) 2025-08-26 13:19:36 +02:00
Ivan Pleshkov f12b17545e Remove quantization load from trait (#7113)
* remove quantization load

* refactor load

* fix fmt error

* fix clippy
2025-08-26 13:18:36 +02:00
Ivan Pleshkov 9fca19f2dc Retrieve files list from quantization storage (#7095)
* Get files list from quantization

* fix ci
2025-08-26 13:17:46 +02:00
Ivan Pleshkov d379c476ed using quantization in plain segment (#7060) 2025-08-26 13:17:45 +02:00
Ivan Pleshkov 6bc3cc813c EncodedStorage upsert vector (#7048)
* EncodedStorage upsert vector
2025-08-26 13:16:40 +02:00
Ivan Pleshkov 18ba202a76 Remove quantization save functions (#7043)
* remove quantization save

* revert convert_binary_encoding fn

* review remarks

* review remark

* review remarks
2025-08-26 13:16:39 +02:00
Ivan Pleshkov ed3f48ff09 Bq encoding conversions as a separate function (#7070)
* bq encoding conversions as a separate function

* rename

* rename
2025-08-26 13:16:18 +02:00
Ivan Pleshkov 52918b1dd5 Use PointOffsetType in quantization (#7058)
* Use PointOffsetType in quantization

* review remarks

* review remarks
2025-08-26 13:15:37 +02:00
Ivan Pleshkov e4bb8d4d5f Quantization flusher (#7046)
* quantization flusher

* review remarks
2025-08-14 14:30:26 +02:00
Ivan Pleshkovandgenerall 9793df0216 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-14 14:29:51 +02:00
Ivan Pleshkov ca13aec5e6 wrap quantization chunked vectors (#7011) 2025-08-14 14:29:29 +02:00
Ivan Pleshkov cdf05b30c3 Wrap quantization Vec<u8> in a separate structure (#7013)
* separate struct for vec u8 quantization storage

* cgf testing for test storage
2025-08-14 14:29:25 +02:00
Ivan Pleshkovandxzfc f4ebdd9c9d 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-11 13:17:02 +02:00
Ivan Pleshkov fbb92803cc bq scalar query benches (#6831)
* bq scalar query benches

* review remarks
2025-07-17 13:59:04 +02:00
Ivan Pleshkovandgenerall 918a8e456b 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-17 13:56:04 +02:00
Ivan Pleshkov f536829cf2 simplify 2bit encoding method (#6824) 2025-07-17 13:50:36 +02:00
Ivan Pleshkov 0399f3e06f Merge pull request #6201
* bq encodings

* update docs

* fix after rebase

* fix gpu build

* fix build after rebase
2025-07-17 13:45:57 +02:00
Ivan Pleshkov bd273ab68f 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-17 13:45:51 +02:00
Ivan Pleshkov e53ff4bb33 Fix sq internal vector encoding (#6763)
* Fix SQ internal vector encoding

* add test

* clippy warning
2025-07-17 13:34:26 +02:00
Ivan Pleshkovandgenerall 17e4d46ee5 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-07-17 13:18:38 +02:00
Ivan Pleshkov 3a916c5d69 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-07-17 13:16:17 +02:00
Ivan Pleshkov 7c44207ac1 reduce gpu vector storage tests amount (#6621) 2025-07-17 11:35:56 +02:00
Ivan Pleshkov 32fbc2eae2 Don't reallocate gpu resources between payload blocks (#6462)
* dont reallocate gpu resources between payload blocks

* are you happy codespell

* fix review remarks

* fix gpu tests

* are you happy clippy
2025-05-22 22:57:48 +02:00
Ivan Pleshkov 23b40def25 Gpu singleton for tests (#6031)
* gpu singleton for tests

* remove device singleton

* fix basic test

* review remarks

* review remarks
2025-03-21 11:39:21 +01:00
Ivan Pleshkov b8d0ae6581 Gpu add memory barriers (#6021)
* gpu add memory barriers

* add comments
2025-03-21 11:39:17 +01:00
Ivan PleshkovandTim Visée 09111a9f28 Support gpu devices without half float (#5891)
* support gpu devices without half float

* disable f16 feature

* are you happy clippy

* Extend log warning if f16 is not supported

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-01-28 10:44:32 +01:00
Ivan Pleshkov 037e259ca4 Fix gpu for empty payload block #5821 (#5847)
* fix #5821

* allow empty gpu buffers and fix ci test with empty vector storage

* remove unnecessary check

* allow empty vector storage on higher level
2025-01-23 14:29:28 +01:00
Ivan Pleshkov 184e4b98ff filter broken gpu links (#5848)
are you happy fmt
2025-01-23 14:29:14 +01:00
Ivan Pleshkov 7ea41c794d unique workflow job names for gpu (#5758) 2025-01-08 14:33:07 +01:00
Ivan Pleshkov d841d7dbe6 Add GPU into github workflows (#5752)
* parent 88f68d95b5
author Ivan Pleshkov <pleshkov.ivan@gmail.com> 1736245999 +0100
committer Ivan Pleshkov <pleshkov.ivan@gmail.com> 1736331073 +0100

gpu test and release workflows

no unprivileged, add sdk

fix ci

include llvm

try to use external sdk

use another vk sdk script

remove ninja

native sdk installation

debug vulkan version

use non-dev packages

debug vkinfo

remove llvm dep

ubuntu process-results

ghcr

* remove running gpu test while pr
2025-01-08 14:12:02 +01:00
Ivan Pleshkov 157ef24cb2 Fix gpu sorting bug for low-end devices (#5756) 2025-01-08 14:11:59 +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
Ivan Pleshkov ac52fc5994 atomic save quantization metadata (#5627) 2025-01-08 14:01:02 +01:00
Ivan PleshkovandRoman Titov 8c9f6849cd Add GPU support into Dockerfile (#5584)
* gpu hnsw

add gpu indexing flag

add gpu vector storage time measurement

add chmod flag

build hnsw using gpu

scoring speedup

move gl_GlobalInvocationID to mains

glslc with o flag

fix tests

use gpu atomics instead of multiple runs

enable atomics

add timers

profile search

let shader work while points collection

use generations for visited flags

add gpu init timer

avoid entries download

remove gpu call timers for a while

rename to combined graph builder

move gpu graph builder

restore levels in link access

restore links_map

add gpu start condition

use graph builder links memory

remove mut's

list point ids before processing

download-upload links using methods only

cpu graph builder as separate struct

add cpu threads count

parallel cpu build

single threaded cpu preprocess

try to fix glove accuracy

unsafe Send and Sync for gpu builder

copy graph layers builder instead of moving

remove obsolete mut

fix build

move builders to arc

fix bfb deadlock

move uneccessary clear

run cpu and gpu in separate threads

many vectors storage buffers

debug gpu vector storage

fix vector storage upload bug

add cpu ful graph build

don't use non-ready links for point

try to resolve conflicts while upsert

add indexing unit test for measurements

add test

utilize cpu more efficient

dont clear bhaep

debug gpu runs

try to use vec4 instead of mat4

dump scores count

estimate gpu usage

print usage per run

start using working groups

build shaders for vulkan v1.3

start shaders subgroup

vk instance version 1.3

subgroup vector storage

fix test

nearest heap

nearest heap test

are you happy fmt

add assert to nearest heap test

are you happy fmt

gpu visited flags

start candidates heap

candidates heap push

debug nearest heap

remove subgroupExclusiveMin

fix build

are you happy clippy

remove links dependency from nearest heap

provide input count to nearest test

are you happy fmt

provide ef to shader

are you happy fmt

get subgroup size

move compiled shaders

are you happy fmt

fix workgroups count for vector storage compute test

return true subgroup size

do nearest heap on gpu with partial sorting

remove tmp shader

unite scores and indices

are you happy fmt

gpu nearest sorting

are you happy fmt

fix nearest heap test

links test with subgroups

gpu candidates start

fix candidates sorting

are you happy fmt

fix candidates test on m1 chip

move obsolete and test shaders

start new gpu search context

search context test

fix links uploading

debug hnsw searh on level test

fix gpu hnsw search on level test

move test initialization to separate function

gpu greedy search shader test

test heuristic shader

gpu greedy search test

gpu test heuristic

move greedy search into searcher

start insertion shader

find hnsw patch on gpu

fix gpu patches test

start gpu graph builder

equivalency test

fix layers check

add timers

are you happy fmt

quality test and fix multithreaded bug

debug tests

are you happy fmt

fix levels count and clear links

fix equivalency test

remove obsolete solution

trivial gpu indexing integration

gpu config and skip conflicts for large hnsw

glsl generic vector storage element type

gpu generic vector storage

enable vulkan features for f16 and u8

force_half_precision option

add force f16 test

fix u8 and f16 unit tests

apply generic shaders in hnsw construction

remove conflicts check; start cpu utilization

cpu prebuild

upload first point links to gpu

mark all points in cpu graph as ready

multithreaded cpu and gpu

fix equivalency test

remove cpu links copy

parallel patches clearing

fix multithreaded env

external layers source

more logs to debug cpu+gpu syncronization

clear gpu processed points count

remove some temp logs

fix cpu stop condition bug

new insert vector shader

greedy search returns only ids

download whole layer links

apply new links on gpu directly

update win shader script

parallel links loading

provide memory amount as setting and estimate groups count

start bq

gpu bq test

fix tests

shaders invocations refactor

revert max groups settings

gix build after rebase

fix bug after rebase

upload links to gpu in cpu thread

fix greedy search iteration

atomic checker for conflicts

dump graph changes for debugging

move iterator to separate file

start combined builder refactor

start cpu builder as separate struct

separate gpu and cpu construction

fix tests

fix atomics count bug

upload links to gpu as separate fn

glue cpu and gpu

gpu thread

link points on cpu while gpu is busy

fix gpu bq scoring test

use xor instead of calc it

reallocate with less groups if not enough gpu memory

update compiled shaders

don't use llvm gpu emulator

debug panic if no gpu

remove tmp debug dumping

dockerfile for gpu

customize candidates count

fix gpu storage size

runtime shader compilation

dim as define

nearest heap params as macro

candidates and links capacities as macro

parallel bitonic sort

use bubble sort too

nearest heap as shared

limited shared candidates heap

combine buble and bitonic sorts

one-argumented similarity

cache vector for scoring

dont check candidates overflow

do greedy before search

visited hashtable

Revert "visited hashtable"

This reverts commit 7540d04d3859d02f17908c874927d18076f3eb8e.

use less flushes

bulk sum calculation

Revert "bulk sum calculation"

This reverts commit 6ef78ceb8d6ba7d9bf2077804548df162052c749.

load vector in one read

Revert "load vector in one read"

This reverts commit ea980d0399b90f44638590d40fdbfb1d6ffa9504.

fix build after rebase

fix build after rebase

sq support

simplify bq uploading using constructed quantization

metrics

alignment depends on subgroup size

are you happy fmt

exact flag

use lazy static for device access

remove prints

test reallocation factor

visited flags capacity as a compile time constant

build gpu hnsw for payload blocks

add dynamically sized subgroup size support

fix build

update rust version for nvidia docker

dynamically sized subgroups

start device filter

test device filter

are you happy clippy

devices manager

provide device instead of flag, better locking

partial cpu permit release

free cpus when gpu enabled

use cpu is waiting is disabled

create device only when gpu is enabled

cpu permit release all cases

parallel indices count

provide queue index

small refactor of shader builder

are you happy fmt

quantization params as separate struct

pq refactor

fmt

remove upload_mapped_ptr from gpu buffer

refactor gpu buffer

check buffer range

buffer refactor

refactor pipeline

move shader compiler to instance

refactor context

more refactor

no unwraps in gpu crate

clippy

apply pr changes

are you happy fmt

dont use shaderc in segment

more gpu tests

pq bq tests

provide bq option

fix bq for small dim

bind pq buffers

pq more complex test

cover all storage types by tests

test multi and vectors as iterator

multivectors upload data

multivectors shader

fix multivector tests

refactor shader builder

move storage tests into separate file

move quantization to separate file

refactor gpu vector storage creation

refactor gpu quantization api

dont convert to float when unnecessary

more comments

small upload vectors refactor

fix build after rebase

fix tests after rebase

different vk queue priorities capacity

vectors upload stopper

amd dockerfile

fix build after rebase

parent ec4d42e7f6
author Ivan Pleshkov <pleshkov.ivan@gmail.com> 1692111338 +0200
committer Ivan Pleshkov <pleshkov.ivan@gmail.com> 1732698560 +0100

gpu hnsw

add gpu indexing flag

add gpu vector storage time measurement

add chmod flag

build hnsw using gpu

scoring speedup

move gl_GlobalInvocationID to mains

glslc with o flag

fix tests

use gpu atomics instead of multiple runs

enable atomics

add timers

profile search

let shader work while points collection

use generations for visited flags

add gpu init timer

avoid entries download

remove gpu call timers for a while

rename to combined graph builder

move gpu graph builder

restore levels in link access

restore links_map

add gpu start condition

use graph builder links memory

remove mut's

list point ids before processing

download-upload links using methods only

cpu graph builder as separate struct

add cpu threads count

parallel cpu build

single threaded cpu preprocess

try to fix glove accuracy

unsafe Send and Sync for gpu builder

copy graph layers builder instead of moving

remove obsolete mut

fix build

move builders to arc

fix bfb deadlock

move uneccessary clear

run cpu and gpu in separate threads

many vectors storage buffers

debug gpu vector storage

fix vector storage upload bug

add cpu ful graph build

don't use non-ready links for point

try to resolve conflicts while upsert

add indexing unit test for measurements

add test

utilize cpu more efficient

dont clear bhaep

debug gpu runs

try to use vec4 instead of mat4

dump scores count

estimate gpu usage

print usage per run

start using working groups

build shaders for vulkan v1.3

start shaders subgroup

vk instance version 1.3

subgroup vector storage

fix test

nearest heap

nearest heap test

are you happy fmt

add assert to nearest heap test

are you happy fmt

gpu visited flags

start candidates heap

candidates heap push

debug nearest heap

remove subgroupExclusiveMin

fix build

are you happy clippy

remove links dependency from nearest heap

provide input count to nearest test

are you happy fmt

provide ef to shader

are you happy fmt

get subgroup size

move compiled shaders

are you happy fmt

fix workgroups count for vector storage compute test

return true subgroup size

do nearest heap on gpu with partial sorting

remove tmp shader

unite scores and indices

are you happy fmt

gpu nearest sorting

are you happy fmt

fix nearest heap test

links test with subgroups

gpu candidates start

fix candidates sorting

are you happy fmt

fix candidates test on m1 chip

move obsolete and test shaders

start new gpu search context

search context test

fix links uploading

debug hnsw searh on level test

fix gpu hnsw search on level test

move test initialization to separate function

gpu greedy search shader test

test heuristic shader

gpu greedy search test

gpu test heuristic

move greedy search into searcher

start insertion shader

find hnsw patch on gpu

fix gpu patches test

start gpu graph builder

equivalency test

fix layers check

add timers

are you happy fmt

quality test and fix multithreaded bug

debug tests

are you happy fmt

fix levels count and clear links

fix equivalency test

remove obsolete solution

trivial gpu indexing integration

gpu config and skip conflicts for large hnsw

glsl generic vector storage element type

gpu generic vector storage

enable vulkan features for f16 and u8

force_half_precision option

add force f16 test

fix u8 and f16 unit tests

apply generic shaders in hnsw construction

remove conflicts check; start cpu utilization

cpu prebuild

upload first point links to gpu

mark all points in cpu graph as ready

multithreaded cpu and gpu

fix equivalency test

remove cpu links copy

parallel patches clearing

fix multithreaded env

external layers source

more logs to debug cpu+gpu syncronization

clear gpu processed points count

remove some temp logs

fix cpu stop condition bug

new insert vector shader

greedy search returns only ids

download whole layer links

apply new links on gpu directly

update win shader script

parallel links loading

provide memory amount as setting and estimate groups count

start bq

gpu bq test

fix tests

shaders invocations refactor

revert max groups settings

gix build after rebase

fix bug after rebase

upload links to gpu in cpu thread

fix greedy search iteration

atomic checker for conflicts

dump graph changes for debugging

move iterator to separate file

start combined builder refactor

start cpu builder as separate struct

separate gpu and cpu construction

fix tests

fix atomics count bug

upload links to gpu as separate fn

glue cpu and gpu

gpu thread

link points on cpu while gpu is busy

fix gpu bq scoring test

use xor instead of calc it

reallocate with less groups if not enough gpu memory

update compiled shaders

don't use llvm gpu emulator

debug panic if no gpu

remove tmp debug dumping

dockerfile for gpu

customize candidates count

fix gpu storage size

runtime shader compilation

dim as define

nearest heap params as macro

candidates and links capacities as macro

parallel bitonic sort

use bubble sort too

nearest heap as shared

limited shared candidates heap

combine buble and bitonic sorts

one-argumented similarity

cache vector for scoring

dont check candidates overflow

do greedy before search

visited hashtable

Revert "visited hashtable"

This reverts commit 7540d04d3859d02f17908c874927d18076f3eb8e.

use less flushes

bulk sum calculation

Revert "bulk sum calculation"

This reverts commit 6ef78ceb8d6ba7d9bf2077804548df162052c749.

load vector in one read

Revert "load vector in one read"

This reverts commit ea980d0399b90f44638590d40fdbfb1d6ffa9504.

fix build after rebase

fix build after rebase

sq support

simplify bq uploading using constructed quantization

metrics

alignment depends on subgroup size

are you happy fmt

exact flag

use lazy static for device access

remove prints

test reallocation factor

visited flags capacity as a compile time constant

build gpu hnsw for payload blocks

add dynamically sized subgroup size support

fix build

update rust version for nvidia docker

dynamically sized subgroups

start device filter

test device filter

are you happy clippy

devices manager

provide device instead of flag, better locking

partial cpu permit release

free cpus when gpu enabled

use cpu is waiting is disabled

create device only when gpu is enabled

cpu permit release all cases

parallel indices count

provide queue index

small refactor of shader builder

are you happy fmt

quantization params as separate struct

pq refactor

fmt

remove upload_mapped_ptr from gpu buffer

refactor gpu buffer

check buffer range

buffer refactor

refactor pipeline

move shader compiler to instance

refactor context

more refactor

no unwraps in gpu crate

clippy

apply pr changes

are you happy fmt

dont use shaderc in segment

more gpu tests

pq bq tests

provide bq option

fix bq for small dim

bind pq buffers

pq more complex test

cover all storage types by tests

test multi and vectors as iterator

multivectors upload data

multivectors shader

fix multivector tests

refactor shader builder

move storage tests into separate file

move quantization to separate file

refactor gpu vector storage creation

refactor gpu quantization api

dont convert to float when unnecessary

more comments

small upload vectors refactor

fix build after rebase

fix tests after rebase

different vk queue priorities capacity

experiment with heaps

reverse candidates heap

scan only half of candidates

avoid heap code duplication

call subgroup elect inside bheap

united nearest and candidates heaps

remove cands and nearest heaps shaders

fix tests

start linear implementation

remove nearest and candidates entities

visited flags with id remap

simplify cpu side

move hnsw search shader into tests

simplify

simplify gpu links

test visited flags remap

remove GpuSearchContextGroupAllocation

stopper and allow integrated flag

add timeout comment

refactor batched points

refactor links and device manager

are you happy clippy

fix build after rebase

fix build after rebase

remove temp files

create gpu vectors in segment constructor

clean up

clean up

refactor gpu feature

refactor gpu construction in hnsw.rs

provide gpu device

remove pub

simplify main graph

renames

telemetry and settings refactor

update cargo lock

remove env_logger from deps

update openapi

gpu hnsw unit test

rename test

log device name while indexing

* are you happy clippy

* are you happy clippy

* dockerfile with amd and nvidia gpu support

* add gpu arg to stages

* clear after rebase

* Apply suggestions from code review

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>

* review remarks

* fix CI

* cnahge arg to env

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2024-12-09 12:29:17 +01:00
Ivan PleshkovandAndrey Vasnetsov 4f99e728aa GPU HNSW integration (#5535)
* gpu hnsw

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2024-12-09 11:18:16 +01:00
Ivan Pleshkov 362a721d08 Gpu hnsw construction (#5529)
* gpu hnsw construction

* fix build

* are you happy clippy

* are you happy clippy

* review remarks

* more comments

* external gpu vector storage

* decompose gpu inserter

* are you happy codespell

* are you happy clippy
2024-12-09 11:08:03 +01:00
Ivan PleshkovandTim Visée 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
Ivan PleshkovandAndrey Vasnetsov 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
Ivan Pleshkov aa7e33b68b mmap geo index api (#5163)
* define mmap geo index

fix compilation

deleted flags

load new mmap

geo index tests

fix tests

fix build after rebase

add files list

* refactor get_stored_sub_regions output type

* review remanings

* mmap geo index api

* fix after rebase
2024-10-08 13:30:08 +02:00
a73d0bfcc7 Mmap geo index (#4841)
* define mmap geo index

fix compilation

deleted flags

load new mmap

geo index tests

fix tests

fix build after rebase

add files list

* are you happy fmt

* refactor get_stored_sub_regions output type

* repr(C) for geohash

* Replace manual flattening with flat map iterator

* review remanings

* remove panics

* add files for snapshot

* rename Dynamic into InMemory

* are you happy fmt

* review renames

* Use copied rather than cloned

* minor review refactoring + comments

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-10-08 13:28:28 +02:00
Ivan Pleshkov 21a3c108bb 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-23 16:03:29 +02:00
Ivan Pleshkov 1224ed6cbf remove unused WrongPayloadKey (#5086) 2024-09-17 15:29:52 +02:00
Ivan Pleshkovandxzfc 21701f9025 Packed geohash (#4964)
* packed geohash

* refactor

* are you happy codespell

* review remarks

* better iterator

* iterator with only one field

* encode db key as smolstr

* Update geohash_starts_with

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-09-17 15:28:23 +02:00
Ivan Pleshkov fe7dde428c mmap field indices add storage compat (#4856) 2024-08-27 01:12:46 +02:00
Ivan Pleshkov d1b48a0f98 fix mmap field index snapshot (#4847) 2024-08-09 18:19:28 +02:00
Ivan Pleshkov a9784f7f60 Mmap map index (#4779)
* define mmap map index

add point to values

add mmap hash map

are you happy fmt

use new mmap hashmap methods

build index

saturating_sub

are you happy clippy

fix tests build

* integrate facets for mmap index

* mmap tests

* fix ci

* review remarks

* review remarks
2024-08-09 18:17:08 +02:00
Ivan Pleshkov 78afe797b7 Mmap numeric index (#4721)
* mmap numeric index

dynamic numeric index

remove pub from fields

add mmap enum

remove vec<u8> as number

get_value without self

mmap save load

trait for conversion from P into T

save-load points-to-values

fix unit tests

are you happy clippy

fix ci

apply changes from #4743

NumericIndex: add new_mmap() method

remove mmapvalue trait from immutable

small refactor

implement from_referenced for str

are you happy clippy

deleted flags by idx instead of pairs

* fix build after rebase

* review remarks

* tests macos

* increase deleted count while deletion
2024-08-09 18:15:31 +02:00
Ivan PleshkovandAlbert Safin 05f9020e9a Mmap hashmap iterate over keys (#4764)
* mmap hashmap iterate over keys

* fix tests

* Use associated consts rather than static methods

---------

Co-authored-by: Albert Safin <xzfcpw@gmail.com>
2024-08-09 18:15:24 +02:00
Ivan Pleshkov 6a6d75656b numeric index remove direct db usage (#4757) 2024-08-09 18:14:37 +02:00
Ivan Pleshkov 22a0724745 Dynamic numeric index without persistence (#4745)
* dynamic numeric index without persistence

* review remarks
2024-08-09 18:11:56 +02:00
Ivan Pleshkov 84f3df4f65 remove vec u8 from mutable numeric index (#4744) 2024-08-09 18:11:51 +02:00
Ivan Pleshkov 80aee3ccea Remove NumericIndexKey and use histogram point (#4743)
* Remove NumericIndexKey and use histogram point

* use old ordering

* fix ci
2024-08-09 18:11:47 +02:00
Ivan Pleshkov 1541bcb2af use filed index builder in numeric index tests (#4742) 2024-08-09 18:11:42 +02:00
Ivan Pleshkov 5df4231e2d ValueIndexer get_value without self (#4740) 2024-08-09 18:11:39 +02:00
Ivan Pleshkov 306bf59818 Mmap points to values map (#4641)
* definitions

* create file

* ranges

* get values

* are you happy clippy

* remove unnecessary function

* are you happy codespell

* review fixes

* are you happy clippy

* fmt

* add padding

* update map public functions as in the dev

* are you happy clippy

* review remarks

* generic structure

* review remarks

* review fixes
2024-08-09 18:10:14 +02:00
Ivan Pleshkov 9450c1957f fix build after merge numeric field index internal type (#4711) 2024-08-09 18:09:55 +02:00
Ivan Pleshkov 02a64f462f Histogram save load (#4537)
* histogram save load

* add separate save-load test

* are you happy clippy

* review remarks
2024-08-09 18:09:43 +02:00
Ivan Pleshkov 8a8d30a689 add more instructions set into cpu info telemetry (#4691) 2024-08-09 18:09:03 +02:00
Ivan Pleshkov a0f9cafb56 Remove dyn iterator from field condition checker (#4665)
* remove dyn iterator from field condition checker

* are you happy clippy

* review remarks
2024-08-09 18:07:28 +02:00
Ivan Pleshkovandtimvisee c7d25b2096 Field index values as iterator instead of slice (#4644)
* field index values as iterator instead of slice

* Use consistent assertions

* fix wrong values_count update

---------

Co-authored-by: timvisee <tim@visee.me>
2024-08-09 18:06:29 +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
Ivan Pleshkov d65dbb9af1 add query_points_batch to actix (#4576) 2024-06-28 16:45:53 +02:00
Ivan Pleshkov e47edc4bde Fix colberts TODOs (#4566)
* Fix colberts TODOs

* are you happy clippy
2024-06-28 16:44:54 +02:00
Ivan Pleshkov 60c72eaf7b Avg multivector (#4542)
* avg multivector

* integration test

* remove unwrap
2024-06-28 16:40:25 +02:00
Ivan Pleshkov 856fca34db fix building cancellation flaky test (#4477) 2024-06-21 23:39:43 +02:00
Ivan PleshkovandAndrey Vasnetsov d4418c186f Max size of multivector to fix chunk in storage (#4478)
* Max size of multivector to fix chunk in storage

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

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2024-06-21 23:38:51 +02:00
Ivan Pleshkov 89355176df fix docker arm f16 build (#4466) 2024-06-21 23:35:19 +02:00
Ivan Pleshkov 6c1527801d check f16 neon in runtime (#4464) 2024-06-21 23:34:52 +02:00
Ivan Pleshkov 2a4b3d0391 Hnsw update entry point after linking (#4442)
* hnsw update entry point after linking

* are you happy fmt
2024-06-11 13:18:03 +02:00
Ivan Pleshkov 850929fafe Test fix segment builder for sparse (#4397)
* test fix segment builder for sparse

* are you happy fmt
2024-06-11 13:15:36 +02:00
Ivan Pleshkovandgenerall 96ecd2cca8 Fix hnsw full scan threshold (#4369)
* fix hnsw full scan threshold

* add test

* are you happy clippy

* separate open_vector_storage

* remove public fields from builder

* wip: do not create segment in builder before build

* avoid arc in storage test and low-level loading functions

* WIP: remove internal segment from SegmentBuilder

* fmt

* finalize segment builder fixes

* Revert "are you happy clippy"

This reverts commit c04afa6989.

* Revert "add test"

This reverts commit 8e7ad6207e.

* Revert "fix hnsw full scan threshold"

This reverts commit 8904443fcb.

* remove _daatabse from builder

* fix optimizer test

* fix id tracker versions persistence

* do flush for segment components on build

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-06-11 13:15:11 +02:00
Ivan Pleshkovandgenerall eeae81d666 Mmap for quantized multivector offsets (#4354)
* mmap for quantized multivector offsets

* resolve save vector

* fmt

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-06-11 13:13:41 +02:00
Ivan Pleshkov 158a19555a fix pyroscope warning on non-linux platforms (#4353) 2024-06-11 13:13:30 +02:00
21a3fb5f38 Use correct vector storage size (#4312)
* use correct vector storage size

* remove dim from segment entry

* are you happy fmt

* codespell and proportions

* remove obsolete comment

* remove `try_vector_dim`

* are you happy fmt

* remove todo

* revert code of conduct

* check div 0

* Simplify a bit with max iterator

* Update lib/segment/src/index/hnsw_index/hnsw.rs

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

* are you happy fmt

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

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

* review fix

* set full scan threshold 0 for test

* use u128 also for multivector storages

* fix sparse vector size calculation

* Move size calculation into if-branch

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2024-06-11 13:12:37 +02:00
Ivan Pleshkov 25c410ec70 Multidense vectors quantization (#4202)
* quantized multivector definition

new multiquantization scorers

encode query

maxsim for quantized vectors

remove obsolete todo

reuse existing scorers

create multivector quantized storage

save load offsets

add test

fix vectors count

tempopery disable test while debugging

fix tests

fix build

less static lifetimes

less static lifetimes

fix build

* fix build after rebase

* add persistence test

* fix codespell

* increase accuracy in tests

* review remarks

* add comment references

* are you happy codespell

* don't use bincode
2024-05-28 13:44:46 +02:00
Ivan Pleshkov 903698833f quantization scorer with multivector support (#4289) 2024-05-26 12:49:47 +02:00
Ivan Pleshkov 62ec5fb5fa multivector storage iterate over all inner vectors (#4288) 2024-05-26 12:49:38 +02:00
Ivan Pleshkov 04fc91d8a2 add static lifetime to primirive type (#4286) 2024-05-26 12:49:29 +02:00
Ivan Pleshkov 8112126c64 Fix wrong multivectors count in storage (#4283)
* fix wrong multivectors count in storage

* add test
2024-05-26 12:48:59 +02:00
Ivan Pleshkov 057b37a5ab fix arm linking error on docker (#4244) 2024-05-26 12:32:36 +02:00