Add Vespa engine support for multi-engine benchmarking#1043
Conversation
Introduces an engine-as-module pattern under osbenchmark/engine/ where each engine exposes a standard interface (create_client_factory, create_async_client, register_runners, wait_for_client, on_execute_error). Adds Vespa support using pyvespa httpr (Rust HTTP) for search and aiohttp for document feed. Vespa runners require pre-translated YQL in the request body. Replaces the previous osbenchmark/database/ abstraction layer with the simpler engine registry pattern. OpenSearch engine is a thin delegation to existing client.py and runner.py (those files are untouched). Signed-off-by: Michael Oviedo <mikeovi@amazon.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 55d1e94.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
| db_type = self.config.opts("database", "type", default_value="opensearch", mandatory=False).lower() | ||
| engine = get_engine(db_type) | ||
| self.logger.info("Checking if [%s] is available.", db_type) | ||
| if engine.wait_for_client(opensearch["default"], max_attempts=40): |
There was a problem hiding this comment.
Ao we are assuming each client will have some way to confirm if the Db server is up and running?
There was a problem hiding this comment.
yeah, pretty much. Each engine exposes a health check endpoint we can check before running the benchmark
| # /_plugins/_knn/warmup/) that fail on non-OS engines — the engine's register_runners() | ||
| # overrides those so each operation type uses the engine-appropriate implementation. | ||
| db_type = self.config.opts("database", "type", default_value="opensearch", mandatory=False).lower() | ||
| if db_type != "opensearch": |
There was a problem hiding this comment.
why this?
Ideally if the default engine type is OS, then this should just register OS runners, am I missing something?
Okay, I think it is because we are not touching current runners logic for OS and other DB engine runners will reside in their implementation logic, is that right?
There was a problem hiding this comment.
yeah, OS runners are registered in the existing runner.py file as before so they are untouched. The call here is only for non OS engines. If engine type is OS then this is just a no-op
Description
Broken off from #1042 , this PR contains only Vespa-specific changes
Adds support for Vespa in OSB.
Ingest and query data on other search engines outside of OpenSearch using a new
--database-typeflagEach engine is a Python module under
osbenchmark/engine/<name>/exposing 5 functions:A lightweight registry (
osbenchmark/engine/__init__.py) dispatches--database-type=vespato the correct module. OpenSearch remains the default and delegates to the existingosbenchmark/client.pyandosbenchmark/worker_coordinator/runner.py, those files are untouched.Vespa (
osbenchmark/engine/vespa/):httpr(Rust HTTP) for search,aiohttpfor document feedBenchmarkErrorifbody["yql"]missing)feed_batch()with HTTP/2 multiplexing, configurablemax_concurrenthnsw_ef_searchmapped totargetHits+hnsw.exploreAdditionalHitsUsage
Vespa
Example params file (works for all engines — adjust
target_index_nameper engine){ "target_index_name": "target_index", "target_field_name": "embedding", "target_index_body": "indices/faiss-index.json", "target_index_primary_shards": 1, "target_index_replica_shards": 0, "target_index_dimension": 768, "target_index_space_type": "innerproduct", "target_index_bulk_size": 500, "target_index_bulk_index_data_set_format": "hdf5", "target_index_bulk_index_data_set_corpus": "cohere-1m", "target_index_bulk_indexing_clients": 10, "target_index_max_num_segments": 1, "hnsw_ef_construction": 200, "hnsw_ef_search": 256, "query_k": 100, "query_data_set_format": "hdf5", "query_data_set_corpus": "cohere-1m", "query_count": 10000, "search_clients": 1, "neighbors_data_set_corpus": "cohere-1m", "neighbors_data_set_format": "hdf5" }New Dependencies
pip install pyvespa) — optional, for Vespa engineIssues Resolved
#1000
Testing
Unit tests + full E2E test against live Vespa + Milvus nodes.
All results from cohere-1M (768-dim, innerproduct) on m5.2xlarge (8 vCPU / 32 GB) instances, single-node per engine. 1M vectors ingested, 10K queries,
hnsw_ef_search=256,k=100.Ingest throughput
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.