Repository navigation
Reuse the single choice cache in serial cdist - #519
Open
wozhenbang2004 wants to merge 2 commits into
Open
wozhenbang2004 wants to merge 2 commits into
wozhenbang2004 wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Refs #136.
The non-SIMD
cdistpath creates a cached scorer for every query, even when there is only one choice. For symmetric scorers with serial workers (0or1), initialize the cache from that choice on the first valid comparison and reuse it across queries. Keep the existing argument order for asymmetric scorers, and leave the parallel and SIMD paths unchanged.Add 39 compatibility cases that compare native and Python results for cutoffs, hints, processors, output types, missing values, asymmetric weights, and worker settings.
Validation on Python 3.12.14 with the native Release build (
-O3, project-default LTO):Nonereturns unstable values in repeated runs of both versions.test_score_cutoff_equal_to_score[scorer9]failure. The unmodified base has the same failure with 542 passed.pre-commit run --all-filesandgit diff --checkpass.