Refactor post-processing logic from the core search and implement rag_search using that pattern#794
Draft
narendatha wants to merge 6 commits intomainfrom
Draft
Refactor post-processing logic from the core search and implement rag_search using that pattern#794narendatha wants to merge 6 commits intomainfrom
narendatha wants to merge 6 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (43.35%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #794 +/- ##
==========================================
- Coverage 89.16% 88.67% -0.49%
==========================================
Files 431 435 +4
Lines 78895 79610 +715
==========================================
+ Hits 70343 70597 +254
- Misses 8552 9013 +461
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
- Add RAG<DP,T,S> benchmark searcher in diskann-benchmark-core with Aggregator that reuses knn::Summary for recall/QPS reporting - Add RagSearchSteps runner and Rag trait in diskann-benchmark - Add TopkRag variant to SearchPhase enum with RagSearchPhase struct (rag_eta, rag_power fields) - Add RunRagSearch trait with f32 specialization for type-safe dispatch - Add rag-search.json example comparing Topk vs TopkRag on siftsmall - Handle TopkRag in spherical.rs with unsupported bail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Post-Process Refactor: Composable
PostProcessTrait & RAG SearchSummary
Introduces a composable
PostProcess<Processor, Provider, T, O>trait that decouples post-processing logic from the core search algorithm, and uses it to implement RAG-aware search as the first concrete consumer.Changes
New:
PostProcesstrait (glue.rs)Processormarker type, enabling different post-processing strategies to be composed with anySearchStrategywithout duplicating the search loop.DefaultPostProcessmarker type with a blanket impl that delegates to the strategy's existingSearchPostProcessor -- everySearchStrategygets default post-processing for free.New:
rag_post_process.rseta > 0path).dot_productviaInnerProduct.New:
rag_search.rsRagSearchParamsstruct (rag_eta,rag_power) -- the processor marker for RAG post-processing.RagSearchstruct wrappingKnnWith<RagSearchParams>, implementingSearchby delegating to the composed inner type.knn(),rag_eta(),rag_power(),k_value(),l_value().Modified:
knn_search.rsKnnWith<PP>now accepts a genericProcessorand requiresS: PostProcess<PP, ...>instead of hardcoding a specific post-processor.RagSearchParams.Design
Any new post-processing strategy only needs to:
RagSearchParams).PostProcess<MarkerStruct>on the relevant strategy.KnnWith<MarkerStruct>in a search type.