Hi, while I was trying the new version (v11) of ModelingToolkit.jl , I noticed it took longer to build the ODE system and problem under Julia 1.12.
Here is the GitHub actions workflow running the script
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using OrdinaryDiffEq
@parameters τ = 3.0 # parameters
@variables x(t) = 0.0 # dependent variables
eqs = [D(x) ~ (1 - x) / τ]
@time "Build system" @mtkcompile fol = System(eqs, t)
@time "Build problem" prob = ODEProblem(fol, [], (0.0, 10.0))
@time "Solve problem" sol = solve(prob, Tsit5())
Time for building the ODESystem / ODEProblem in seconds.
| MTK |
JL1.10 |
JL1.12 |
| v10 |
1.25/2.04 |
0.76/1.89 |
| v11 |
1.91/1.35 |
33.44/17.37 |
Is there anything I can do to reduce the first time to build systems/problems in 1.12?
1 Like
Hi! Thanks for reporting this. This is certainly very abnormal, and I’ve gone to great lengths to ensure that TTFX of MTKv11 on 1.12 is as fast as possible. I’ll investigate what’s going on here. Before I do, I’ll need a little more information.
- What versions of ModelingToolkit, ModelingToolkitBase, ModelingToolkitTearing, Symbolics and SymbolicUtils are you running?
- Did you run the above code in the REPL or as a script?
- What packages do you have in your global environment on each Julia version?
- Did you use the
--project flag when starting Julia? If you didn’t, and if you ran the code in a script file, how did you load the appropriate environment?
All questions should be answered in the linked CI workflow? fix · sosiristseng/mtk-ttfx@68045eb · GitHub
Ah, thanks. Somehow I glossed over that part.