Skip to content

Improve CAGRA multi-CTA heuristic: max_iterations - #2582

Open
sherylll wants to merge 1 commit into
NVIDIA:mainfrom
sherylll:improve_multi_cta_heuristics
Open

Improve CAGRA multi-CTA heuristic: max_iterations#2582
sherylll wants to merge 1 commit into
NVIDIA:mainfrom
sherylll:improve_multi_cta_heuristics

Conversation

@sherylll

@sherylll sherylll commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

For multi-CTA mode, current max_iterations is assigned a large number. However, at low itopk, extra iterations only add latency and does not do much to recall. So the intuition is to use a lower max_iterations for smaller itopk.

minimum_depth = 8 * (search_quality - 1), since we don't provide a knob for search_quality for the moment, hardcoding this to 16. search_quality = 5 would mean the previous default 32.

When the problem is harder, or when more results are needed, it is still a good idea to turn up the max_iterations.

n_queries=1, k=10
gist_compare_quality_k10_nq1,pareto
deep_compare_quality_k10_nq1,pareto

n_queries=10, k=50
gist_compare_quality_k50_nq10,pareto
deep_compare_quality_k50_nq10,pareto

This is a subset of #2502, where the change to width or hashmap size seem to have different effect on different GPU generations, which still remains to be investigated. But the conclusion on max_iterations should hold.

@sherylll
sherylll requested a review from a team as a code owner September 10, 2026 00:42
@copy-pr-bot

copy-pr-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant