-
Notifications
You must be signed in to change notification settings - Fork 154
Turn on precompilation for ForwardDiff #56
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
Conversation
|
This is what the docs say "Several additional restrictions are placed on the operations that can be done while precompiling code to help the user avoid other wrong-behavior situations:
|
|
What is ForwardDiff doing to cause a side-effect in another module? |
AFAIK, it's not...the only thing ForwardDiff uses Calculus for is
Maybe calling Calculus.differentiate calls |
|
At the very least, it does seem like a macro is used inside of Calculus.differentiate; I bet that's why this is happening. If that's true, the real question is then: should we ignore these warnings? They only appear for the initial compilation, and tests are passing. |
|
The |
|
Ah, I misread where that expression interpolation in Calculus.differentiate was actually occurring; I thought it was in function scope but it looks like it's in the scope of the encompassing |
|
The warning is WARNING: eval from module Calculus to ForwardDiff:Maybe it's not ForwardDiff causing a side-effect in Calculus, but the reverse, i.e. I'm using Calculus methods to generate the expressions that define ForwardDiff methods? That doesn't really make sense to me, but just throwing the idea out there...the thing that confuses me about this is that none of the Calculus methods called in ForwardDiff are called in an |
|
Are we extending any methods exported from Calculus? |
|
Not that I know of. We don't do it explicitly, and we use crosses fingers that this isn't related to exported Calculus.gradient |
|
Maybe @vtjnash has some insight? |
|
The warning is (correctly) telling you that the |
|
Maybe change that line to |
|
Yes, that would hide the warning, although it may not be what the author intended for this method to do. Another way to avoid the warning is to write this as: getfield(TheModule, ex.args[1])(ex.args[2:end]...) |
|
The expression inside |
|
I'm no longer get warnings here as of JuliaMath/Calculus.jl#77. Thanks for your help, everyone! |
Turn on precompilation for ForwardDiff
|
@mlubin |
|
@vtjnash is the answer to eval into Base, or is there a cleaner way? |
I get this when running
using ForwardDiff:With a lot more of the same post-ellipses. Is this a side effect ForwardDiff's heavy reliance on code generation? FWIW, I already pulled JuliaMath/Calculus.jl#76 before running this, so it shouldn't have anything to do with Calculus precompilation AFAIK (that PR is what reminded me I should probably do this).