cuvs icon indicating copy to clipboard operation
cuvs copied to clipboard

Add cuvs-bench-elastic: HTTP backend for Elasticsearch GPU vector search

Open afourniernv opened this issue 8 months ago โ€ข 2 comments

Introduce cuvs-bench-elastic as an optional plugin for cuvs-bench that provides an Elasticsearch backend. The backend communicates with Elasticsearch via HTTP and supports HNSW indexing with optional GPU acceleration when using the Elasticsearch GPU image (cuVS-accelerated vector search).

  • Add cuvs_bench_elastic package with backend and config loader entry points
  • Extend cuvs_bench registry and search spaces for pluggable backends
  • Add elastic and integration optional dependencies to cuvs-bench
  • Add modularization tests and integration test scaffolding (disabled until CI has ES GPU image, cuVS libs, and GPU runner)

afourniernv avatar Mar 10 '26 22:03 afourniernv

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

copy-pr-bot[bot] avatar Mar 10 '26 22:03 copy-pr-bot[bot]

@afourniernv this is a really big PR so I'm reviewing in stages. Thank you for bearing with me. I finally had some time to look through the implementation for comprehensively. Mostly minor, but important things.

cjnolet avatar Apr 16 '26 18:04 cjnolet

Review Change Stack

๐Ÿ“ Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Elasticsearch GPU backend support enabling index creation and kNN search operations with HNSW algorithms.
    • Implemented plugin discovery system for dynamic backend registration and extensibility.
  • Tests

    • Added comprehensive test suite for backend modularization, optional dependencies, and plugin discovery mechanisms.

Walkthrough

Adds a complete Elasticsearch GPU HNSW backend to cuvs-bench with pluggable entry-point discovery, centralized recall computation, configuration loading, search-space parameters, and comprehensive tests. Also modernizes OpenSearch array initialization and extends the registry to support optional backend dependencies with installation hints.

Changes

Elasticsearch GPU Backend with Plugin Discovery

Layer / File(s) Summary
Plugin Discovery & Registry Infrastructure
python/cuvs_bench/cuvs_bench/backends/registry.py, python/cuvs_bench/pyproject.toml
Adds entry-point-based plugin loading for optional backends and config loaders, with helper functions to generate pip install hints and rewrite ImportErrors when optional dependencies are missing. Wires cuvs_bench.backends.elastic and cuvs_bench.config_loaders.elastic entry points to the elasticsearch:register target; registers new elastic optional dependency group.
Centralized Recall Computation
python/cuvs_bench/cuvs_bench/orchestrator/orchestrator.py
Introduces _should_compute_recall() helper to centralize recall-computation gating logic based on result.success, presence of neighbors, and an authoritative-recall metadata flag. Unifies recall logic in both sweep and tune modes.
Elasticsearch Backend: Index Build & Search
python/cuvs_bench/cuvs_bench/backends/elasticsearch.py
Implements ElasticBackend with lazy Elasticsearch client creation, preflight network checks, index creation/deletion/reuse logic, chunked bulk vector ingestion, multi-parameter kNN search with per-parameter recall computation, and latency percentile aggregation.
Elasticsearch Configuration Loader
python/cuvs_bench/cuvs_bench/backends/elasticsearch.py
Implements ElasticConfigLoader to discover algorithm groups from YAML configs, resolve allowed algorithms/groups, and expand parameter combinations into BenchmarkConfig objects with backend connection settings. Provides register() and convenience APIs run_build, run_search, run_benchmark.
Elasticsearch Parameter Definitions
python/cuvs_bench/cuvs_bench/backends/search_spaces.py, python/cuvs_bench/cuvs_bench/config/algos/elastic.yaml
Defines four Elasticsearch HNSW variants in search spaces (elastic_hnsw, elastic_int8_hnsw, elastic_int4_hnsw, elastic_bbq_hnsw) and complete benchmark configuration with base, quantized, and test parameter groups.
OpenSearch Array Initialization Fix
python/cuvs_bench/cuvs_bench/backends/opensearch.py
Replaces np.zeros() with np.empty() for zero-sized neighbor/distance arrays in failure and dry-run paths.
Test Infrastructure & Configuration
python/cuvs_bench/cuvs_bench/tests/conftest.py
Adds pytest configuration to conditionally register Elasticsearch backend support at test startup.
Comprehensive Modularization & Integration Tests
python/cuvs_bench/cuvs_bench/tests/test_modularization.py
Smoke tests for backend registration and error messaging, mocked plugin loader validation, conditional Elasticsearch integration tests (build/search, network preflight, index reuse, lazy-loading, unsupported-type rejection), and utility function validation.
Build System Configuration
dependencies.yaml
Adds py_elastic_cuvs_bench build target and bench_elastic dependency group to wire the Elasticsearch backend into the build system.

๐ŸŽฏ 4 (Complex) | โฑ๏ธ ~60 minutes

Possibly related PRs

  • rapidsai/cuvs#2012: Modifies recall computation logic in orchestrator.py with different gating criteria for when to recompute recall from backend results.

Suggested reviewers

  • cjnolet
  • bdice
  • jnke2016
๐Ÿšฅ Pre-merge checks | โœ… 5
โœ… Passed checks (5 passed)
Check name Status Explanation
Title check โœ… Passed The title accurately and specifically describes the main change: adding an Elasticsearch HTTP backend for cuvs-bench with GPU vector search support.
Description check โœ… Passed The description clearly relates to the changeset, explaining the Elasticsearch backend addition, entry points, registry extensions, optional dependencies, and testing scaffolding.
Docstring Coverage โœ… Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%.
Linked Issues check โœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check โœ… Passed Check skipped because no linked issues were found for this pull request.

โœ๏ธ Tip: You can configure your own custom pre-merge checks in the settings.

โœจ Finishing Touches
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jun 12 '26 18:06 coderabbitai[bot]