Skip to content

Adjust GPU graph building params#137074

Merged
mayya-sharipova merged 2 commits intoelastic:mainfrom
mayya-sharipova:cagra-params-adjustment
Oct 24, 2025
Merged

Adjust GPU graph building params#137074
mayya-sharipova merged 2 commits intoelastic:mainfrom
mayya-sharipova:cagra-params-adjustment

Conversation

@mayya-sharipova
Copy link
Contributor

cuvs 2025.12 will provide an API for converting HNSW CPU Params to Cagra params.

But for current ES that uses 2025.10 version, we need to adjust params
ourselves. This PR adjust params based on the code from the cuvs library.

cuvs 2025.12
https://github.com/rapidsai/cuvs/pull/1448/files
 will provide an API for converting HNSW CPU Params to Cagra params.

 But for current ES that uses 2025.10 version, we need to adjust params
 ourselves. This PR adjust params based on the code from the cuvs library.

fadfas
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Oct 23, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @mayya-sharipova, I've created a changelog YAML for you.

@mayya-sharipova
Copy link
Contributor Author

mayya-sharipova commented Oct 23, 2025

New cagra params for GPU index building based on this PR
params.graph_degree = 2 + M * 2 / 3;
params.intermediate_graph_degree = M + M * ef_construction / 256
KnnIndexTester: 8 indexing threads ; Nvidia GeForce RTX 4060, 8Gb memory


With this adjustments, we can make GPU indexing/merging up to **3x faster ** than before

gist: 1_000_000 docs; 960 dims; euclidean metric

index_type index_time(ms) force_merge_time (ms) QPS multiple segs recall multiple segs QPS single seg recall single seg
cpu 200730 130129 140 0.94 421 0.91
gpu old 58743 65363 155 0.98 358 0.97
gpu PR 22119 20643 177 0.96 467 0.92

cohere-wikipedia_v2: 934_024 docs; 768 dims; cosine metric

index_type index_time(ms) force_merge_time (ms) QPS multiple segs recall multiple segs QPS single seg recall single seg
cpu 101200 146709 171 0.94 471 0.80
gpu old 44364 48228 172 0.99 367 1
gpu  PR 16298 15961 245 0.99 532 0.98

quora-E5-small: 522931 docs; 384 dims; cosine metric

index_type index_time(ms) force_merge_time (ms) QPS multiple segs recall multiple segs QPS single seg recall single seg
cpu 41025 66514 301 0.98 792 0.93
gpu old 21338 22459 238 0.98 546 1
gpu PR 9270 6532 323 1 769 1

opeanai: 2.6M docs; 1536 dims; dot_product (cosine for GPU)

index_type index_time(ms) force_merge_time (ms) QPS multiple segs recall multiple segs QPS single seg recall single seg
cpu 702350 149302 99 0.85 148 0.84
gpu old 283954 46015 123 0.99 160 0.96
gpu PR 94886 15343 194 0.97 224 0.97
Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

Awesome! LGTM

@mayya-sharipova mayya-sharipova added the auto-backport Automatically create backport pull requests when merged label Oct 24, 2025
@mayya-sharipova mayya-sharipova merged commit 7e9049e into elastic:main Oct 24, 2025
34 checks passed
@mayya-sharipova mayya-sharipova deleted the cagra-params-adjustment branch October 24, 2025 10:14
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.2
mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this pull request Oct 24, 2025
cuvs 2025.12
https://github.com/rapidsai/cuvs/pull/1448/files
 will provide an API for converting HNSW CPU Params to Cagra params.

 But for current ES that uses 2025.10 version, we need to adjust params
 ourselves. This PR adjust params based on the code from the cuvs library.
elasticsearchmachine pushed a commit that referenced this pull request Oct 24, 2025
cuvs 2025.12
https://github.com/rapidsai/cuvs/pull/1448/files
 will provide an API for converting HNSW CPU Params to Cagra params.

 But for current ES that uses 2025.10 version, we need to adjust params
 ourselves. This PR adjust params based on the code from the cuvs library.
fzowl pushed a commit to voyage-ai/elasticsearch that referenced this pull request Nov 3, 2025
cuvs 2025.12
https://github.com/rapidsai/cuvs/pull/1448/files
 will provide an API for converting HNSW CPU Params to Cagra params.

 But for current ES that uses 2025.10 version, we need to adjust params
 ourselves. This PR adjust params based on the code from the cuvs library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >enhancement :Search Relevance/Search Catch all for Search Relevance Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.1 v9.3.0

3 participants