Skip to content

Commit aff4a81

Browse files
committed
Very WIP: IPO codegen (#905)
* Very WIP: IPO codegen Depends on JuliaLang/julia#54373 and very much a work in progress, but I'm hoping to merge this after a little more work on this to avoid having this yet-again on a long-running unmerged branch. * Fix propagation bug * Start nonlinear codegen * SICM test working * NL SICM * Tests passing (but I don't feel good about it) * New ABI and implicit external test passing * WIP * WIP * Precompile tests * Up Deps * Up deps and adjust tests * Fix rebase version mistake * Adjust to upstream rename
1 parent 698e371 commit aff4a81

28 files changed

+2444
-313
lines changed

Manifest.toml

Lines changed: 223 additions & 184 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Project.toml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CentralizedCaches = "d1073d05-2d26-4019-b855-dfa0385fef5e"
99
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
1010
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
1111
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
12+
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
1213
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
1314
Diffractor = "9f5e2b26-1114-432f-b630-d3fe2085c51c"
1415
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -33,12 +34,24 @@ SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
3334
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
3435
Tracy = "e689c965-62c8-4b79-b2c5-8359227902fd"
3536

37+
[sources]
38+
ModelingToolkitStandardLibrary = {rev = "ox/dae_compatible5", url = "https://github.com/CedarEDA/ModelingToolkitStandardLibrary.jl"}
39+
SciMLBase = {rev = "os/dae-get-du2", url = "https://github.com/CedarEDA/SciMLBase.jl"}
40+
SciMLSensitivity = {rev = "kf/mindep2", url = "https://github.com/CedarEDA/SciMLSensitivity.jl"}
41+
42+
[weakdeps]
43+
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
44+
45+
[extensions]
46+
DAECompilerModelingToolkitExt = "ModelingToolkit"
47+
3648
[compat]
3749
Accessors = "0.1.36"
3850
CentralizedCaches = "1.1.0"
3951
ChainRules = "1.50"
4052
ChainRulesCore = "1.20"
4153
Cthulhu = "2.10.1"
54+
DiffEqBase = "6.149.2"
4255
Diffractor = "0.2.7"
4356
ForwardDiff = "0.10.36"
4457
ModelingToolkitStandardLibrary = "2.6.0"
@@ -55,22 +68,14 @@ Sundials = "4.19"
5568
SymbolicIndexingInterface = "0.3"
5669
julia = "1.11"
5770

58-
[sources]
59-
ModelingToolkitStandardLibrary = {url = "https://github.com/CedarEDA/ModelingToolkitStandardLibrary.jl", rev = "ox/dae_compatible5"}
60-
61-
[weakdeps]
62-
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
63-
64-
[extensions]
65-
DAECompilerModelingToolkitExt = "ModelingToolkit"
66-
6771
[extras]
6872
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
6973
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
7074
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
7175
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
7276
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
7377
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
78+
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
7479
ModelingToolkitStandardLibrary = "16a59e39-deab-5bd0-87e4-056b12336739"
7580
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
7681
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"

src/DAECompiler.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const CC = Core.Compiler
2323
import .CC: get_inference_world
2424
using Base: get_world_counter
2525

26+
# counters (for debugging and perf tracking)
27+
global nsicmcompiles::Int = 0
28+
global nrhscompiles::Int = 0
29+
global nfactorycompiles::Int = 0
30+
2631
const INIT_HOOKS = Function[]
2732
push_inithook!(f) = push!(INIT_HOOKS, f)
2833
__init__() = foreach(@nospecialize(f)->f(), INIT_HOOKS)
@@ -38,11 +43,13 @@ include("analysis/lattice.jl")
3843
include("cache.jl")
3944
include("analysis/interpreter.jl")
4045
include("irodesystem.jl")
46+
include("problem_interface.jl")
4147
include("analysis/compiler.jl")
4248

4349
include("transform/common.jl")
4450
include("transform/ad_common.jl")
4551
include("transform/mtk_passes.jl")
52+
include("transform/tearing_schedule_ipo.jl")
4653
include("transform/tearing_schedule.jl")
4754
include("transform/dae_transform.jl")
4855
include("transform/dae_finish.jl")

0 commit comments

Comments
 (0)