feat(search): Metal residual bound kernel + GPU cascade routing (chain 3/3) - #30
Open
christopherkarani wants to merge 1 commit into
Open
feat(search): Metal residual bound kernel + GPU cascade routing (chain 3/3)#30christopherkarani wants to merge 1 commit into
christopherkarani wants to merge 1 commit into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Chain Info
Chain: 3 of 3
Strategy: feature-branch-chain
Base:
chain/2-residual-core(merge 1, then 2 first)Summary
residual_bound_parameters/residual_compute_boundstoFlatSearch.metal: one bandwidth-bound GPU pass computes safe per-row lower bounds for the cascade.ResidualCascadeGPU.swiftimplementssearchGPU(context:)with lazy per-device plane caching and exact host verification; any failure falls back to the flat GPU tier (never approximate).FlatGPUSearch.searchroutes eligible very-large-corpora queries through Tier 2.5 before the flat GPU tier.Exactness
METALANNS_VERIFY_BOUNDS=1: zero bound violations across cosine/L2/inner-product diagnostics.Performance (fixed protocol: 1M×384 cosine k=24, M3 Max, seed 42)
The ≥10× aspiration is not met; limiting factors are the full-corpus projected-bound scan and host seed selection. Best observed run: p50 2.35 ms.
Changes
Sources/MetalANNSCore/Shaders/FlatSearch.metalSources/MetalANNSCore/ResidualCascadeGPU.swiftSources/MetalANNSCore/FlatGPUSearch.swiftTest Plan
METALANNS_VERIFY_BOUNDS=1)