Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a cuvs-bench PostgreSQL backend for pgvector HNSW/IVFFlat, pg_cuvs CAGRA, and CAGRA-to-pgvector HNSW export. It uses the current plugin/config-loader API, standard dataset YAML and Cartesian parameter grids, with one result per search setting and corpus-offset IDs for the existing recall calculation.
Each build owns a fresh schema, loads its corpus, builds one index and reuses it across that build cell's search sweep. Cleanup drops only that schema. Custom YAML overrides matching algorithm groups; explicit
algo_groupsaugments the selected groups and unmatched requests fail before execution.Dependencies are optional. Driver installation errors give the postgres-extra guidance; connection failures return a diagnostic that excludes raw conninfo errors. CPU tests exclude GPU cases even when a GPU DSN is configured.
CAGRA sessions disable CPU fallback and check the actual daemon mode and query-count delta outside timed queries. Plan checks before and after each search point reject sequential scans. HNSW export searches on CPU. Build timing excludes COPY/ANALYZE and includes CAGRA construction plus conversion for export. CPU disk bytes and CAGRA daemon VRAM bytes are labeled separately in CSV metadata.
Reproduce
fern/pages/cuvs_bench/postgres.mdcovers optional client installation, a pinned public pg_cuvs server bootstrap/build, standard wiki_all_1M data, CLI runs, bounded parameter sweeps, role privileges and measurement boundaries.Live CPU tests use
CUVS_BENCH_POSTGRES_DSN; GPU cases separately requireCUVS_BENCH_POSTGRES_GPU_DSNand a real CUDA/cuVS server. CAGRA roles need SELECT onpg_stat_gpu_searchin addition to database CREATE. The optionalindex_diroverride requires permission to set the server's PGC_SUSET parameter.Validation
Current client source, macOS arm64/Python 3.12.14/PostgreSQL 17.11/pgvector 0.8.6:
/datadirectory unavailable in this environment.groups=base, an additionalpgvector_hnsw.testgroup and--search-threads 1produced 2 build rows and 3 validated search rows on small synthetic data.GPU validation on an earlier client revision used fresh Ubuntu 22.04.5, A100-SXM4-80GB/driver 580.126.09, PostgreSQL 16.15, pgvector 0.8.7, pg_cuvs 0.8.0 at public commit
8b73d65fb8a3d6f66cdfe69eec4969c1f2fc753c, CUDA 12.4/cuVS 26.04 and Python 3.12.15:gpu_cagraand 10,000 GPU dispatches each; export CPU serving did not increment its source CAGRA GPU counter.These runs validate execution and reproduction. No speedup is claimed, and this PR does not change GPU kernels. GPU execution of the current client revision has not been repeated.
Limits
Euclidean vectors and one serial SQL client only. The SQL boundary includes client adaptation, planning/execution and result transfer. Separate-process search-only/persistent index reuse, concurrent/throughput clients, other GPUs and upstream PR CI are unverified. Abrupt termination can leave an isolated schema.
Always provide valid ground truth: the shared result interface otherwise leaves recall at zero rather than unmeasured. Python API dry-run results must not be passed to the generic CSV exporter as measurements because skipped search rows retain zero values; the CLI skips dry-run export. These existing interface limitations remain documented.