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

Closed
wants to merge 2 commits into 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.

@OlivierHnt
Copy link
Member

@timholy how is the interaction between IntervalArithmetic (v0.22.14) and ForwardDiff for you?
I think the issues raised at the time in this PR have been resolved now. But I am also wondering if you are aware of more issues?

@timholy
Copy link
Contributor Author

timholy commented Jun 12, 2024

I haven't returned to this research topic in a while. I'll get back to it eventually, but for the time being...no idea! 🙂

@OlivierHnt
Copy link
Member

Closing this for the time being 🙂
Feel free to reopen in the future if something comes up!

@OlivierHnt OlivierHnt closed this Jun 21, 2024
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.

2 participants