-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add DifferentiationInterface test suite #1563
base: main
Are you sure you want to change the base?
Conversation
This was the result of a bad jll uptake yesterday, already caught by our existing CI, and has been fixed on main (and being released today). I'm not opposed to this in principle but the tests need to provide actionable feedback of Enzyme-specific MWE's. In any case since the existing suite caught this already, I'm going to assume the need for is moot and close. Feel free to re-open if you'd like. |
I can't reopen a PR you closed.
This specific bug was caught by your CI, but others may not be, and others have not been in the past. For instance, by using our type stability checks, you would have been able to catch #1401 right away.
What do you mean by this? Test failures in DifferentiationInterfaceTest are already fairly verbose and precise, take a look at the stack trace here for instance: https://github.com/gdalle/DifferentiationInterface.jl/actions/runs/9644116325/job/26595528876 |
We do generally add tests for any failures caught (so as an example the test you showed earlier led to us adding some inferred tests that should check the same). I guess the source of my hesitation here is that while adding these as integration tests is useful as a signal that everything is fine or not, the feedback isn't actionable to an enzyme dev. For example looking at the posted log:
I have no idea what the isolated function is, or the corresponding Enzyme.autodiff call which would correspond to it (required to successfully debug). If you would be able to print out a corresponding MWE with corresponding Enzyme.autodiff call which triggers that would be immensely useful. Also fwiw, adding this test suite here would not catch the bug before added, since, like mentioned this happened downstream in the jll. |
Yeah, the stack trace is not very useful here, what I meant was the test summary at the end. |
The issue is that it would require storing the result of every test somehow, instead of just relying on the nested |
Yeah I mean like I said before that's nice as an integration test, but that level of summary isn't sufficient to be able to debug -- which really requires an MWE of the fn and the autodiff. My hesitation here is that if someone has a PR which causes that to fail, they'd also have to look through a separate repo and have to try to disect what the failing code is, and how to reproduce it (after of course confirming whether that is indeed a bug or intended). Given that the bar to contribution is already relatively high, I'm hesitant to force devs to have to bear that burden (hence the ask for it to spit out an isolatable MWE). Otherwise it'll just get ignored, at which point there isn't much value in a check (like the present formatter) which is always assumed failing and never checked. |
Would it be enough if the test displayed a custom error message that gives you an MWE in DifferentiationInterface syntax? Something like: To reproduce this behavior, run the following Julia code and inspect the result: import Enzyme
using DifferentiationInterface, DifferentiationInterfaceTest
backend = AutoEnzyme()
f = DifferentiationInterfaceTest.num_to_arr_vector
x = 1.0
dy = float.(1:6)
pullback(f, backend, x, dy) |
Prompted by #1562, this PR adds some tests from DifferentiationInterfaceTest to the Enzyme test suite.
Our test suite has caught numerous bugs in the past, so it would be a great asset to check that new Enzyme releases don't jeopardize existing behavior.