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

Add Enzyme tests #254

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

Add Enzyme tests #254

wants to merge 18 commits into from

Conversation

devmotion
Copy link
Member

I had tried to run Enzyme tests, and it seems currently quite a few tests fail/error.

@yebai
Copy link
Member

yebai commented Jul 17, 2023

The fact that it doesn't segfault in so many tests is a good sign.

Related: TuringLang/Turing.jl#1887

@wsmoses
Copy link
Collaborator

wsmoses commented Aug 1, 2023

@devmotion can you rerun on latest Enzyme main?

@wsmoses
Copy link
Collaborator

wsmoses commented Aug 5, 2023

fyi the test failures appear to be due to currently unimplemented derivatives of lapack functions. probably should disable those tests.

@wsmoses
Copy link
Collaborator

wsmoses commented Aug 7, 2023

@devmotion @yebai at this point, everything in this PR works except:

  • differentiating through Lapack functions is not yet supported by Enzyme
  • your test code uses an active return for a function which returns a vector (this must be duplicated).

Moreover all the errors are relatively nice.

at this point there aren't Enzyme bugs here and merging this is now on your end (presumably marking the code using lapack as unsupported atm, and fixing your test handler to not use an active vector for that input)

@devmotion
Copy link
Member Author

Thank you, I'll try to have a look at and fix the remaining issues this week.

@devmotion
Copy link
Member Author

The latest commit added a way to mark some Enzyme tests as broken (and I also introduced a bug in the test setup 😄) but it also reveals that there are many more issues - so far only a tiny initial testset was run but no tests of the log densities of the uni-, multi- and matrixvariate distributions we're actually interested in.

@devmotion
Copy link
Member Author

@wsmoses
Copy link
Collaborator

wsmoses commented Aug 16, 2023 via email

@yebai
Copy link
Member

yebai commented Aug 16, 2023

One slightly annoying thing I found about the Enzyme error message is printing a large amount of LLVM code when compilation fails (see here for an example). This is useful when developing Enzyme (at least in the early stages) but not very helpful for users of Enzyme. Very few people can read such LLVM code and figure out why Enzyme couldn't compile. They also add clutter to CI logs. I suggest disabling such LLVM messages by default but providing an API for developers to activate them when needed.

@wsmoses
Copy link
Collaborator

wsmoses commented Sep 14, 2023

@devmotion did you have a chance to isolate that 1.6 error that crashes Julia (so we can ensure it does not)?

@wsmoses
Copy link
Collaborator

wsmoses commented Sep 22, 2023

@devmotion can you repush (its not letting me rerun tests for some reason)

@wsmoses
Copy link
Collaborator

wsmoses commented Oct 11, 2023

@devmotion hm I still can't retrigger this, if you can have the tests run again.

@yebai
Copy link
Member

yebai commented Oct 22, 2023

@wsmoses you should have the priveledges to trigger CI (re-)runs -- can you try again?

@devmotion devmotion closed this Oct 22, 2023
@devmotion devmotion reopened this Oct 22, 2023
@devmotion devmotion closed this Oct 22, 2023
@devmotion devmotion reopened this Oct 22, 2023
@wsmoses wsmoses closed this Dec 6, 2023
test/ad/utils.jl Outdated Show resolved Hide resolved
@yebai yebai marked this pull request as ready for review July 9, 2024 21:13
@yebai
Copy link
Member

yebai commented Jul 9, 2024

I think Enzyme might still struggle with a few MvNomal tests, which was revealed after 8b9fa77

@wsmoses
Copy link
Collaborator

wsmoses commented Jul 10, 2024

open issues and we'll get those sorted!

@wsmoses
Copy link
Collaborator

wsmoses commented Jul 10, 2024

Oh yeah runtime activity isn't supported yet for forward mode blas, so my recommendation here is to turn on runtime activity more selectively for which tests need it

@yebai yebai closed this Jul 23, 2024
@yebai yebai reopened this Jul 23, 2024
@yebai yebai closed this Jul 31, 2024
@yebai yebai reopened this Jul 31, 2024
@yebai yebai closed this Aug 15, 2024
@yebai yebai reopened this Aug 15, 2024
test/ad/utils.jl Outdated Show resolved Hide resolved
test/ad/distributions.jl Outdated Show resolved Hide resolved
@yebai
Copy link
Member

yebai commented Aug 21, 2024

I marked distributions that involve ccalls without rules as broken so CI won't fail. Enzyme seem to run in most cases but could return incorrect gradients some distribution density functions.

@wsmoses
Copy link
Collaborator

wsmoses commented Aug 21, 2024

Cool, open an issue for whatever is wrong and we’ll get it fixed

test/runtests.jl Outdated Show resolved Hide resolved
@mhauru mhauru self-assigned this Sep 2, 2024
@mhauru
Copy link
Member

mhauru commented Sep 13, 2024

Draft PR for doing the reverse, namely adding Distributions.jl integration tests into Enzyme: EnzymeAD/Enzyme.jl#1819

@wsmoses
Copy link
Collaborator

wsmoses commented Sep 15, 2024

We're going to need individual issues for any failures. The PR above doesn't presently work as it hits a version issue with QuadGK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants