Repository navigation
Closes #4468 aligning vecdot function to numpy - #4472
Merged
Merged
Conversation
drculhane
force-pushed
the
Closes-4468
branch
2 times, most recently
from
May 30, 2025 16:25
343b1d2 to
ef6e703
Compare
1RyanK
approved these changes
Jun 2, 2025
1RyanK
left a comment
Contributor
There was a problem hiding this comment.
Looks good! My personal opinion is that we should match numpy behavior, so assuming no one is currently using the old version of vecdot I'd be okay with this overwriting the old one.
drculhane
marked this pull request as ready for review
June 4, 2025 16:30
ajpotts
approved these changes
Jun 6, 2025
ajpotts
left a comment
Contributor
There was a problem hiding this comment.
Great work. Thanks for fixing this. I like all the tests.
ajpotts
enabled auto-merge
June 9, 2025 14:19
ajpotts
approved these changes
Jun 9, 2025
ajpotts
added this pull request to the merge queue
Jun 9, 2025
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.
Closes #4468
Update to the update
I rebased, and seem to have included changes that were already in the most recent master.
Update
The array_api tests had a test of vecdot which included the comment "because numpy doesn't have a vecdot," and so it compared to something that performed the old computation. That comment has been removed, and the test now compares the result to np.vecdot.
Still a draft, for one more round of tests.
The old vecdot has been removed. The new vecdot matches the performance of numpy vecdot, and includes an optional axis parameter which can be used when the input arrays have matching shape. This didn't require any chapel-side code, just the use of broadcasting, binops, and ak.sum along the last axis.
I've added a comment in the Notes section of the docstring describing how to replicate the previous vecdot computation.