avoid parameterizing GeneratedFunctionWrapper on the RGFs#4552
Draft
KristofferC wants to merge 1 commit into
Draft
avoid parameterizing GeneratedFunctionWrapper on the RGFs#4552KristofferC wants to merge 1 commit into
KristofferC wants to merge 1 commit into
Conversation
This causes a large number of functions that take this as an argument to specialize on different input models. This has no performance benefit in practice so just avoid doing that
Member
|
(Almost) every generated function is put in GFW, including the ODE RHS. If we unconditionally stop specializing here, then |
Contributor
Author
|
Maybe, will try. I have to reevalute my numbers on top of #4521. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This causes a large number of functions that take this as an argument to specialize on different input models. This has no performance benefit in practice, so we can just avoid doing that. The result of this is also directly converted via
u0_eltype(and they are only called in the initialization problem and remake AFAIU) so there is no loss of inference precision.For numbers, I was running with something that looked like this (basically doing the same thing with two identical models that are separately instantiated:
and saw that
create odeprob 2had a large compilation time even though it should already be compiled. Printing out the results with@trace_compileI could see many functions being specialized on the GFW:With this PR, the numbers change as follows (what is most interesting is looking at the compile time for
odeprob 2(the last one):