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

Automatic differentiation & generics #45

Open
ivan-pi opened this issue Oct 4, 2021 · 1 comment
Open

Automatic differentiation & generics #45

ivan-pi opened this issue Oct 4, 2021 · 1 comment

Comments

@ivan-pi
Copy link

ivan-pi commented Oct 4, 2021

Has there been any discussion of the usage case of automatic differentiation (AD) in relation to generics?

Related issues:

Given how important AD is in the Julia ecosystem, I think a discussion of AD would also be warranted.

There are several (forward-mode) Fortran AD libraries relying upon derived types and operator/procedure overloading, which would be easier to develop if some smart generic features were available.

@tclune
Copy link
Member

tclune commented Oct 4, 2021

No - this has not been directly discussed in the generics subgroup. Clearly it is a very important application, and we would not want to miss the opportunity to ensure that whatever facility is deployed could address such use cases.

Could you possibly elaborate on what aspects of AD that you think may not derive naturally from other use cases? I know that is a possibly a very open ended question, but we need to start somewhere. I am only superficially aware of this topic, and have never done any direct work. E.g., my org has employed commercial AD software, but my understanding is that this package takes in source code as an input and generates source code as an output.

I glanced through the referenced threads, but don't have time at the moment for a deeper dive. The one bit I could more readily absorb (https://sourceforge.net/p/flibs/svncode/HEAD/tree/trunk/src/computing/automdiff.f90) is a bit easier to grok with a quick glance. I can easily imagine such an implementation becoming a template where rather than assuming REAL everywhere, would accept any TYPE that supports the necessary operators. To that extent, the existing plans for generics should be sufficient.

I can also offer you the opportunity to give a short presentation at one of our (mostly) weekly generics subgroup telecons. That could enable some back-and-forth and rapid capture.

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

No branches or pull requests

2 participants