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

The precompilation of this package is likely excessive and not very useful #417

Open
KristofferC opened this issue Apr 30, 2024 · 0 comments · May be fixed by SciML/DiffEqBase.jl#1101
Open
Labels
bug Something isn't working

Comments

@KristofferC
Copy link

This package does a more or less exhaustive combination of problems, algorithms and element types

for T in (Float32, Float64), (fn, u0) in nlfuncs
push!(probs_nls, NonlinearProblem(fn, T.(u0), T(2)))
end

@compile_workload begin
for prob in probs_nls, alg in nls_algs
solve(prob, alg; abstol = 1e-2, verbose = false)
end
for prob in probs_nlls, alg in nlls_algs
solve(prob, alg; abstol = 1e-2, verbose = false)
end
end

A total of 104 combinations of problems and algorithms are compiled in total.

At the same time, the problem specializes on the input function:

julia> typeof(prob)
NonlinearProblem{Float64, false, Float64, NonlinearFunction{false, SciMLBase.FullSpecialize, var"#1#2",

(the var"#1#2" is an anonymous function defined locally). so the compiled code is unlikely to be valid for users (which have their own functions that they solve).

It is not clear to me that there is any point at all to the precompilation of solve(prob, alg) after the very first call has been compiled.

@KristofferC KristofferC added the bug Something isn't working label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant