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 an extension to support ForwardDiff #586

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

Conversation

timholy
Copy link
Contributor

@timholy timholy commented Sep 28, 2023

Because of the extensive changes on master, ForwardDiff no longer works with this package. This add an extension (Julia 1.9+) providing at least basic support.

Note that:

So obviously this can't be merged yet, but I thought it would be better to submit it now.

Because of the extensive changes on `master`, ForwardDiff no
longer works with this package. This add an extension (Julia 1.9+)
providing at least basic support.
@OlivierHnt
Copy link
Member

Thanks for opening this PR!
I wonder though if it should be the other way around. ForwardDiff.jl adds IntervalArithmetic.jl as an extension; also this gives a stronger guarantee that their differentiation mechanism is compatible with the specifications of interval arithmetic. 🤔

@timholy
Copy link
Contributor Author

timholy commented Sep 28, 2023

That's actually where I started. But I grew to think it might be better this way: ForwardDiff is widely used by a lot of different things, it seems more scalable to have extensions in packages that may have fewer "interop" demands. As a practical matter, ForwardDiff's tests also take a long time to run!

But in the end I'm not sure it matters a lot; the extension mechanism ensures the code will be loaded, one way or another.

@OlivierHnt
Copy link
Member

Good point about scalability.

So the main concern here is the reliability. Do we have a guarantee, with your PR, that iszero_tuple is used in ForwardDiff.jl in compliance with interval arithmetic specifications?

Unfortunately I am too unfamiliar with ForwardDiff.jl to know the answer. I see that it is used to define iszero(::Partials) and iszero(::Dual) which are themselves called at several places in the code.

@OlivierHnt
Copy link
Member

OlivierHnt commented Dec 2, 2023

I tried the tests you included in your PR and they seem to pass using the PR #593; I will add them to the test suite to keep track of FowardDiff.

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.

None yet

2 participants