-
Notifications
You must be signed in to change notification settings - Fork 70
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
Enzyme rules for partialsort!
#1373
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1373 +/- ##
==========================================
- Coverage 75.41% 74.73% -0.68%
==========================================
Files 35 35
Lines 10664 10716 +52
==========================================
- Hits 8042 8009 -33
- Misses 2622 2707 +85 ☔ View full report in Codecov by Sentry. |
I can reproduce the Julia 1.7 CI failure locally, but I don't immediately see how to fix it. With this PR and Julia 1.7.0 on Windows: using Enzyme, Test
function f(x)
a = [2.0, 2.5, x, x / 2]
y = partialsort(a, 1:2)
return sum(y)
end
@test autodiff(Forward, f, Duplicated(1.5, 1.0))[1] == 1.5 # Passes
@test autodiff(Forward, f, BatchDuplicated(1.5, (1.0, 2.0)))[1] == (var"1"=1.5, var"2"=3.0)
|
@jgreener64 I think this is a bug in an older julia. If you just version gate the test, I think it's fine |
I think the remaining test failures are unrelated. |
In fixing #880 I saw the need for an Enzyme rule for
partialsort!
, which fixes that issue and may be useful elsewhere since we have a rule forsort!
.