-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: spatial: faster Chebyshev distance #20570
Open
lozanodorian
wants to merge
1
commit into
scipy:main
Choose a base branch
from
lozanodorian:enh_20561
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really only making things faster for high-dimensionality data, which may not really be the primary use case (3 dimensions are pretty common obviously). Most of the workhorse usage of the distance metrics probably happens through
pdist
andcdist
where multiple points can be compared.In fact, our formal
asv
benchmarks probably reflect this PR being a step back for the common low-dimensions scenario. Need to check withasv continuous -e -b "SingleDist.*" main enh_20561
or similar (wasn't working for me locally.. need to open an issue for that..).If the argument is performance, then perhaps the middle-ground approach combined with adjustment of our
asv
benchmarks to probe performance in both dimensionality regimes would make sense.There may be some array API argument for
xp.max
approach. But then I'm not sure we should really be framing this as performance focused, since > 40 dimensions is quite a lot for practical use I think. If other devs are happy with the array API argument then I probably care less about benchmarking with regular NumPy arrays, but I do want us to be clear on the purpose.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not surprising, but here is the current output of
asv continuous -e -v -b "SingleDist.*" main enh_20561
showing slower performance. This probably isn't worth too much debate over a single line change, but maybe folks should pick a reason to go in one direction or another.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more precise, avoid us merging this and then in 6 months someone comes along and reverts it, citing this benchmark in our suite. So maybe a comment explaining tradeoffs if folks agree on some reason for it.