-
Notifications
You must be signed in to change notification settings - Fork 36
Stable version of KernelProduct and added test_type_stability
#486
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
Conversation
Codecov ReportBase: 94.32% // Head: 82.64% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #486 +/- ##
===========================================
- Coverage 94.32% 82.64% -11.69%
===========================================
Files 52 52
Lines 1358 1371 +13
===========================================
- Hits 1281 1133 -148
- Misses 77 238 +161
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
What's the root issue here? reduce
with a generator? hadamard
? Depending on what exactly the problem is, I wonder if one should fix something upstream instead.
It's really hard to say, when going with Cthulhu through the calls, it seems that the only type unstable calls are due to the DimensionMismatch errors thrown by Distances.jl |
Hmm errors shouldn't cause type instabilities. Otherwise you could basically never throw errors in any function. |
I honestly don't know how to find the underlying issue... if you have a method please share 😊 |
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.
Glad to have this fix in. It's possible it will make more of a difference on the reverse-pass of AD anywy.
I think I just want slightly more general testing of the kernelmatrix
-related functions (sorry to ask for more stuff) -- just seems silly not to make slightly more general use of your new functionality.
I was thinking of an eventuality: When using a generator or Base.Fix2 we create a closure, which |
@theogf any progress on this on your end? I'm happy to finish up the PR if you're busy |
I was thinking of finishing up this week-end. |
Cool. I'll leave you to it then :) |
…s/KernelFunctions.jl into tgf/stable_product
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
test_type_stability
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.
Broadly LGTM. Just some formatting issues to resolve, then I think we're good to go
edit: also, sorry for taking a few days to review this -- have been busy with work etc :(
No worries I think we are all on the same boat now 😆 |
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.
Once you've got CI passing, happy for this to go in. Thanks for sorting it out!
Summary
This adresses #485 by bringing a similar solution from #459. It goes slightly differently by avoiding a closure entirely.
This also add tests for checking that on the culprit kernel, the type stability is maintained.
Regarding performance, it seems to not change anything (maybe marginally better).
master:
this PR:
This also refactors a part of
TestUtils.jl
to run withtest_with_type
so that we can reuse this functionality for different tests.Breaking changes
Non-breaking