feat: add tiled exact search primitives and optional GPU scoring support - #19
Open
AxelRolov wants to merge 3 commits into
Open
feat: add tiled exact search primitives and optional GPU scoring support#19AxelRolov wants to merge 3 commits into
AxelRolov wants to merge 3 commits into
Conversation
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.
Summary
scoringandoptimizationto avoid eager import cyclesscoring_tiled.pywith tiled exact-search utilities for squared norms, batched Tanimoto, and streamed top-k selectiongpuextra so CPU-only installs continue to work unchangedDetails
This PR prepares
cdr_benchto act as a reusable compute backend for large-scale exact search workloads.The CPU layer adds:
compute_fp_squared_normstanimoto_similarity_matrix_batchtopk_1d/topk_matrixexact_tanimoto_topk_from_blockstreaming_exact_topkresolve_tanimoto_backendThe GPU layer adds:
gpu_kernels.pywith a safe CuPy import wrapperCuPyKernelBridgewith aRawModulefused top-k kernel path and a CuPy fallback path[project.optional-dependencies].gpuValidation
scoring_tiled.pyandgpu_kernels.pyfrom cdr_bench.scoring import compute_fp_squared_norms, streaming_exact_topkhas_gpu_support() == Falseinstead of breaking importsNotes
The GPU bridge is intentionally optional and isolated. A CPU-only
uv syncshould continue to work withoutcupyinstalled, while GPU users can opt in withuv sync --extra gpu.