Skip to content

Conversation

@benwtrent
Copy link
Member

This adjusts the postings list building to be more idiomatic in how it access the vectors:

  • First, all the vectors are read in order and quantized according to their centroid assignments
  • Then we use those quantized values to read (potentially randomly) when building the clusters.

This reduces memory thrashing and improves indexing throughput at larger scale.

We should consider how we want to read these raw vectors during indexing to see if there are other gains to be had.

baseline:

index_name                      index_type  num_docs  index_time(ms)  force_merge_time(ms)  num_segments
------------------------------  ----------  --------  --------------  --------------------  ------------
cohere-wikipedia-docs-768d.vec         ivf   4000000          345710                918228             0

candidate:

index_name                      index_type  num_docs  index_time(ms)  force_merge_time(ms)  num_segments
------------------------------  ----------  --------  --------------  --------------------  ------------
cohere-wikipedia-docs-768d.vec         ivf   4000000          294118                830919             0

@benwtrent benwtrent requested review from iverase and john-wagster and removed request for iverase July 8, 2025 19:52
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jul 8, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@iverase
Copy link
Contributor

iverase commented Jul 9, 2025

I think we should wait until #129071 is resolved as this might change the way we write posting lists (not the format but the order).

Copy link
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@benwtrent benwtrent merged commit 44497b7 into elastic:main Jul 16, 2025
33 checks passed
@benwtrent benwtrent deleted the adj-ivf-postings-list-building branch July 16, 2025 13:35
szybia added a commit to szybia/elasticsearch that referenced this pull request Jul 16, 2025
…king

* upstream/main: (91 commits)
  Mute org.elasticsearch.packaging.test.DockerTests test130JavaHasCorrectOwnership elastic#131369
  Add exception logging when interrupted (elastic#131153)
  Mute org.elasticsearch.packaging.test.DockerTests test140CgroupOsStatsAreAvailable elastic#131372
  Mute org.elasticsearch.packaging.test.DockerTests test070BindMountCustomPathConfAndJvmOptions elastic#131366
  Mute org.elasticsearch.xpack.test.rest.XPackRestIT test {p0=ml/delete_expired_data/Test delete expired data with body parameters} elastic#131364
  Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testSimilarityBetweenConstantVectorAndField {functionName=v_cosine similarityFunction=COSINE} elastic#131363
  Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testDifferentDimensions {functionName=v_cosine similarityFunction=COSINE} elastic#131362
  Mute org.elasticsearch.xpack.esql.vector.VectorSimilarityFunctionsIT testSimilarityBetweenConstantVectors {functionName=v_cosine similarityFunction=COSINE} elastic#131361
  Check SCORE_FUNCTION capability in VerifierTests (elastic#131352)
  Replace deprecated routingTable table call in tests (elastic#131005)
  [DOCS] Remove misused applies_to tag (elastic#131349)
  Adj ivf postings list building (elastic#130843)
  [Transform] Read metadata from Project State (elastic#131205)
  Add note on o11y to architecture guide (elastic#131291)
  Upgrade AWS Java SDK to 2.31.78 (elastic#131050)
  Support Fields API in conditional ingest processors (elastic#121914)
  ESQL - KNN function uses prefilters when pushed down to Lucene (elastic#131004)
  Add docs for ES|QL query logs (elastic#131287)
  Simplify `expectedFinalRegisterValue` computation (elastic#131274)
  Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=search/110_field_collapsing/field collapsing, inner_hits and maxConcurrentGroupRequests} elastic#131348
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants