Skip to content
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

Optimize pairwise for Sinus and scalar inputs #538

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

simsurace
Copy link
Member

Summary
A call like kernelmatrix(PeriodicKernel(), rand(1000)) produces a number of allocations of the same order as the size of the kernel matrix because Sinus has a vector parameter and the dispatch hits a path which allocates that for each element of the kernel matrix.

Proposed changes
We add two specialized methods that use broadcast.

What alternatives have you considered?
None.

@simsurace simsurace added the performance critical Triggers benchmarking CI label Nov 10, 2023
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (9a2f7bb) 72.78% compared to head (f990586) 66.57%.

Files Patch % Lines
src/distances/sinus.jl 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #538      +/-   ##
==========================================
- Coverage   72.78%   66.57%   -6.22%     
==========================================
  Files          52       52              
  Lines        1374     1382       +8     
==========================================
- Hits         1000      920      -80     
- Misses        374      462      +88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/distances/sinus.jl Outdated Show resolved Hide resolved
simsurace and others added 3 commits January 23, 2024 21:21
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance critical Triggers benchmarking CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant